From 1768c36aac4a392050bc11071cd63d397fb4269b Mon Sep 17 00:00:00 2001 From: BingqingLyu Date: Mon, 16 Dec 2024 15:55:53 +0800 Subject: [PATCH 01/23] [Insight] add http service on Groot Committed-by: BingqingLyu from Dev container --- interactive_engine/groot-client/pom.xml | 14 +++++ .../groot/service/GrootController.java | 35 +++++++++++++ .../groot/service/GrootService.java | 51 +++++++++++++++++++ interactive_engine/pom.xml | 20 ++++++++ 4 files changed, 120 insertions(+) create mode 100644 interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootController.java create mode 100644 interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootService.java diff --git a/interactive_engine/groot-client/pom.xml b/interactive_engine/groot-client/pom.xml index 6e98a5525928..f7109f6e91de 100644 --- a/interactive_engine/groot-client/pom.xml +++ b/interactive_engine/groot-client/pom.xml @@ -42,6 +42,20 @@ javax.annotation javax.annotation-api + + org.springframework.boot + spring-boot-starter-web + + + org.apache.tinkerpop + tinkergraph-gremlin + ${tinkerpop.version} + + + org.apache.tinkerpop + gremlin-driver + ${tinkerpop.version} + junit junit diff --git a/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootController.java b/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootController.java new file mode 100644 index 000000000000..3e49250b8509 --- /dev/null +++ b/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootController.java @@ -0,0 +1,35 @@ +package com.alibaba.graphscope.groot.service; + +import org.apache.tinkerpop.gremlin.driver.Result; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import com.alibaba.graphscope.groot.sdk.schema.Vertex; + +import java.util.List; +import java.util.concurrent.ExecutionException; + +@RestController +@RequestMapping("/api/v1/graph") +public class GrootController { + + private final GrootService grootService; + + @Autowired + public GrootController(GrootService grootService) { + this.grootService = grootService; + } + + @PostMapping("/vertex") + public ResponseEntity addVertex(@RequestBody Vertex vertex) { + long id = grootService.addVertex(vertex); + return ResponseEntity.ok(id); + } + + @PostMapping("/query/gremlin") + public ResponseEntity> executeGremlinQuery(@RequestBody String query) throws ExecutionException, InterruptedException { + List results = grootService.executeGremlinQuery(query).get(); + return ResponseEntity.ok(results); + } +} diff --git a/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootService.java b/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootService.java new file mode 100644 index 000000000000..fa7082b47c44 --- /dev/null +++ b/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootService.java @@ -0,0 +1,51 @@ +/** + * Copyright 2024 Alibaba Group Holding Limited. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.alibaba.graphscope.groot.service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.alibaba.graphscope.groot.sdk.GrootClient; +import com.alibaba.graphscope.groot.sdk.schema.Vertex; + +import java.util.List; +import java.util.concurrent.CompletableFuture; + +import org.apache.tinkerpop.gremlin.driver.Client; +import org.apache.tinkerpop.gremlin.driver.Result; +import org.apache.tinkerpop.gremlin.driver.ResultSet; + +@Service +public class GrootService { + private final GrootClient grootClient; + private final Client gremlinClient; + + @Autowired + public GrootService(GrootClient grootClient, Client gremlinClient) { + this.grootClient = grootClient; + this.gremlinClient = gremlinClient; + } + + public long addVertex(Vertex vertex) { + return grootClient.addVertex(vertex); + } + + public long addVertices(List vertices) { + return grootClient.addVertices(vertices); + } + + public CompletableFuture> executeGremlinQuery(String query) { + ResultSet resultSet = gremlinClient.submit(query); + return resultSet.all(); + } +} diff --git a/interactive_engine/pom.xml b/interactive_engine/pom.xml index e5f55ca86aec..285a919e9017 100644 --- a/interactive_engine/pom.xml +++ b/interactive_engine/pom.xml @@ -255,6 +255,8 @@ 4.4.0 0.4.3 no-gaia-ir + + 2.5.4 @@ -698,6 +700,19 @@ ${interactive.sdk.version} ${interactive.sdk.classifier} + + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot.version} + + + org.springframework.boot + spring-boot-starter-test + ${spring-boot.version} + test + @@ -885,6 +900,11 @@ + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + From e86b945c3c17c3c76e13edbefce15f034175f071 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Tue, 17 Dec 2024 20:55:44 +0800 Subject: [PATCH 02/23] refine and implement openapi service, including VertexManagementService and EdgeManagementService Committed-by: bingqing.lbq from Dev container Committed-by: BingqingLyu from Dev container --- flex/interactive/sdk/generate_sdk.sh | 18 + flex/openapi/openapi_interactive.yaml | 96 +- .../groot-http/.openapi-generator-ignore | 26 + .../groot-http/.openapi-generator/FILES | 78 + .../groot-http/.openapi-generator/VERSION | 1 + interactive_engine/groot-http/README.md | 21 + interactive_engine/groot-http/pom.xml | 82 + .../groot/OpenApiGeneratorApplication.java | 30 + .../graphscope/groot/RFC3339DateFormat.java | 38 + .../graphscope/groot/service/api/ApiUtil.java | 19 + .../graphscope/groot/service/api/V1Api.java | 1570 +++++++++ .../groot/service/api/V1ApiController.java | 77 + .../groot/service/impl/DtoConverter.java | 59 + .../service/impl/EdgeManagementService.java | 54 + .../groot/service/impl/GrootClientConfig.java | 16 + .../groot/service/impl/GrootController.java | 186 ++ .../service/impl/VertexManagementService.java | 52 + .../service/models/APIResponseWithCode.java | 107 + .../groot/service/models/BaseEdgeType.java | 120 + ...eEdgeTypeVertexTypePairRelationsInner.java | 198 ++ ...ertexTypePairRelationsInnerXCsrParams.java | 196 ++ .../service/models/BasePropertyMeta.java | 108 + .../groot/service/models/BaseVertexType.java | 144 + .../models/BaseVertexTypeXCsrParams.java | 86 + .../groot/service/models/ColumnMapping.java | 108 + .../groot/service/models/CreateEdgeType.java | 154 + .../service/models/CreateGraphRequest.java | 169 + .../service/models/CreateGraphResponse.java | 83 + .../models/CreateGraphSchemaRequest.java | 130 + .../models/CreateProcedureRequest.java | 204 ++ .../models/CreateProcedureResponse.java | 94 + .../service/models/CreatePropertyMeta.java | 108 + .../service/models/CreateVertexType.java | 178 + .../groot/service/models/DateType.java | 95 + .../service/models/DeleteEdgeRequest.java | 131 + .../groot/service/models/EdgeData.java | 232 ++ .../groot/service/models/EdgeMapping.java | 222 ++ ...MappingDestinationVertexMappingsInner.java | 111 + .../EdgeMappingSourceVertexMappingsInner.java | 111 + ...appingSourceVertexMappingsInnerColumn.java | 109 + .../models/EdgeMappingTypeTriplet.java | 134 + .../groot/service/models/EdgeRequest.java | 249 ++ .../groot/service/models/EdgeStatistics.java | 144 + .../groot/service/models/FixedChar.java | 96 + .../groot/service/models/FixedCharChar.java | 96 + .../groot/service/models/GSDataType.java | 28 + .../groot/service/models/GetEdgeType.java | 202 ++ .../service/models/GetGraphResponse.java | 348 ++ .../models/GetGraphSchemaResponse.java | 130 + .../models/GetGraphStatisticsResponse.java | 190 ++ .../service/models/GetProcedureResponse.java | 477 +++ .../groot/service/models/GetPropertyMeta.java | 132 + .../groot/service/models/GetVertexType.java | 226 ++ .../groot/service/models/JobResponse.java | 83 + .../groot/service/models/JobStatus.java | 280 ++ .../groot/service/models/LongText.java | 95 + .../groot/service/models/Parameter.java | 120 + .../groot/service/models/PrimitiveType.java | 142 + .../groot/service/models/Property.java | 119 + .../groot/service/models/QueryRequest.java | 131 + .../groot/service/models/SchemaMapping.java | 155 + .../models/SchemaMappingLoadingConfig.java | 196 ++ .../SchemaMappingLoadingConfigDataSource.java | 145 + .../SchemaMappingLoadingConfigFormat.java | 120 + .../SchemaMappingLoadingConfigXCsrParams.java | 134 + .../groot/service/models/ServiceStatus.java | 228 ++ .../service/models/StartServiceRequest.java | 83 + .../service/models/StopServiceRequest.java | 97 + .../service/models/StoredProcedureMeta.java | 381 +++ .../groot/service/models/StringType.java | 96 + .../service/models/StringTypeString.java | 28 + .../groot/service/models/TemporalType.java | 96 + .../service/models/TemporalTypeTemporal.java | 25 + .../groot/service/models/TimeStampType.java | 95 + .../groot/service/models/TypedValue.java | 120 + .../models/UpdateProcedureRequest.java | 83 + .../service/models/UploadFileResponse.java | 129 + .../groot/service/models/VarChar.java | 96 + .../groot/service/models/VarCharVarChar.java | 96 + .../groot/service/models/VertexData.java | 131 + .../service/models/VertexEdgeRequest.java | 142 + .../groot/service/models/VertexMapping.java | 153 + .../groot/service/models/VertexRequest.java | 166 + .../service/models/VertexStatistics.java | 131 + .../models/VertexTypePairStatistics.java | 144 + .../configuration/HomeController.java | 20 + .../configuration/SpringDocConfiguration.java | 36 + .../src/main/resources/application.properties | 3 + .../src/main/resources/openapi.yaml | 2951 +++++++++++++++++ .../OpenApiGeneratorApplicationTests.java | 13 + interactive_engine/pom.xml | 10 +- 91 files changed, 15301 insertions(+), 45 deletions(-) create mode 100644 interactive_engine/groot-http/.openapi-generator-ignore create mode 100644 interactive_engine/groot-http/.openapi-generator/FILES create mode 100644 interactive_engine/groot-http/.openapi-generator/VERSION create mode 100644 interactive_engine/groot-http/README.md create mode 100644 interactive_engine/groot-http/pom.xml create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplication.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/RFC3339DateFormat.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootClientConfig.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java create mode 100644 interactive_engine/groot-http/src/main/java/org/openapitools/configuration/HomeController.java create mode 100644 interactive_engine/groot-http/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java create mode 100644 interactive_engine/groot-http/src/main/resources/application.properties create mode 100644 interactive_engine/groot-http/src/main/resources/openapi.yaml create mode 100644 interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java diff --git a/flex/interactive/sdk/generate_sdk.sh b/flex/interactive/sdk/generate_sdk.sh index e38c33bc9920..425a19bbfb59 100755 --- a/flex/interactive/sdk/generate_sdk.sh +++ b/flex/interactive/sdk/generate_sdk.sh @@ -81,6 +81,21 @@ function do_gen_python() { eval $cmd } +function do_gen_spring() { + echo "Generating Spring API" + # TODO: make output path to groot-client path + OUTPUT_PATH="${CUR_DIR}/../../../interactive_engine/groot-http" + GROOT_PACKAGE_NAME="com.alibaba.graphscope.groot" + GROOT_ARTIFACT_ID="groot-http" + additional_properties="apiPackage=${GROOT_PACKAGE_NAME}.service.api,modelPackage=${GROOT_PACKAGE_NAME}.service.models,artifactId=${GROOT_ARTIFACT_ID},groupId=${GROUP_ID},invokerPackage=${GROOT_PACKAGE_NAME}" + export JAVA_OPTS="-Dlog.level=${LOG_LEVEL}" + cmd="openapi-generator-cli generate -i ${OPENAPI_SPEC_PATH} -g spring -o ${OUTPUT_PATH}" + cmd=" ${cmd} --additional-properties=${additional_properties}" + echo "Running command: ${cmd}" + + eval $cmd +} + function do_gen() { # expect only one argument if [ $# -ne 1 ]; then @@ -97,6 +112,9 @@ function do_gen() { python) do_gen_python ;; + spring) + do_gen_spring + ;; *) err "Unsupported language: $lang" usage diff --git a/flex/openapi/openapi_interactive.yaml b/flex/openapi/openapi_interactive.yaml index 961a904869db..513b1043e716 100644 --- a/flex/openapi/openapi_interactive.yaml +++ b/flex/openapi/openapi_interactive.yaml @@ -641,25 +641,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/VertexEdgeRequest' + type: array + items: + $ref: '#/components/schemas/VertexRequest' example: - vertex_request: - label: "person" - primary_key_value: 2 + primary_key_values: + id: 2 properties: age: 24 name: "Cindy" - edge_request: - - src_label: "person" - dst_label: "software" - edge_label: "created" - src_pk_name: "id" - src_pk_value: 1 - dst_pk_name: "id" - dst_pk_value: 3 - properties: - - name: "weight" - value: 0.2 responses: '200': @@ -785,12 +776,15 @@ paths: description: The label name of querying vertex. schema: type: string - - name: primary_key_value - in: query - required: true - description: The value of the querying vertex's primary key - schema: - $ref: '#/components/schemas/AnyValue' + requestBody: + description: The primary key values of the vertex to delete. + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Property' responses: '200': description: Successfully delete vertex @@ -1066,21 +1060,20 @@ paths: required: true schema: type: string - - name: src_label + - name: edge_label in: query required: true - description: The label name of src vertex. + description: The label name of edge. schema: type: string - example: person - - name: src_primary_key_value + example: created + - name: src_label in: query required: true - description: The primary key value of src vertex. + description: The label name of src vertex. schema: - $ref: '#/components/schemas/AnyValue' - # type: object - example: 1 + type: string + example: person - name: dst_label in: query required: true @@ -1088,13 +1081,22 @@ paths: schema: type: string example: software - - name: dst_primary_key_value - in: query - required: true - description: The primary key value of dst vertex. - schema: - $ref: '#/components/schemas/AnyValue' - example: 3 + requestBody: + description: The primary key values of the src and dst vertices. + required: true + content: + application/json: + schema: + type: object + properties: + src_primary_key_values: + type: array + items: + $ref: '#/components/schemas/Property' + dst_primary_key_values: + type: array + items: + $ref: '#/components/schemas/Property' responses: '200': description: Successfully delete edge @@ -1441,14 +1443,16 @@ components: type: object required: - label - - primary_key_value + - primary_key_values - properties properties: label: type: string example: person - primary_key_value: - $ref: '#/components/schemas/AnyValue' + primary_key_values: + type: array + items: + $ref: '#/components/schemas/Property' properties: type: array items: @@ -1501,8 +1505,8 @@ components: - src_label - dst_label - edge_label - - src_primary_key_value - - dst_primary_key_value + - src_primary_key_values + - dst_primary_key_values properties: src_label: type: string @@ -1513,10 +1517,14 @@ components: edge_label: type: string example: created - src_primary_key_value: - $ref: '#/components/schemas/AnyValue' - dst_primary_key_value: - $ref: '#/components/schemas/AnyValue' + src_primary_key_values: + type: array + items: + $ref: '#/components/schemas/Property' + dst_primary_key_values: + type: array + items: + $ref: '#/components/schemas/Property' properties: type: array items: diff --git a/interactive_engine/groot-http/.openapi-generator-ignore b/interactive_engine/groot-http/.openapi-generator-ignore new file mode 100644 index 000000000000..0d2353b94de5 --- /dev/null +++ b/interactive_engine/groot-http/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +pom.xml +src/main/java/com/alibaba/graphscope/groot/service/impl \ No newline at end of file diff --git a/interactive_engine/groot-http/.openapi-generator/FILES b/interactive_engine/groot-http/.openapi-generator/FILES new file mode 100644 index 000000000000..e97965899cf7 --- /dev/null +++ b/interactive_engine/groot-http/.openapi-generator/FILES @@ -0,0 +1,78 @@ +README.md +src/main/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplication.java +src/main/java/com/alibaba/graphscope/groot/RFC3339DateFormat.java +src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java +src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java +src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java +src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java +src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java +src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java +src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java +src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java +src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java +src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java +src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java +src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java +src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java +src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java +src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java +src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java +src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java +src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java +src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java +src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java +src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java +src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java +src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java +src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java +src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java +src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java +src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java +src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java +src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java +src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java +src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java +src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java +src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java +src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java +src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java +src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java +src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java +src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java +src/main/java/com/alibaba/graphscope/groot/service/models/Property.java +src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java +src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java +src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java +src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java +src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java +src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java +src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java +src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java +src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java +src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java +src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java +src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java +src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java +src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java +src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java +src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java +src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java +src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java +src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java +src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringDocConfiguration.java +src/main/resources/application.properties +src/main/resources/openapi.yaml +src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java diff --git a/interactive_engine/groot-http/.openapi-generator/VERSION b/interactive_engine/groot-http/.openapi-generator/VERSION new file mode 100644 index 000000000000..4b49d9bb63ee --- /dev/null +++ b/interactive_engine/groot-http/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.2.0 \ No newline at end of file diff --git a/interactive_engine/groot-http/README.md b/interactive_engine/groot-http/README.md new file mode 100644 index 000000000000..5cd22b6081a2 --- /dev/null +++ b/interactive_engine/groot-http/README.md @@ -0,0 +1,21 @@ +# OpenAPI generated server + +Spring Boot Server + +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. +This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + + +The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). +Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. +The specification is available to download using the following url: +http://localhost:8080/v3/api-docs/ + +Start your server as a simple java application + +You can view the api documentation in swagger-ui by pointing to +http://localhost:8080/swagger-ui.html + +Change default port value in application.properties \ No newline at end of file diff --git a/interactive_engine/groot-http/pom.xml b/interactive_engine/groot-http/pom.xml new file mode 100644 index 000000000000..417c59d70191 --- /dev/null +++ b/interactive_engine/groot-http/pom.xml @@ -0,0 +1,82 @@ + + + interactive-parent + com.alibaba.graphscope + ${revision} + ../pom.xml + + 4.0.0 + groot-http + jar + ${project.groupId}:${project.artifactId} + + 1.8 + ${java.version} + ${java.version} + UTF-8 + 1.6.14 + 5.3.1 + + + src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.data + spring-data-commons + + + + org.springdoc + springdoc-openapi-ui + ${springdoc.version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.6 + + + + org.springframework.boot + spring-boot-starter-validation + + + com.fasterxml.jackson.core + jackson-databind + + + org.springframework.boot + spring-boot-starter-test + test + + + com.alibaba.graphscope + groot-client + + + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplication.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..f678ef62e3f7 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplication.java @@ -0,0 +1,30 @@ +package com.alibaba.graphscope.groot; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.FilterType; +import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; + +@SpringBootApplication( + nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class +) +@ComponentScan( + basePackages = {"com.alibaba.graphscope.groot", "com.alibaba.graphscope.groot.service.api" , "org.openapitools.configuration"}, + nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class +) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean(name = "com.alibaba.graphscope.groot.OpenApiGeneratorApplication.jsonNullableModule") + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/RFC3339DateFormat.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/RFC3339DateFormat.java new file mode 100644 index 000000000000..9b5648ee6260 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/RFC3339DateFormat.java @@ -0,0 +1,38 @@ +package com.alibaba.graphscope.groot; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return this; + } +} \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java new file mode 100644 index 000000000000..620875a12ddd --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java @@ -0,0 +1,19 @@ +package com.alibaba.graphscope.groot.service.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java new file mode 100644 index 000000000000..6740cf2d3ceb --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java @@ -0,0 +1,1570 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.2.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package com.alibaba.graphscope.groot.service.api; + +import com.alibaba.graphscope.groot.service.models.APIResponseWithCode; +import com.alibaba.graphscope.groot.service.models.CreateGraphRequest; +import com.alibaba.graphscope.groot.service.models.CreateGraphResponse; +import com.alibaba.graphscope.groot.service.models.CreateProcedureRequest; +import com.alibaba.graphscope.groot.service.models.CreateProcedureResponse; +import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; +import com.alibaba.graphscope.groot.service.models.EdgeData; +import com.alibaba.graphscope.groot.service.models.EdgeRequest; +import com.alibaba.graphscope.groot.service.models.GetGraphResponse; +import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; +import com.alibaba.graphscope.groot.service.models.GetGraphStatisticsResponse; +import com.alibaba.graphscope.groot.service.models.GetProcedureResponse; +import com.alibaba.graphscope.groot.service.models.JobResponse; +import com.alibaba.graphscope.groot.service.models.JobStatus; +import com.alibaba.graphscope.groot.service.models.Property; +import com.alibaba.graphscope.groot.service.models.SchemaMapping; +import com.alibaba.graphscope.groot.service.models.ServiceStatus; +import com.alibaba.graphscope.groot.service.models.StartServiceRequest; +import com.alibaba.graphscope.groot.service.models.StopServiceRequest; +import com.alibaba.graphscope.groot.service.models.UpdateProcedureRequest; +import com.alibaba.graphscope.groot.service.models.UploadFileResponse; +import com.alibaba.graphscope.groot.service.models.VertexData; +import com.alibaba.graphscope.groot.service.models.VertexRequest; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Validated +@Tag(name = "GraphService/EdgeManagement", description = "EdgeManagement") +public interface V1Api { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /v1/graph/{graph_id}/edge : Add edge to the graph + * Add the edge to graph. + * + * @param graphId (required) + * @param edgeRequest (required) + * @return Successfully insert the edge (status code 200) + * or Invalid input edge (status code 400) + * or edge already exists (status code 409) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "addEdge", + summary = "Add edge to the graph", + description = "Add the edge to graph. ", + tags = { "GraphService/EdgeManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully insert the edge", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid input edge", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "409", description = "edge already exists", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "500", description = "Server internal error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph/{graph_id}/edge", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity addEdge( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "EdgeRequest", description = "", required = true) @Valid @RequestBody List<@Valid EdgeRequest> edgeRequest + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/graph/{graph_id}/vertex : Add vertex to the graph + * Add the provided vertex to the specified graph. + * + * @param graphId (required) + * @param vertexRequest (required) + * @return Successfully created vertex (status code 200) + * or Invalid input vertex (status code 400) + * or Graph not found (status code 404) + * or Vertex already exists (status code 409) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "addVertex", + summary = "Add vertex to the graph", + description = "Add the provided vertex to the specified graph. ", + tags = { "GraphService/VertexManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully created vertex", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid input vertex", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "404", description = "Graph not found", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "409", description = "Vertex already exists", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "500", description = "Server internal error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph/{graph_id}/vertex", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity addVertex( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "VertexRequest", description = "", required = true) @Valid @RequestBody List<@Valid VertexRequest> vertexRequest + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/graph/{graph_id}/query : run queries on graph + * After the procedure is created, user can use this API to run the procedure. + * + * @param graphId (required) + * @param body (optional) + * @return Successfully runned. (status code 200) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "callProc", + summary = "run queries on graph", + description = "After the procedure is created, user can use this API to run the procedure. ", + tags = { "QueryService" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully runned.", content = { + @Content(mediaType = "text/plain", schema = @Schema(implementation = byte[].class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = byte[].class)) + }), + @ApiResponse(responseCode = "500", description = "Server internal error", content = { + @Content(mediaType = "text/plain", schema = @Schema(implementation = APIResponseWithCode.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph/{graph_id}/query", + produces = { "text/plain", "application/json" }, + consumes = { "text/plain" } + ) + + default ResponseEntity callProc( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "body", description = "") @Valid @RequestBody(required = false) byte[] body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/graph/current/query : run queries on the running graph + * Submit a query to the running graph. + * + * @param body (optional) + * @return Successfully runned. Empty if failed? (status code 200) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "callProcCurrent", + summary = "run queries on the running graph", + description = "Submit a query to the running graph. ", + tags = { "QueryService" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully runned. Empty if failed?", content = { + @Content(mediaType = "text/plain", schema = @Schema(implementation = byte[].class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = byte[].class)) + }), + @ApiResponse(responseCode = "500", description = "Server internal error", content = { + @Content(mediaType = "text/plain", schema = @Schema(implementation = APIResponseWithCode.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph/current/query", + produces = { "text/plain", "application/json" }, + consumes = { "text/plain" } + ) + + default ResponseEntity callProcCurrent( + @Parameter(name = "body", description = "") @Valid @RequestBody(required = false) byte[] body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/graph/{graph_id}/dataloading + * Create a dataloading job + * + * @param graphId The id of graph to do bulk loading. (required) + * @param schemaMapping (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createDataloadingJob", + description = "Create a dataloading job", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = JobResponse.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph/{graph_id}/dataloading", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity createDataloadingJob( + @Parameter(name = "graph_id", description = "The id of graph to do bulk loading.", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "SchemaMapping", description = "", required = true) @Valid @RequestBody SchemaMapping schemaMapping + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"job_id\" : \"job_id\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/graph + * Create a new graph + * + * @param createGraphRequest (required) + * @return successful operation (status code 200) + * or BadRequest (status code 400) + * or Internal error (status code 500) + */ + @Operation( + operationId = "createGraph", + description = "Create a new graph", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = CreateGraphResponse.class)) + }), + @ApiResponse(responseCode = "400", description = "BadRequest", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "500", description = "Internal error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity createGraph( + @Parameter(name = "CreateGraphRequest", description = "", required = true) @Valid @RequestBody CreateGraphRequest createGraphRequest + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"graph_id\" : \"1\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/graph/{graph_id}/procedure + * Create a new procedure on a graph + * + * @param graphId (required) + * @param createProcedureRequest (required) + * @return successful operation (status code 200) + * or Bad request (status code 400) + * or not found (status code 404) + * or Internal Error (status code 500) + */ + @Operation( + operationId = "createProcedure", + description = "Create a new procedure on a graph", + tags = { "AdminService/ProcedureManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = CreateProcedureResponse.class)) + }), + @ApiResponse(responseCode = "400", description = "Bad request", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "404", description = "not found", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "500", description = "Internal Error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph/{graph_id}/procedure", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity createProcedure( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "CreateProcedureRequest", description = "", required = true) @Valid @RequestBody CreateProcedureRequest createProcedureRequest + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"procedure_id\" : \"proc1\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /v1/graph/{graph_id}/edge : Remove edge from the graph + * Remove the edge from current graph. + * + * @param graphId (required) + * @param edgeLabel The label name of edge. (required) + * @param srcLabel The label name of src vertex. (required) + * @param dstLabel The label name of dst vertex. (required) + * @param deleteEdgeRequest The primary key values of the src and dst vertices. (required) + * @return Successfully delete edge (status code 200) + * or Invalid input edge (status code 400) + * or Edge not exists or Graph not exits (status code 404) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "deleteEdge", + summary = "Remove edge from the graph", + description = "Remove the edge from current graph. ", + tags = { "GraphService/EdgeManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully delete edge", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid input edge", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "404", description = "Edge not exists or Graph not exits", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "500", description = "Server internal error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/v1/graph/{graph_id}/edge", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity deleteEdge( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @NotNull @Parameter(name = "edge_label", description = "The label name of edge.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "edge_label", required = true) String edgeLabel, + @NotNull @Parameter(name = "src_label", description = "The label name of src vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "src_label", required = true) String srcLabel, + @NotNull @Parameter(name = "dst_label", description = "The label name of dst vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "dst_label", required = true) String dstLabel, + @Parameter(name = "DeleteEdgeRequest", description = "The primary key values of the src and dst vertices.", required = true) @Valid @RequestBody DeleteEdgeRequest deleteEdgeRequest + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /v1/graph/{graph_id} + * Delete a graph by id + * + * @param graphId The id of graph to delete (required) + * @return Successful operation (status code 200) + * or Not Found (status code 404) + * or Internal Error (status code 500) + */ + @Operation( + operationId = "deleteGraph", + description = "Delete a graph by id", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "404", description = "Not Found", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "500", description = "Internal Error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/v1/graph/{graph_id}", + produces = { "application/json" } + ) + + default ResponseEntity deleteGraph( + @Parameter(name = "graph_id", description = "The id of graph to delete", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /v1/job/{job_id} + * + * @param jobId (required) + * @return Successful operation (status code 200) + */ + @Operation( + operationId = "deleteJobById", + tags = { "AdminService/JobManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/v1/job/{job_id}", + produces = { "application/json" } + ) + + default ResponseEntity deleteJobById( + @Parameter(name = "job_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("job_id") String jobId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /v1/graph/{graph_id}/procedure/{procedure_id} + * Delete a procedure on a graph by id + * + * @param graphId (required) + * @param procedureId (required) + * @return Successful operation (status code 200) + * or Not Found (status code 404) + */ + @Operation( + operationId = "deleteProcedure", + description = "Delete a procedure on a graph by id", + tags = { "AdminService/ProcedureManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "404", description = "Not Found", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/v1/graph/{graph_id}/procedure/{procedure_id}", + produces = { "application/json" } + ) + + default ResponseEntity deleteProcedure( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "procedure_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("procedure_id") String procedureId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /v1/graph/{graph_id}/vertex : Remove vertex from the graph + * Remove the vertex from the specified graph. + * + * @param graphId (required) + * @param label The label name of querying vertex. (required) + * @param property The primary key values of the vertex to delete. (required) + * @return Successfully delete vertex (status code 200) + * or Invalid input vertex (status code 400) + * or Vertex not exists or Graph not exits. (status code 404) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "deleteVertex", + summary = "Remove vertex from the graph", + description = "Remove the vertex from the specified graph. ", + tags = { "GraphService/VertexManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully delete vertex", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid input vertex", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "404", description = "Vertex not exists or Graph not exits.", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "500", description = "Server internal error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/v1/graph/{graph_id}/vertex", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity deleteVertex( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @NotNull @Parameter(name = "label", description = "The label name of querying vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "label", required = true) String label, + @Parameter(name = "Property", description = "The primary key values of the vertex to delete.", required = true) @Valid @RequestBody List<@Valid Property> property + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /v1/graph/{graph_id}/edge : Get the edge's properties with src and dst vertex primary keys. + * Get the properties for the specified vertex. + * + * @param graphId (required) + * @param edgeLabel The label name of querying edge. (required) + * @param srcLabel The label name of src vertex. (required) + * @param srcPrimaryKeyValue The primary key value of src vertex. (required) + * @param dstLabel The label name of dst vertex. (required) + * @param dstPrimaryKeyValue The value of dst vertex's primary key (required) + * @return Found Edge (status code 200) + * or Bad input parameter (status code 400) + * or Edge not found or Graph not found (status code 404) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "getEdge", + summary = "Get the edge's properties with src and dst vertex primary keys.", + description = "Get the properties for the specified vertex. ", + tags = { "GraphService/EdgeManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Found Edge", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = EdgeData.class)) + }), + @ApiResponse(responseCode = "400", description = "Bad input parameter", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "404", description = "Edge not found or Graph not found", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "500", description = "Server internal error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/v1/graph/{graph_id}/edge", + produces = { "application/json" } + ) + + default ResponseEntity getEdge( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @NotNull @Parameter(name = "edge_label", description = "The label name of querying edge.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "edge_label", required = true) String edgeLabel, + @NotNull @Parameter(name = "src_label", description = "The label name of src vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "src_label", required = true) String srcLabel, + @NotNull @Parameter(name = "src_primary_key_value", description = "The primary key value of src vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "src_primary_key_value", required = true) Object srcPrimaryKeyValue, + @NotNull @Parameter(name = "dst_label", description = "The label name of dst vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "dst_label", required = true) String dstLabel, + @NotNull @Parameter(name = "dst_primary_key_value", description = "The value of dst vertex's primary key", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "dst_primary_key_value", required = true) Object dstPrimaryKeyValue + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"src_label\" : \"person\", \"src_primary_key_value\" : \"\", \"dst_label\" : \"software\", \"edge_label\" : \"created\", \"dst_primary_key_value\" : \"\", \"properties\" : [ { \"name\" : \"id\", \"value\" : \"\" }, { \"name\" : \"id\", \"value\" : \"\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /v1/graph/{graph_id} + * Get a graph by name + * + * @param graphId The id of graph to get (required) + * @return Successful operation (status code 200) + * or Not found (status code 404) + */ + @Operation( + operationId = "getGraph", + description = "Get a graph by name", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = GetGraphResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "Not found", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/v1/graph/{graph_id}", + produces = { "application/json" } + ) + + default ResponseEntity getGraph( + @Parameter(name = "graph_id", description = "The id of graph to get", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"creation_time\" : 11223444, \"schema\" : { \"vertex_types\" : [ null, null ], \"edge_types\" : [ null, null ] }, \"stored_procedures\" : [ null, null ], \"name\" : \"name\", \"description\" : \"description\", \"id\" : \"id\", \"store_type\" : \"mutable_csr\", \"data_import_config\" : { \"loading_config\" : { \"x_csr_params\" : { \"parallelism\" : 0, \"build_csr_in_mem\" : true, \"use_mmap_vector\" : true }, \"format\" : { \"metadata\" : { \"key\" : \"\" }, \"type\" : \"type\" }, \"import_option\" : \"init\", \"data_source\" : { \"scheme\" : \"odps\", \"location\" : \"location\" } }, \"edge_mappings\" : [ { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } }, { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } } ], \"vertex_mappings\" : [ { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] }, { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] } ] }, \"version\" : \"version\", \"data_update_time\" : 11123445 }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /v1/graph/{graph_id}/statistics + * Get the statics info of a graph, including number of vertices for each label, number of edges for each label. + * + * @param graphId The id of graph to get statistics (required) + * @return successful operation (status code 200) + * or Server Internal Error (status code 500) + * or Not Found (status code 404) + * or Service Unavailable (status code 503) + */ + @Operation( + operationId = "getGraphStatistic", + description = "Get the statics info of a graph, including number of vertices for each label, number of edges for each label.", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = GetGraphStatisticsResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "Server Internal Error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "404", description = "Not Found", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "503", description = "Service Unavailable", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/v1/graph/{graph_id}/statistics", + produces = { "application/json" } + ) + + default ResponseEntity getGraphStatistic( + @Parameter(name = "graph_id", description = "The id of graph to get statistics", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"edge_type_statistics\" : [ { \"type_name\" : \"type_name\", \"type_id\" : 5, \"vertex_type_pair_statistics\" : [ { \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\", \"count\" : 2 }, { \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\", \"count\" : 2 } ] }, { \"type_name\" : \"type_name\", \"type_id\" : 5, \"vertex_type_pair_statistics\" : [ { \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\", \"count\" : 2 }, { \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\", \"count\" : 2 } ] } ], \"total_vertex_count\" : 0, \"vertex_type_statistics\" : [ { \"type_name\" : \"type_name\", \"type_id\" : 1, \"count\" : 5 }, { \"type_name\" : \"type_name\", \"type_id\" : 1, \"count\" : 5 } ], \"total_edge_count\" : 6 }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /v1/job/{job_id} + * + * @param jobId The id of the job, returned from POST /v1/graph/{graph_id}/dataloading (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "getJobById", + tags = { "AdminService/JobManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = JobStatus.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/v1/job/{job_id}", + produces = { "application/json" } + ) + + default ResponseEntity getJobById( + @Parameter(name = "job_id", description = "The id of the job, returned from POST /v1/graph/{graph_id}/dataloading", required = true, in = ParameterIn.PATH) @PathVariable("job_id") String jobId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"start_time\" : 0, \"log\" : \"log\", \"end_time\" : 6, \"id\" : \"id\", \"detail\" : { \"key\" : \"\" }, \"type\" : \"type\", \"status\" : \"RUNNING\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /v1/graph/{graph_id}/procedure/{procedure_id} + * Get a procedure by id + * + * @param graphId (required) + * @param procedureId (required) + * @return successful operation (status code 200) + * or Not found (status code 404) + */ + @Operation( + operationId = "getProcedure", + description = "Get a procedure by id", + tags = { "AdminService/ProcedureManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = GetProcedureResponse.class)) + }), + @ApiResponse(responseCode = "404", description = "Not found", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/v1/graph/{graph_id}/procedure/{procedure_id}", + produces = { "application/json" } + ) + + default ResponseEntity getProcedure( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "procedure_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("procedure_id") String procedureId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "null"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /v1/graph/{graph_id}/schema + * Get schema by graph id + * + * @param graphId The id of graph to delete (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "getSchema", + description = "Get schema by graph id", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = GetGraphSchemaResponse.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/v1/graph/{graph_id}/schema", + produces = { "application/json" } + ) + + default ResponseEntity getSchema( + @Parameter(name = "graph_id", description = "The id of graph to delete", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"vertex_types\" : [ null, null ], \"edge_types\" : [ null, null ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /v1/service/status + * Get service status + * + * @return successful operation (status code 200) + */ + @Operation( + operationId = "getServiceStatus", + description = "Get service status", + tags = { "AdminService/ServiceManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ServiceStatus.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/v1/service/status", + produces = { "application/json" } + ) + + default ResponseEntity getServiceStatus( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"start_time\" : 5, \"statistics_enabled\" : true, \"bolt_port\" : 0, \"hqps_port\" : 6, \"gremlin_port\" : 1, \"graph\" : { \"creation_time\" : 11223444, \"schema\" : { \"vertex_types\" : [ null, null ], \"edge_types\" : [ null, null ] }, \"stored_procedures\" : [ null, null ], \"name\" : \"name\", \"description\" : \"description\", \"id\" : \"id\", \"store_type\" : \"mutable_csr\", \"data_import_config\" : { \"loading_config\" : { \"x_csr_params\" : { \"parallelism\" : 0, \"build_csr_in_mem\" : true, \"use_mmap_vector\" : true }, \"format\" : { \"metadata\" : { \"key\" : \"\" }, \"type\" : \"type\" }, \"import_option\" : \"init\", \"data_source\" : { \"scheme\" : \"odps\", \"location\" : \"location\" } }, \"edge_mappings\" : [ { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } }, { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } } ], \"vertex_mappings\" : [ { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] }, { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] } ] }, \"version\" : \"version\", \"data_update_time\" : 11123445 }, \"status\" : \"status\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /v1/graph/{graph_id}/vertex : Get the vertex's properties with vertex primary key. + * Get the properties for the specified vertex. example: ```http GET /endpoint?param1=value1&param2=value2 HTTP/1.1 Host: example.com ``` + * + * @param graphId The id of the graph (required) + * @param label The label name of querying vertex. (required) + * @param primaryKeyValue The primary key value of querying vertex. (required) + * @return Found vertex (status code 200) + * or Bad input parameter (status code 400) + * or Vertex not found or graph not found (status code 404) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "getVertex", + summary = "Get the vertex's properties with vertex primary key.", + description = "Get the properties for the specified vertex. example: ```http GET /endpoint?param1=value1¶m2=value2 HTTP/1.1 Host: example.com ``` ", + tags = { "GraphService/VertexManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Found vertex", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = VertexData.class)) + }), + @ApiResponse(responseCode = "400", description = "Bad input parameter"), + @ApiResponse(responseCode = "404", description = "Vertex not found or graph not found"), + @ApiResponse(responseCode = "500", description = "Server internal error") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/v1/graph/{graph_id}/vertex", + produces = { "application/json" } + ) + + default ResponseEntity getVertex( + @Parameter(name = "graph_id", description = "The id of the graph", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @NotNull @Parameter(name = "label", description = "The label name of querying vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "label", required = true) String label, + @NotNull @Parameter(name = "primary_key_value", description = "The primary key value of querying vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "primary_key_value", required = true) Object primaryKeyValue + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"values\" : [ { \"name\" : \"id\", \"value\" : \"\" }, { \"name\" : \"id\", \"value\" : \"\" } ], \"label\" : \"person\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /v1/graph + * List all graphs + * + * @return Successful operation (status code 200) + */ + @Operation( + operationId = "listGraphs", + description = "List all graphs", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful operation", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = GetGraphResponse.class))) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/v1/graph", + produces = { "application/json" } + ) + + default ResponseEntity> listGraphs( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"creation_time\" : 11223444, \"schema\" : { \"vertex_types\" : [ null, null ], \"edge_types\" : [ null, null ] }, \"stored_procedures\" : [ null, null ], \"name\" : \"name\", \"description\" : \"description\", \"id\" : \"id\", \"store_type\" : \"mutable_csr\", \"data_import_config\" : { \"loading_config\" : { \"x_csr_params\" : { \"parallelism\" : 0, \"build_csr_in_mem\" : true, \"use_mmap_vector\" : true }, \"format\" : { \"metadata\" : { \"key\" : \"\" }, \"type\" : \"type\" }, \"import_option\" : \"init\", \"data_source\" : { \"scheme\" : \"odps\", \"location\" : \"location\" } }, \"edge_mappings\" : [ { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } }, { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } } ], \"vertex_mappings\" : [ { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] }, { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] } ] }, \"version\" : \"version\", \"data_update_time\" : 11123445 }, { \"creation_time\" : 11223444, \"schema\" : { \"vertex_types\" : [ null, null ], \"edge_types\" : [ null, null ] }, \"stored_procedures\" : [ null, null ], \"name\" : \"name\", \"description\" : \"description\", \"id\" : \"id\", \"store_type\" : \"mutable_csr\", \"data_import_config\" : { \"loading_config\" : { \"x_csr_params\" : { \"parallelism\" : 0, \"build_csr_in_mem\" : true, \"use_mmap_vector\" : true }, \"format\" : { \"metadata\" : { \"key\" : \"\" }, \"type\" : \"type\" }, \"import_option\" : \"init\", \"data_source\" : { \"scheme\" : \"odps\", \"location\" : \"location\" } }, \"edge_mappings\" : [ { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } }, { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } } ], \"vertex_mappings\" : [ { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] }, { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] } ] }, \"version\" : \"version\", \"data_update_time\" : 11123445 } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /v1/job + * + * @return successful operation (status code 200) + */ + @Operation( + operationId = "listJobs", + tags = { "AdminService/JobManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = JobStatus.class))) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/v1/job", + produces = { "application/json" } + ) + + default ResponseEntity> listJobs( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"start_time\" : 0, \"log\" : \"log\", \"end_time\" : 6, \"id\" : \"id\", \"detail\" : { \"key\" : \"\" }, \"type\" : \"type\", \"status\" : \"RUNNING\" }, { \"start_time\" : 0, \"log\" : \"log\", \"end_time\" : 6, \"id\" : \"id\", \"detail\" : { \"key\" : \"\" }, \"type\" : \"type\", \"status\" : \"RUNNING\" } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /v1/graph/{graph_id}/procedure + * List all procedures + * + * @param graphId (required) + * @return Successful operation (status code 200) + * or Not found (status code 404) + */ + @Operation( + operationId = "listProcedures", + description = "List all procedures", + tags = { "AdminService/ProcedureManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful operation", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = GetProcedureResponse.class))) + }), + @ApiResponse(responseCode = "404", description = "Not found", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/v1/graph/{graph_id}/procedure", + produces = { "application/json" } + ) + + default ResponseEntity> listProcedures( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ null, null ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/service/restart + * Start current service + * + * @return successful operation (status code 200) + */ + @Operation( + operationId = "restartService", + description = "Start current service", + tags = { "AdminService/ServiceManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/service/restart", + produces = { "application/json" } + ) + + default ResponseEntity restartService( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/graph/{graph_id}/adhoc_query : Submit adhoc query to the Interactive Query Service. + * Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto + * + * @param graphId (required) + * @param body (optional) + * @return Successfully runned. (status code 200) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "runAdhoc", + summary = "Submit adhoc query to the Interactive Query Service.", + description = "Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto ", + tags = { "QueryService" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully runned.", content = { + @Content(mediaType = "text/plain", schema = @Schema(implementation = byte[].class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = byte[].class)) + }), + @ApiResponse(responseCode = "500", description = "Server internal error", content = { + @Content(mediaType = "text/plain", schema = @Schema(implementation = APIResponseWithCode.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph/{graph_id}/adhoc_query", + produces = { "text/plain", "application/json" }, + consumes = { "text/plain" } + ) + + default ResponseEntity runAdhoc( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "body", description = "") @Valid @RequestBody(required = false) byte[] body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/graph/current/adhoc_query : Submit adhoc query to the Interactive Query Service. + * Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto + * + * @param body (optional) + * @return Successfully runned. Empty if failed? (status code 200) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "runAdhocCurrent", + summary = "Submit adhoc query to the Interactive Query Service.", + description = "Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto ", + tags = { "QueryService" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully runned. Empty if failed?", content = { + @Content(mediaType = "text/plain", schema = @Schema(implementation = byte[].class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = byte[].class)) + }), + @ApiResponse(responseCode = "500", description = "Server internal error", content = { + @Content(mediaType = "text/plain", schema = @Schema(implementation = APIResponseWithCode.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph/current/adhoc_query", + produces = { "text/plain", "application/json" }, + consumes = { "text/plain" } + ) + + default ResponseEntity runAdhocCurrent( + @Parameter(name = "body", description = "") @Valid @RequestBody(required = false) byte[] body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/service/start + * Start service on a specified graph + * + * @param startServiceRequest Start service on a specified graph (optional) + * @return successful operation (status code 200) + * or Internal Error (status code 500) + */ + @Operation( + operationId = "startService", + description = "Start service on a specified graph", + tags = { "AdminService/ServiceManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "500", description = "Internal Error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/service/start", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity startService( + @Parameter(name = "StartServiceRequest", description = "Start service on a specified graph") @Valid @RequestBody(required = false) StartServiceRequest startServiceRequest + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/service/stop + * Stop current service + * + * @param stopServiceRequest Stop service on a specified graph (optional) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "stopService", + description = "Stop current service", + tags = { "AdminService/ServiceManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/service/stop", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity stopService( + @Parameter(name = "StopServiceRequest", description = "Stop service on a specified graph") @Valid @RequestBody(required = false) StopServiceRequest stopServiceRequest + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PUT /v1/graph/{graph_id}/edge : Update edge's property + * Update the edge on the running graph. + * + * @param graphId (required) + * @param edgeRequest (optional) + * @return Successfully update edge (status code 200) + * or Invalid input parameters (status code 400) + * or Edge not exists (status code 404) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "updateEdge", + summary = "Update edge's property", + description = "Update the edge on the running graph. ", + tags = { "GraphService/EdgeManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully update edge", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid input parameters", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "404", description = "Edge not exists", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "500", description = "Server internal error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/v1/graph/{graph_id}/edge", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity updateEdge( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "EdgeRequest", description = "") @Valid @RequestBody(required = false) EdgeRequest edgeRequest + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PUT /v1/graph/{graph_id}/procedure/{procedure_id} + * Update procedure on a graph by id + * + * @param graphId (required) + * @param procedureId (required) + * @param updateProcedureRequest (optional) + * @return Successful operation (status code 200) + * or Bad request (status code 400) + * or Not Found (status code 404) + * or Internal error (status code 500) + */ + @Operation( + operationId = "updateProcedure", + description = "Update procedure on a graph by id", + tags = { "AdminService/ProcedureManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = "Bad request", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "404", description = "Not Found", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "500", description = "Internal error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/v1/graph/{graph_id}/procedure/{procedure_id}", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity updateProcedure( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "procedure_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("procedure_id") String procedureId, + @Parameter(name = "UpdateProcedureRequest", description = "") @Valid @RequestBody(required = false) UpdateProcedureRequest updateProcedureRequest + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PUT /v1/graph/{graph_id}/vertex : Update vertex's property + * Remove the vertex from the specified graph. + * + * @param graphId (required) + * @param vertexRequest (optional) + * @return Successfully update vertex (status code 200) + * or Invalid input parameters (status code 400) + * or Vertex not exists (status code 404) + * or Server internal error (status code 500) + */ + @Operation( + operationId = "updateVertex", + summary = "Update vertex's property", + description = "Remove the vertex from the specified graph. ", + tags = { "GraphService/VertexManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully update vertex", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid input parameters", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "404", description = "Vertex not exists", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }), + @ApiResponse(responseCode = "500", description = "Server internal error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/v1/graph/{graph_id}/vertex", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity updateVertex( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "VertexRequest", description = "") @Valid @RequestBody(required = false) VertexRequest vertexRequest + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /v1/file/upload + * + * @param filestorage (optional) + * @return successful operation (status code 200) + * or Server Internal Error (status code 500) + */ + @Operation( + operationId = "uploadFile", + tags = { "Utils" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = UploadFileResponse.class)) + }), + @ApiResponse(responseCode = "500", description = "Server Internal Error", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/file/upload", + produces = { "application/json" }, + consumes = { "multipart/form-data" } + ) + + default ResponseEntity uploadFile( + @Parameter(name = "filestorage", description = "") @RequestPart(value = "filestorage", required = false) MultipartFile filestorage + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"file_path\" : \"file_path\", \"metadata\" : { \"key\" : \"\" } }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java new file mode 100644 index 000000000000..f7c10b086c59 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java @@ -0,0 +1,77 @@ +// package com.alibaba.graphscope.groot.service.api; + +// import com.alibaba.graphscope.groot.service.models.APIResponseWithCode; +// import com.alibaba.graphscope.groot.service.models.CreateGraphRequest; +// import com.alibaba.graphscope.groot.service.models.CreateGraphResponse; +// import com.alibaba.graphscope.groot.service.models.CreateProcedureRequest; +// import com.alibaba.graphscope.groot.service.models.CreateProcedureResponse; +// import com.alibaba.graphscope.groot.service.models.EdgeData; +// import com.alibaba.graphscope.groot.service.models.EdgeRequest; +// import com.alibaba.graphscope.groot.service.models.GetGraphResponse; +// import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; +// import com.alibaba.graphscope.groot.service.models.GetGraphStatisticsResponse; +// import com.alibaba.graphscope.groot.service.models.GetProcedureResponse; +// import com.alibaba.graphscope.groot.service.models.JobResponse; +// import com.alibaba.graphscope.groot.service.models.JobStatus; +// import com.alibaba.graphscope.groot.service.models.SchemaMapping; +// import com.alibaba.graphscope.groot.service.models.ServiceStatus; +// import com.alibaba.graphscope.groot.service.models.StartServiceRequest; +// import com.alibaba.graphscope.groot.service.models.StopServiceRequest; +// import com.alibaba.graphscope.groot.service.models.UpdateProcedureRequest; +// import com.alibaba.graphscope.groot.service.models.UploadFileResponse; +// import com.alibaba.graphscope.groot.service.models.VertexData; +// import com.alibaba.graphscope.groot.service.models.VertexEdgeRequest; +// import com.alibaba.graphscope.groot.service.models.VertexRequest; + + +// import org.springframework.beans.factory.annotation.Autowired; +// import org.springframework.http.HttpStatus; +// import org.springframework.http.MediaType; +// import org.springframework.http.ResponseEntity; +// import org.springframework.stereotype.Controller; +// import org.springframework.web.bind.annotation.PathVariable; +// import org.springframework.web.bind.annotation.RequestBody; +// import org.springframework.web.bind.annotation.RequestHeader; +// import org.springframework.web.bind.annotation.RequestMapping; +// import org.springframework.web.bind.annotation.CookieValue; +// import org.springframework.web.bind.annotation.RequestParam; +// import org.springframework.web.bind.annotation.RequestPart; +// import org.springframework.web.multipart.MultipartFile; +// import org.springframework.web.context.request.NativeWebRequest; + +// import javax.validation.constraints.*; +// import javax.validation.Valid; + +// import java.util.List; +// import java.util.Map; +// import java.util.Optional; +// import javax.annotation.Generated; + +// @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-17T16:29:16.306086+08:00[Asia/Shanghai]") +// @Controller +// @RequestMapping("${openapi.graphScopeInteractiveAPIV03.base-path:/GRAPHSCOPE/InteractiveAPI/1.0.0}") +// public class V1ApiController implements V1Api { + +// private final NativeWebRequest request; + +// @Autowired +// public V1ApiController(NativeWebRequest request) { +// this.request = request; +// } + +// @Override +// public Optional getRequest() { +// return Optional.ofNullable(request); +// } + +// @Override +// @RequestMapping(value = "/v1/graph/{graph_id}/adhoc_query", +// produces = { "text/plain", "application/json" }, +// consumes = { "text/plain" }) +// public ResponseEntity runAdhoc( +// @PathVariable("graph_id") String graphId, +// @RequestBody(required = false) byte[] body) { +// System.out.println("test 1111111111111111111111 runAdhoc"); +// return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); +// } +// } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java new file mode 100644 index 000000000000..08874423fdba --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java @@ -0,0 +1,59 @@ +package com.alibaba.graphscope.groot.service.impl; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.openapitools.jackson.nullable.JsonNullable; + +import com.alibaba.graphscope.groot.sdk.schema.Edge; +import com.alibaba.graphscope.groot.sdk.schema.Vertex; +import com.alibaba.graphscope.groot.service.models.EdgeRequest; +import com.alibaba.graphscope.groot.service.models.Property; +import com.alibaba.graphscope.groot.service.models.VertexRequest; + +public class DtoConverter { + public static Vertex convertToVertex(VertexRequest vertexRequest) { + String label = vertexRequest.getLabel(); + Map propertyMap = convertToPropertyMap(vertexRequest.getProperties()); + Map primaryKeyValues = convertToPropertyMap(vertexRequest.getPrimaryKeyValues()); + propertyMap.putAll(primaryKeyValues); + return new Vertex(label, propertyMap); + } + + public static Vertex convertToVertex(String label, List pkValues) { + Map propertyMap = convertToPropertyMap(pkValues); + return new Vertex(label, propertyMap); + } + + public static Edge convertToEdge(EdgeRequest edgeRequest) { + String label = edgeRequest.getEdgeLabel(); + String srcLabel = edgeRequest.getSrcLabel(); + String dstLabel = edgeRequest.getDstLabel(); + Map srcPkMap = convertToPropertyMap(edgeRequest.getSrcPrimaryKeyValues()); + Map dstPkMap = convertToPropertyMap(edgeRequest.getDstPrimaryKeyValues()); + Map propertyMap = convertToPropertyMap(edgeRequest.getProperties()); + return new Edge(label, srcLabel, dstLabel, srcPkMap, dstPkMap, propertyMap); + } + + public static Edge convertToEdge(String edgeLabel, String srcLabel, String dstLabel, List srcPkValues, + List dstPkValues) { + Map srcPkMap = convertToPropertyMap(srcPkValues); + Map dstPkMap = convertToPropertyMap(dstPkValues); + return new Edge(edgeLabel, srcLabel, dstLabel, srcPkMap, dstPkMap); + } + + private static Map convertToPropertyMap(List properties) { + Map propertyMap = new HashMap<>(); + for (Property property : properties) { + String value = extractValue(property.getValue()); + propertyMap.put(property.getName(), value); + } + return propertyMap; + } + + private static String extractValue(JsonNullable jsonNullable) { + return jsonNullable.isPresent() ? jsonNullable.get().toString() : null; + } + +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java new file mode 100644 index 000000000000..f5803681d245 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java @@ -0,0 +1,54 @@ +package com.alibaba.graphscope.groot.service.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.alibaba.graphscope.groot.sdk.GrootClient; +import com.alibaba.graphscope.groot.sdk.schema.Edge; +import com.alibaba.graphscope.groot.service.models.EdgeRequest; +import com.alibaba.graphscope.groot.service.models.Property; + +@Service +public class EdgeManagementService { + private final GrootClient grootClient; + + @Autowired + public EdgeManagementService(GrootClient grootClient) { + this.grootClient = grootClient; + } + + public long addEdge(EdgeRequest edgeRequest) { + Edge edge = DtoConverter.convertToEdge(edgeRequest); + return grootClient.addEdge(edge); + } + + public long addEdges(List edgeRequests) { + if (edgeRequests.size() == 1) { + return addEdge(edgeRequests.get(0)); + } else { + List edges = new ArrayList<>(); + for (EdgeRequest edgeRequest : edgeRequests) { + Edge edge = DtoConverter.convertToEdge(edgeRequest); + edges.add(edge); + } + return grootClient.addEdges(edges); + } + } + + public long deleteEdge(String edgeLabel, String srcLabel, String dstLabel, List srcPkValues, + List dstPkValues) { + Edge edge = DtoConverter.convertToEdge(edgeLabel, srcLabel, dstLabel, srcPkValues, dstPkValues); + // TODO: deleteEdge will only delete the first edge that matches the given parameters + // e.g., if we have multiple edges from v1 to v2 with the same edge label, only one of them will be deleted + return grootClient.deleteEdge(edge); + } + + public long updateEdge(EdgeRequest edgeRequest) { + Edge edge = DtoConverter.convertToEdge(edgeRequest); + // TODO: updateEdge will add a new edge even if it already exists + return grootClient.updateEdge(edge); + } +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootClientConfig.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootClientConfig.java new file mode 100644 index 000000000000..d8ee4e099f7f --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootClientConfig.java @@ -0,0 +1,16 @@ +package com.alibaba.graphscope.groot.service.impl; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import com.alibaba.graphscope.groot.sdk.GrootClient; + +@Configuration +public class GrootClientConfig { + @Bean + public GrootClient grootClient() { + return GrootClient.newBuilder() + .addHost("localhost", 55556) + .build(); + } +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java new file mode 100644 index 000000000000..cb7b3749a36d --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java @@ -0,0 +1,186 @@ +package com.alibaba.graphscope.groot.service.impl; + +import com.alibaba.graphscope.groot.service.models.APIResponseWithCode; +import com.alibaba.graphscope.groot.service.models.CreateGraphRequest; +import com.alibaba.graphscope.groot.service.models.CreateGraphResponse; +import com.alibaba.graphscope.groot.service.models.CreateProcedureRequest; +import com.alibaba.graphscope.groot.service.models.CreateProcedureResponse; +import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; +import com.alibaba.graphscope.groot.service.models.EdgeData; +import com.alibaba.graphscope.groot.service.models.EdgeRequest; +import com.alibaba.graphscope.groot.service.models.GetGraphResponse; +import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; +import com.alibaba.graphscope.groot.service.models.GetGraphStatisticsResponse; +import com.alibaba.graphscope.groot.service.models.GetProcedureResponse; +import com.alibaba.graphscope.groot.service.models.JobResponse; +import com.alibaba.graphscope.groot.service.models.JobStatus; +import com.alibaba.graphscope.groot.service.models.Property; +import com.alibaba.graphscope.groot.service.models.SchemaMapping; +import com.alibaba.graphscope.groot.service.models.ServiceStatus; +import com.alibaba.graphscope.groot.service.models.StartServiceRequest; +import com.alibaba.graphscope.groot.service.models.StopServiceRequest; +import com.alibaba.graphscope.groot.service.models.UpdateProcedureRequest; +import com.alibaba.graphscope.groot.service.models.UploadFileResponse; +import com.alibaba.graphscope.groot.service.models.VertexData; +import com.alibaba.graphscope.groot.service.models.VertexEdgeRequest; +import com.alibaba.graphscope.groot.service.models.VertexRequest; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; + +import com.alibaba.graphscope.groot.service.api.ApiUtil; +import com.alibaba.graphscope.groot.service.api.V1Api; + +import org.apache.tinkerpop.gremlin.driver.Cluster; +import org.apache.tinkerpop.gremlin.util.Gremlin; +import org.checkerframework.checker.units.qual.g; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.validation.Valid; + +import org.apache.tinkerpop.gremlin.driver.Client; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.bind.annotation.RestController; + +import com.alibaba.graphscope.groot.sdk.GrootClient; +import com.alibaba.graphscope.groot.sdk.schema.Vertex; + +@RestController +@RequestMapping("${openapi.graphScopeInteractiveAPIV03.base-path:/v1/graph}") +public class GrootController implements V1Api { + + private final VertexManagementService vertexManagementService; + private final EdgeManagementService edgeManagementService; + + @Autowired + public GrootController(VertexManagementService vertexService, EdgeManagementService edgeService) { + this.vertexManagementService = vertexService; + this.edgeManagementService = edgeService; + } + + @Override + @PostMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity addVertex( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated List vertexRequests) { + try { + if (vertexRequests.isEmpty()) { + return ResponseEntity.status(400).body("{\"error\": \"Vertex request must not be empty\"}"); + } + long si = vertexManagementService.addVertices(vertexRequests); + return ResponseEntity.status(200) + .body("{\"message\": \"Vertex added successfully\", \"snapshot id\": " + si + "}"); + } catch (Exception e) { + e.printStackTrace(); + return ResponseEntity.status(500).body("{\"error\": \"Failed to add vertex\"}"); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/vertex", produces =MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteVertex( + @PathVariable("graph_id") String graphId, + @RequestParam(value = "label", required = true) String label, + @RequestBody(required = true) List primaryKeyValues) { + try { + long si = vertexManagementService.deleteVertex(label, primaryKeyValues); + return ResponseEntity.status(200) + .body("{\"message\": \"Vertex deleted successfully\", \"snapshot id\": " + si + "}"); + } catch (Exception e) { + e.printStackTrace(); + return ResponseEntity.status(500).body("{\"error\": \"Failed to delete vertex\"}"); + } + } + + @Override + @PutMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateVertex( + @PathVariable("graph_id") String graphId, + @RequestBody(required = false) VertexRequest vertexRequest) { + try { + if (vertexRequest == null) { + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("{\"error\": \"Request body must not be null\"}"); + } + long si = vertexManagementService.updateVertex(vertexRequest); + return ResponseEntity.status(HttpStatus.OK).body("{\"message\": \"Vertex updated successfully\", \"snapshot id\": " + si + "}"); + } catch (Exception e) { + e.printStackTrace(); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("{\"error\": \"Failed to update vertex\"}"); + } + } + + @Override + @PostMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity addEdge( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated List edgeRequests) { + try { + if (edgeRequests.isEmpty()) { + return ResponseEntity.status(400).body("{\"error\": \"Edge request must not be empty\"}"); + } + System.out.println("edgeRequests: " + edgeRequests); + long si = edgeManagementService.addEdges(edgeRequests); + return ResponseEntity.status(200) + .body("{\"message\": \"Edge added successfully\", \"snapshot id\": " + si + "}"); + } catch (Exception e) { + e.printStackTrace(); + return ResponseEntity.status(500).body("{\"error\": \"Failed to add edge\"}"); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteEdge( + @PathVariable("graph_id") String graphId, + @RequestParam(value = "edge_label", required = true) String label, + @RequestParam(value = "src_label", required = true) String srcLabel, + @RequestParam(value = "dst_label", required = true) String dstLabel, + @RequestBody(required = true) DeleteEdgeRequest deleteEdgeRequest) { + try { + long si = edgeManagementService.deleteEdge(label, srcLabel, dstLabel, deleteEdgeRequest.getSrcPrimaryKeyValues(), deleteEdgeRequest.getDstPrimaryKeyValues()); + return ResponseEntity.status(200) + .body("{\"message\": \"Edge deleted successfully\", \"snapshot id\": " + si + "}"); + } catch (Exception e) { + e.printStackTrace(); + return ResponseEntity.status(500).body("{\"error\": \"Failed to delete edge\"}"); + } + } + + @Override + @PutMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateEdge( + @PathVariable("graph_id") String graphId, + @RequestBody(required = false) EdgeRequest edgeRequest) { + try { + if (edgeRequest == null) { + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("{\"error\": \"Request body must not be null\"}"); + } + long si = edgeManagementService.updateEdge(edgeRequest); + return ResponseEntity.status(HttpStatus.OK).body("{\"message\": \"Edge updated successfully\", \"snapshot id\": " + si + "}"); + } catch (Exception e) { + e.printStackTrace(); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("{\"error\": \"Failed to update edge\"}"); + } + } + + +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java new file mode 100644 index 000000000000..b7bd268b1c37 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java @@ -0,0 +1,52 @@ +package com.alibaba.graphscope.groot.service.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.alibaba.graphscope.groot.sdk.GrootClient; +import com.alibaba.graphscope.groot.sdk.schema.Vertex; +import com.alibaba.graphscope.groot.service.models.Property; +import com.alibaba.graphscope.groot.service.models.VertexRequest; + +@Service +public class VertexManagementService { + + private final GrootClient grootClient; + + @Autowired + public VertexManagementService(GrootClient grootClient) { + this.grootClient = grootClient; + } + + public long addVertex(VertexRequest vertexRequest) { + Vertex vertex = DtoConverter.convertToVertex(vertexRequest); + return grootClient.addVertex(vertex); + } + + public long addVertices(List vertexRequests) { + if (vertexRequests.size() == 1) { + return addVertex(vertexRequests.get(0)); + } else { + List vertices = new ArrayList<>(); + for (VertexRequest vertexRequest : vertexRequests) { + Vertex vertex = DtoConverter.convertToVertex(vertexRequest); + vertices.add(vertex); + } + return grootClient.addVertices(vertices); + } + } + + public long deleteVertex(String label, List properties) { + Vertex vertex = DtoConverter.convertToVertex(label, properties); + return grootClient.deleteVertex(vertex); + } + + public long updateVertex(VertexRequest vertexRequest) { + Vertex vertex = DtoConverter.convertToVertex(vertexRequest); + return grootClient.updateVertex(vertex); + } + +} \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java new file mode 100644 index 000000000000..2b6f915cda26 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java @@ -0,0 +1,107 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * APIResponseWithCode + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class APIResponseWithCode { + + private Integer code; + + private String message; + + public APIResponseWithCode code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + + @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public APIResponseWithCode message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + + @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + APIResponseWithCode apIResponseWithCode = (APIResponseWithCode) o; + return Objects.equals(this.code, apIResponseWithCode.code) && + Objects.equals(this.message, apIResponseWithCode.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class APIResponseWithCode {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java new file mode 100644 index 000000000000..8d5e067c7dc7 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java @@ -0,0 +1,120 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * BaseEdgeType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class BaseEdgeType { + + private String typeName; + + @Valid + private List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations; + + public BaseEdgeType typeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get typeName + * @return typeName + */ + + @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_name") + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public BaseEdgeType vertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { + this.vertexTypePairRelations = vertexTypePairRelations; + return this; + } + + public BaseEdgeType addVertexTypePairRelationsItem(BaseEdgeTypeVertexTypePairRelationsInner vertexTypePairRelationsItem) { + if (this.vertexTypePairRelations == null) { + this.vertexTypePairRelations = new ArrayList<>(); + } + this.vertexTypePairRelations.add(vertexTypePairRelationsItem); + return this; + } + + /** + * Get vertexTypePairRelations + * @return vertexTypePairRelations + */ + @Valid + @Schema(name = "vertex_type_pair_relations", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("vertex_type_pair_relations") + public List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> getVertexTypePairRelations() { + return vertexTypePairRelations; + } + + public void setVertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { + this.vertexTypePairRelations = vertexTypePairRelations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseEdgeType baseEdgeType = (BaseEdgeType) o; + return Objects.equals(this.typeName, baseEdgeType.typeName) && + Objects.equals(this.vertexTypePairRelations, baseEdgeType.vertexTypePairRelations); + } + + @Override + public int hashCode() { + return Objects.hash(typeName, vertexTypePairRelations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseEdgeType {\n"); + sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); + sb.append(" vertexTypePairRelations: ").append(toIndentedString(vertexTypePairRelations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java new file mode 100644 index 000000000000..504e7d95af0a --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java @@ -0,0 +1,198 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * BaseEdgeTypeVertexTypePairRelationsInner + */ + +@JsonTypeName("BaseEdgeType_vertex_type_pair_relations_inner") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class BaseEdgeTypeVertexTypePairRelationsInner { + + private String sourceVertex; + + private String destinationVertex; + + /** + * Gets or Sets relation + */ + public enum RelationEnum { + MANY_TO_MANY("MANY_TO_MANY"), + + ONE_TO_MANY("ONE_TO_MANY"), + + MANY_TO_ONE("MANY_TO_ONE"), + + ONE_TO_ONE("ONE_TO_ONE"); + + private String value; + + RelationEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RelationEnum fromValue(String value) { + for (RelationEnum b : RelationEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private RelationEnum relation; + + private BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams xCsrParams; + + public BaseEdgeTypeVertexTypePairRelationsInner sourceVertex(String sourceVertex) { + this.sourceVertex = sourceVertex; + return this; + } + + /** + * Get sourceVertex + * @return sourceVertex + */ + + @Schema(name = "source_vertex", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("source_vertex") + public String getSourceVertex() { + return sourceVertex; + } + + public void setSourceVertex(String sourceVertex) { + this.sourceVertex = sourceVertex; + } + + public BaseEdgeTypeVertexTypePairRelationsInner destinationVertex(String destinationVertex) { + this.destinationVertex = destinationVertex; + return this; + } + + /** + * Get destinationVertex + * @return destinationVertex + */ + + @Schema(name = "destination_vertex", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("destination_vertex") + public String getDestinationVertex() { + return destinationVertex; + } + + public void setDestinationVertex(String destinationVertex) { + this.destinationVertex = destinationVertex; + } + + public BaseEdgeTypeVertexTypePairRelationsInner relation(RelationEnum relation) { + this.relation = relation; + return this; + } + + /** + * Get relation + * @return relation + */ + + @Schema(name = "relation", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("relation") + public RelationEnum getRelation() { + return relation; + } + + public void setRelation(RelationEnum relation) { + this.relation = relation; + } + + public BaseEdgeTypeVertexTypePairRelationsInner xCsrParams(BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + return this; + } + + /** + * Get xCsrParams + * @return xCsrParams + */ + @Valid + @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("x_csr_params") + public BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams getxCsrParams() { + return xCsrParams; + } + + public void setxCsrParams(BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseEdgeTypeVertexTypePairRelationsInner baseEdgeTypeVertexTypePairRelationsInner = (BaseEdgeTypeVertexTypePairRelationsInner) o; + return Objects.equals(this.sourceVertex, baseEdgeTypeVertexTypePairRelationsInner.sourceVertex) && + Objects.equals(this.destinationVertex, baseEdgeTypeVertexTypePairRelationsInner.destinationVertex) && + Objects.equals(this.relation, baseEdgeTypeVertexTypePairRelationsInner.relation) && + Objects.equals(this.xCsrParams, baseEdgeTypeVertexTypePairRelationsInner.xCsrParams); + } + + @Override + public int hashCode() { + return Objects.hash(sourceVertex, destinationVertex, relation, xCsrParams); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseEdgeTypeVertexTypePairRelationsInner {\n"); + sb.append(" sourceVertex: ").append(toIndentedString(sourceVertex)).append("\n"); + sb.append(" destinationVertex: ").append(toIndentedString(destinationVertex)).append("\n"); + sb.append(" relation: ").append(toIndentedString(relation)).append("\n"); + sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java new file mode 100644 index 000000000000..b1a8a8abde36 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java @@ -0,0 +1,196 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Used for storage optimization + */ + +@Schema(name = "BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params", description = "Used for storage optimization") +@JsonTypeName("BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams { + + /** + * Gets or Sets edgeStorageStrategy + */ + public enum EdgeStorageStrategyEnum { + ONLY_IN("ONLY_IN"), + + ONLY_OUT("ONLY_OUT"), + + BOTH_OUT_IN("BOTH_OUT_IN"); + + private String value; + + EdgeStorageStrategyEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EdgeStorageStrategyEnum fromValue(String value) { + for (EdgeStorageStrategyEnum b : EdgeStorageStrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private EdgeStorageStrategyEnum edgeStorageStrategy; + + private Boolean sortOnCompaction; + + private String oeMutability; + + private String ieMutability; + + public BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams edgeStorageStrategy(EdgeStorageStrategyEnum edgeStorageStrategy) { + this.edgeStorageStrategy = edgeStorageStrategy; + return this; + } + + /** + * Get edgeStorageStrategy + * @return edgeStorageStrategy + */ + + @Schema(name = "edge_storage_strategy", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("edge_storage_strategy") + public EdgeStorageStrategyEnum getEdgeStorageStrategy() { + return edgeStorageStrategy; + } + + public void setEdgeStorageStrategy(EdgeStorageStrategyEnum edgeStorageStrategy) { + this.edgeStorageStrategy = edgeStorageStrategy; + } + + public BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams sortOnCompaction(Boolean sortOnCompaction) { + this.sortOnCompaction = sortOnCompaction; + return this; + } + + /** + * Get sortOnCompaction + * @return sortOnCompaction + */ + + @Schema(name = "sort_on_compaction", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("sort_on_compaction") + public Boolean getSortOnCompaction() { + return sortOnCompaction; + } + + public void setSortOnCompaction(Boolean sortOnCompaction) { + this.sortOnCompaction = sortOnCompaction; + } + + public BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams oeMutability(String oeMutability) { + this.oeMutability = oeMutability; + return this; + } + + /** + * Get oeMutability + * @return oeMutability + */ + + @Schema(name = "oe_mutability", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("oe_mutability") + public String getOeMutability() { + return oeMutability; + } + + public void setOeMutability(String oeMutability) { + this.oeMutability = oeMutability; + } + + public BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams ieMutability(String ieMutability) { + this.ieMutability = ieMutability; + return this; + } + + /** + * Get ieMutability + * @return ieMutability + */ + + @Schema(name = "ie_mutability", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ie_mutability") + public String getIeMutability() { + return ieMutability; + } + + public void setIeMutability(String ieMutability) { + this.ieMutability = ieMutability; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams baseEdgeTypeVertexTypePairRelationsInnerXCsrParams = (BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams) o; + return Objects.equals(this.edgeStorageStrategy, baseEdgeTypeVertexTypePairRelationsInnerXCsrParams.edgeStorageStrategy) && + Objects.equals(this.sortOnCompaction, baseEdgeTypeVertexTypePairRelationsInnerXCsrParams.sortOnCompaction) && + Objects.equals(this.oeMutability, baseEdgeTypeVertexTypePairRelationsInnerXCsrParams.oeMutability) && + Objects.equals(this.ieMutability, baseEdgeTypeVertexTypePairRelationsInnerXCsrParams.ieMutability); + } + + @Override + public int hashCode() { + return Objects.hash(edgeStorageStrategy, sortOnCompaction, oeMutability, ieMutability); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams {\n"); + sb.append(" edgeStorageStrategy: ").append(toIndentedString(edgeStorageStrategy)).append("\n"); + sb.append(" sortOnCompaction: ").append(toIndentedString(sortOnCompaction)).append("\n"); + sb.append(" oeMutability: ").append(toIndentedString(oeMutability)).append("\n"); + sb.append(" ieMutability: ").append(toIndentedString(ieMutability)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java new file mode 100644 index 000000000000..aed3d098c72f --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java @@ -0,0 +1,108 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.GSDataType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * BasePropertyMeta + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class BasePropertyMeta { + + private String propertyName; + + private GSDataType propertyType; + + public BasePropertyMeta propertyName(String propertyName) { + this.propertyName = propertyName; + return this; + } + + /** + * Get propertyName + * @return propertyName + */ + + @Schema(name = "property_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property_name") + public String getPropertyName() { + return propertyName; + } + + public void setPropertyName(String propertyName) { + this.propertyName = propertyName; + } + + public BasePropertyMeta propertyType(GSDataType propertyType) { + this.propertyType = propertyType; + return this; + } + + /** + * Get propertyType + * @return propertyType + */ + @Valid + @Schema(name = "property_type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property_type") + public GSDataType getPropertyType() { + return propertyType; + } + + public void setPropertyType(GSDataType propertyType) { + this.propertyType = propertyType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BasePropertyMeta basePropertyMeta = (BasePropertyMeta) o; + return Objects.equals(this.propertyName, basePropertyMeta.propertyName) && + Objects.equals(this.propertyType, basePropertyMeta.propertyType); + } + + @Override + public int hashCode() { + return Objects.hash(propertyName, propertyType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BasePropertyMeta {\n"); + sb.append(" propertyName: ").append(toIndentedString(propertyName)).append("\n"); + sb.append(" propertyType: ").append(toIndentedString(propertyType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java new file mode 100644 index 000000000000..e8fb65901a7c --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java @@ -0,0 +1,144 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.BaseVertexTypeXCsrParams; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * BaseVertexType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class BaseVertexType { + + private String typeName; + + @Valid + private List primaryKeys; + + private BaseVertexTypeXCsrParams xCsrParams; + + public BaseVertexType typeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get typeName + * @return typeName + */ + + @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_name") + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public BaseVertexType primaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + return this; + } + + public BaseVertexType addPrimaryKeysItem(String primaryKeysItem) { + if (this.primaryKeys == null) { + this.primaryKeys = new ArrayList<>(); + } + this.primaryKeys.add(primaryKeysItem); + return this; + } + + /** + * Get primaryKeys + * @return primaryKeys + */ + + @Schema(name = "primary_keys", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("primary_keys") + public List getPrimaryKeys() { + return primaryKeys; + } + + public void setPrimaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + } + + public BaseVertexType xCsrParams(BaseVertexTypeXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + return this; + } + + /** + * Get xCsrParams + * @return xCsrParams + */ + @Valid + @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("x_csr_params") + public BaseVertexTypeXCsrParams getxCsrParams() { + return xCsrParams; + } + + public void setxCsrParams(BaseVertexTypeXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseVertexType baseVertexType = (BaseVertexType) o; + return Objects.equals(this.typeName, baseVertexType.typeName) && + Objects.equals(this.primaryKeys, baseVertexType.primaryKeys) && + Objects.equals(this.xCsrParams, baseVertexType.xCsrParams); + } + + @Override + public int hashCode() { + return Objects.hash(typeName, primaryKeys, xCsrParams); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseVertexType {\n"); + sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); + sb.append(" primaryKeys: ").append(toIndentedString(primaryKeys)).append("\n"); + sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java new file mode 100644 index 000000000000..3b3eee143e42 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java @@ -0,0 +1,86 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Used for storage optimization + */ + +@Schema(name = "BaseVertexType_x_csr_params", description = "Used for storage optimization") +@JsonTypeName("BaseVertexType_x_csr_params") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class BaseVertexTypeXCsrParams { + + private Integer maxVertexNum; + + public BaseVertexTypeXCsrParams maxVertexNum(Integer maxVertexNum) { + this.maxVertexNum = maxVertexNum; + return this; + } + + /** + * Get maxVertexNum + * @return maxVertexNum + */ + + @Schema(name = "max_vertex_num", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("max_vertex_num") + public Integer getMaxVertexNum() { + return maxVertexNum; + } + + public void setMaxVertexNum(Integer maxVertexNum) { + this.maxVertexNum = maxVertexNum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseVertexTypeXCsrParams baseVertexTypeXCsrParams = (BaseVertexTypeXCsrParams) o; + return Objects.equals(this.maxVertexNum, baseVertexTypeXCsrParams.maxVertexNum); + } + + @Override + public int hashCode() { + return Objects.hash(maxVertexNum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseVertexTypeXCsrParams {\n"); + sb.append(" maxVertexNum: ").append(toIndentedString(maxVertexNum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java new file mode 100644 index 000000000000..9f77e9ad02ed --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java @@ -0,0 +1,108 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.EdgeMappingSourceVertexMappingsInnerColumn; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ColumnMapping + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class ColumnMapping { + + private EdgeMappingSourceVertexMappingsInnerColumn column; + + private String property; + + public ColumnMapping column(EdgeMappingSourceVertexMappingsInnerColumn column) { + this.column = column; + return this; + } + + /** + * Get column + * @return column + */ + @Valid + @Schema(name = "column", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("column") + public EdgeMappingSourceVertexMappingsInnerColumn getColumn() { + return column; + } + + public void setColumn(EdgeMappingSourceVertexMappingsInnerColumn column) { + this.column = column; + } + + public ColumnMapping property(String property) { + this.property = property; + return this; + } + + /** + * must align with the schema + * @return property + */ + + @Schema(name = "property", description = "must align with the schema", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property") + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ColumnMapping columnMapping = (ColumnMapping) o; + return Objects.equals(this.column, columnMapping.column) && + Objects.equals(this.property, columnMapping.property); + } + + @Override + public int hashCode() { + return Objects.hash(column, property); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ColumnMapping {\n"); + sb.append(" column: ").append(toIndentedString(column)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java new file mode 100644 index 000000000000..8d718f67759e --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java @@ -0,0 +1,154 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; +import com.alibaba.graphscope.groot.service.models.CreatePropertyMeta; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CreateEdgeType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class CreateEdgeType { + + private String typeName; + + @Valid + private List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations; + + @Valid + private List<@Valid CreatePropertyMeta> properties; + + public CreateEdgeType typeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get typeName + * @return typeName + */ + + @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_name") + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public CreateEdgeType vertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { + this.vertexTypePairRelations = vertexTypePairRelations; + return this; + } + + public CreateEdgeType addVertexTypePairRelationsItem(BaseEdgeTypeVertexTypePairRelationsInner vertexTypePairRelationsItem) { + if (this.vertexTypePairRelations == null) { + this.vertexTypePairRelations = new ArrayList<>(); + } + this.vertexTypePairRelations.add(vertexTypePairRelationsItem); + return this; + } + + /** + * Get vertexTypePairRelations + * @return vertexTypePairRelations + */ + @Valid + @Schema(name = "vertex_type_pair_relations", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("vertex_type_pair_relations") + public List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> getVertexTypePairRelations() { + return vertexTypePairRelations; + } + + public void setVertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { + this.vertexTypePairRelations = vertexTypePairRelations; + } + + public CreateEdgeType properties(List<@Valid CreatePropertyMeta> properties) { + this.properties = properties; + return this; + } + + public CreateEdgeType addPropertiesItem(CreatePropertyMeta propertiesItem) { + if (this.properties == null) { + this.properties = new ArrayList<>(); + } + this.properties.add(propertiesItem); + return this; + } + + /** + * Get properties + * @return properties + */ + @Valid + @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("properties") + public List<@Valid CreatePropertyMeta> getProperties() { + return properties; + } + + public void setProperties(List<@Valid CreatePropertyMeta> properties) { + this.properties = properties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEdgeType createEdgeType = (CreateEdgeType) o; + return Objects.equals(this.typeName, createEdgeType.typeName) && + Objects.equals(this.vertexTypePairRelations, createEdgeType.vertexTypePairRelations) && + Objects.equals(this.properties, createEdgeType.properties); + } + + @Override + public int hashCode() { + return Objects.hash(typeName, vertexTypePairRelations, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEdgeType {\n"); + sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); + sb.append(" vertexTypePairRelations: ").append(toIndentedString(vertexTypePairRelations)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java new file mode 100644 index 000000000000..5ffd29d7368b --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java @@ -0,0 +1,169 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.CreateGraphSchemaRequest; +import com.alibaba.graphscope.groot.service.models.CreateProcedureRequest; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CreateGraphRequest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class CreateGraphRequest { + + private String name; + + private String description; + + @Valid + private List<@Valid CreateProcedureRequest> storedProcedures; + + private CreateGraphSchemaRequest schema; + + public CreateGraphRequest name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", example = "modern_graph", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateGraphRequest description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", example = "A default description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateGraphRequest storedProcedures(List<@Valid CreateProcedureRequest> storedProcedures) { + this.storedProcedures = storedProcedures; + return this; + } + + public CreateGraphRequest addStoredProceduresItem(CreateProcedureRequest storedProceduresItem) { + if (this.storedProcedures == null) { + this.storedProcedures = new ArrayList<>(); + } + this.storedProcedures.add(storedProceduresItem); + return this; + } + + /** + * Get storedProcedures + * @return storedProcedures + */ + @Valid + @Schema(name = "stored_procedures", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("stored_procedures") + public List<@Valid CreateProcedureRequest> getStoredProcedures() { + return storedProcedures; + } + + public void setStoredProcedures(List<@Valid CreateProcedureRequest> storedProcedures) { + this.storedProcedures = storedProcedures; + } + + public CreateGraphRequest schema(CreateGraphSchemaRequest schema) { + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + */ + @Valid + @Schema(name = "schema", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("schema") + public CreateGraphSchemaRequest getSchema() { + return schema; + } + + public void setSchema(CreateGraphSchemaRequest schema) { + this.schema = schema; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateGraphRequest createGraphRequest = (CreateGraphRequest) o; + return Objects.equals(this.name, createGraphRequest.name) && + Objects.equals(this.description, createGraphRequest.description) && + Objects.equals(this.storedProcedures, createGraphRequest.storedProcedures) && + Objects.equals(this.schema, createGraphRequest.schema); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, storedProcedures, schema); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateGraphRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" storedProcedures: ").append(toIndentedString(storedProcedures)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java new file mode 100644 index 000000000000..3f04f06c652a --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java @@ -0,0 +1,83 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CreateGraphResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class CreateGraphResponse { + + private String graphId; + + public CreateGraphResponse graphId(String graphId) { + this.graphId = graphId; + return this; + } + + /** + * Get graphId + * @return graphId + */ + + @Schema(name = "graph_id", example = "1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("graph_id") + public String getGraphId() { + return graphId; + } + + public void setGraphId(String graphId) { + this.graphId = graphId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateGraphResponse createGraphResponse = (CreateGraphResponse) o; + return Objects.equals(this.graphId, createGraphResponse.graphId); + } + + @Override + public int hashCode() { + return Objects.hash(graphId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateGraphResponse {\n"); + sb.append(" graphId: ").append(toIndentedString(graphId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java new file mode 100644 index 000000000000..687260d953be --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java @@ -0,0 +1,130 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.CreateEdgeType; +import com.alibaba.graphscope.groot.service.models.CreateVertexType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CreateGraphSchemaRequest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class CreateGraphSchemaRequest { + + @Valid + private List<@Valid CreateVertexType> vertexTypes; + + @Valid + private List<@Valid CreateEdgeType> edgeTypes; + + public CreateGraphSchemaRequest vertexTypes(List<@Valid CreateVertexType> vertexTypes) { + this.vertexTypes = vertexTypes; + return this; + } + + public CreateGraphSchemaRequest addVertexTypesItem(CreateVertexType vertexTypesItem) { + if (this.vertexTypes == null) { + this.vertexTypes = new ArrayList<>(); + } + this.vertexTypes.add(vertexTypesItem); + return this; + } + + /** + * Get vertexTypes + * @return vertexTypes + */ + @Valid + @Schema(name = "vertex_types", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("vertex_types") + public List<@Valid CreateVertexType> getVertexTypes() { + return vertexTypes; + } + + public void setVertexTypes(List<@Valid CreateVertexType> vertexTypes) { + this.vertexTypes = vertexTypes; + } + + public CreateGraphSchemaRequest edgeTypes(List<@Valid CreateEdgeType> edgeTypes) { + this.edgeTypes = edgeTypes; + return this; + } + + public CreateGraphSchemaRequest addEdgeTypesItem(CreateEdgeType edgeTypesItem) { + if (this.edgeTypes == null) { + this.edgeTypes = new ArrayList<>(); + } + this.edgeTypes.add(edgeTypesItem); + return this; + } + + /** + * Get edgeTypes + * @return edgeTypes + */ + @Valid + @Schema(name = "edge_types", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("edge_types") + public List<@Valid CreateEdgeType> getEdgeTypes() { + return edgeTypes; + } + + public void setEdgeTypes(List<@Valid CreateEdgeType> edgeTypes) { + this.edgeTypes = edgeTypes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateGraphSchemaRequest createGraphSchemaRequest = (CreateGraphSchemaRequest) o; + return Objects.equals(this.vertexTypes, createGraphSchemaRequest.vertexTypes) && + Objects.equals(this.edgeTypes, createGraphSchemaRequest.edgeTypes); + } + + @Override + public int hashCode() { + return Objects.hash(vertexTypes, edgeTypes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateGraphSchemaRequest {\n"); + sb.append(" vertexTypes: ").append(toIndentedString(vertexTypes)).append("\n"); + sb.append(" edgeTypes: ").append(toIndentedString(edgeTypes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java new file mode 100644 index 000000000000..d81d8de4bbf1 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java @@ -0,0 +1,204 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CreateProcedureRequest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class CreateProcedureRequest { + + private String name; + + private String description; + + /** + * Gets or Sets type + */ + public enum TypeEnum { + CPP("cpp"), + + CYPHER("cypher"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private TypeEnum type; + + private String query; + + public CreateProcedureRequest() { + super(); + } + + /** + * Constructor with only required parameters + */ + public CreateProcedureRequest(String name, TypeEnum type, String query) { + this.name = name; + this.type = type; + this.query = query; + } + + public CreateProcedureRequest name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", example = "query1", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateProcedureRequest description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", example = "A sample stored procedure", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateProcedureRequest type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @NotNull + @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("type") + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public CreateProcedureRequest query(String query) { + this.query = query; + return this; + } + + /** + * Get query + * @return query + */ + @NotNull + @Schema(name = "query", example = "MATCH(a) return COUNT(a);", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("query") + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateProcedureRequest createProcedureRequest = (CreateProcedureRequest) o; + return Objects.equals(this.name, createProcedureRequest.name) && + Objects.equals(this.description, createProcedureRequest.description) && + Objects.equals(this.type, createProcedureRequest.type) && + Objects.equals(this.query, createProcedureRequest.query); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, type, query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateProcedureRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java new file mode 100644 index 000000000000..ae443cce96a5 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java @@ -0,0 +1,94 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CreateProcedureResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class CreateProcedureResponse { + + private String procedureId; + + public CreateProcedureResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public CreateProcedureResponse(String procedureId) { + this.procedureId = procedureId; + } + + public CreateProcedureResponse procedureId(String procedureId) { + this.procedureId = procedureId; + return this; + } + + /** + * Get procedureId + * @return procedureId + */ + @NotNull + @Schema(name = "procedure_id", example = "proc1", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("procedure_id") + public String getProcedureId() { + return procedureId; + } + + public void setProcedureId(String procedureId) { + this.procedureId = procedureId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateProcedureResponse createProcedureResponse = (CreateProcedureResponse) o; + return Objects.equals(this.procedureId, createProcedureResponse.procedureId); + } + + @Override + public int hashCode() { + return Objects.hash(procedureId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateProcedureResponse {\n"); + sb.append(" procedureId: ").append(toIndentedString(procedureId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java new file mode 100644 index 000000000000..3a1601b58f78 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java @@ -0,0 +1,108 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.GSDataType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CreatePropertyMeta + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class CreatePropertyMeta { + + private String propertyName; + + private GSDataType propertyType; + + public CreatePropertyMeta propertyName(String propertyName) { + this.propertyName = propertyName; + return this; + } + + /** + * Get propertyName + * @return propertyName + */ + + @Schema(name = "property_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property_name") + public String getPropertyName() { + return propertyName; + } + + public void setPropertyName(String propertyName) { + this.propertyName = propertyName; + } + + public CreatePropertyMeta propertyType(GSDataType propertyType) { + this.propertyType = propertyType; + return this; + } + + /** + * Get propertyType + * @return propertyType + */ + @Valid + @Schema(name = "property_type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property_type") + public GSDataType getPropertyType() { + return propertyType; + } + + public void setPropertyType(GSDataType propertyType) { + this.propertyType = propertyType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePropertyMeta createPropertyMeta = (CreatePropertyMeta) o; + return Objects.equals(this.propertyName, createPropertyMeta.propertyName) && + Objects.equals(this.propertyType, createPropertyMeta.propertyType); + } + + @Override + public int hashCode() { + return Objects.hash(propertyName, propertyType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePropertyMeta {\n"); + sb.append(" propertyName: ").append(toIndentedString(propertyName)).append("\n"); + sb.append(" propertyType: ").append(toIndentedString(propertyType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java new file mode 100644 index 000000000000..b47f6069d837 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java @@ -0,0 +1,178 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.BaseVertexTypeXCsrParams; +import com.alibaba.graphscope.groot.service.models.CreatePropertyMeta; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CreateVertexType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class CreateVertexType { + + private String typeName; + + @Valid + private List primaryKeys; + + private BaseVertexTypeXCsrParams xCsrParams; + + @Valid + private List<@Valid CreatePropertyMeta> properties; + + public CreateVertexType typeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get typeName + * @return typeName + */ + + @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_name") + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public CreateVertexType primaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + return this; + } + + public CreateVertexType addPrimaryKeysItem(String primaryKeysItem) { + if (this.primaryKeys == null) { + this.primaryKeys = new ArrayList<>(); + } + this.primaryKeys.add(primaryKeysItem); + return this; + } + + /** + * Get primaryKeys + * @return primaryKeys + */ + + @Schema(name = "primary_keys", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("primary_keys") + public List getPrimaryKeys() { + return primaryKeys; + } + + public void setPrimaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + } + + public CreateVertexType xCsrParams(BaseVertexTypeXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + return this; + } + + /** + * Get xCsrParams + * @return xCsrParams + */ + @Valid + @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("x_csr_params") + public BaseVertexTypeXCsrParams getxCsrParams() { + return xCsrParams; + } + + public void setxCsrParams(BaseVertexTypeXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + } + + public CreateVertexType properties(List<@Valid CreatePropertyMeta> properties) { + this.properties = properties; + return this; + } + + public CreateVertexType addPropertiesItem(CreatePropertyMeta propertiesItem) { + if (this.properties == null) { + this.properties = new ArrayList<>(); + } + this.properties.add(propertiesItem); + return this; + } + + /** + * Get properties + * @return properties + */ + @Valid + @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("properties") + public List<@Valid CreatePropertyMeta> getProperties() { + return properties; + } + + public void setProperties(List<@Valid CreatePropertyMeta> properties) { + this.properties = properties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateVertexType createVertexType = (CreateVertexType) o; + return Objects.equals(this.typeName, createVertexType.typeName) && + Objects.equals(this.primaryKeys, createVertexType.primaryKeys) && + Objects.equals(this.xCsrParams, createVertexType.xCsrParams) && + Objects.equals(this.properties, createVertexType.properties); + } + + @Override + public int hashCode() { + return Objects.hash(typeName, primaryKeys, xCsrParams, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateVertexType {\n"); + sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); + sb.append(" primaryKeys: ").append(toIndentedString(primaryKeys)).append("\n"); + sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java new file mode 100644 index 000000000000..56ec58448a91 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java @@ -0,0 +1,95 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * DateType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class DateType implements TemporalTypeTemporal { + + private String date32; + + public DateType() { + super(); + } + + /** + * Constructor with only required parameters + */ + public DateType(String date32) { + this.date32 = date32; + } + + public DateType date32(String date32) { + this.date32 = date32; + return this; + } + + /** + * Get date32 + * @return date32 + */ + @NotNull + @Schema(name = "date32", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("date32") + public String getDate32() { + return date32; + } + + public void setDate32(String date32) { + this.date32 = date32; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DateType dateType = (DateType) o; + return Objects.equals(this.date32, dateType.date32); + } + + @Override + public int hashCode() { + return Objects.hash(date32); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DateType {\n"); + sb.append(" date32: ").append(toIndentedString(date32)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java new file mode 100644 index 000000000000..5be9d28e9517 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java @@ -0,0 +1,131 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.Property; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * DeleteEdgeRequest + */ + +@JsonTypeName("delete_edge_request") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class DeleteEdgeRequest { + + @Valid + private List<@Valid Property> srcPrimaryKeyValues; + + @Valid + private List<@Valid Property> dstPrimaryKeyValues; + + public DeleteEdgeRequest srcPrimaryKeyValues(List<@Valid Property> srcPrimaryKeyValues) { + this.srcPrimaryKeyValues = srcPrimaryKeyValues; + return this; + } + + public DeleteEdgeRequest addSrcPrimaryKeyValuesItem(Property srcPrimaryKeyValuesItem) { + if (this.srcPrimaryKeyValues == null) { + this.srcPrimaryKeyValues = new ArrayList<>(); + } + this.srcPrimaryKeyValues.add(srcPrimaryKeyValuesItem); + return this; + } + + /** + * Get srcPrimaryKeyValues + * @return srcPrimaryKeyValues + */ + @Valid + @Schema(name = "src_primary_key_values", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("src_primary_key_values") + public List<@Valid Property> getSrcPrimaryKeyValues() { + return srcPrimaryKeyValues; + } + + public void setSrcPrimaryKeyValues(List<@Valid Property> srcPrimaryKeyValues) { + this.srcPrimaryKeyValues = srcPrimaryKeyValues; + } + + public DeleteEdgeRequest dstPrimaryKeyValues(List<@Valid Property> dstPrimaryKeyValues) { + this.dstPrimaryKeyValues = dstPrimaryKeyValues; + return this; + } + + public DeleteEdgeRequest addDstPrimaryKeyValuesItem(Property dstPrimaryKeyValuesItem) { + if (this.dstPrimaryKeyValues == null) { + this.dstPrimaryKeyValues = new ArrayList<>(); + } + this.dstPrimaryKeyValues.add(dstPrimaryKeyValuesItem); + return this; + } + + /** + * Get dstPrimaryKeyValues + * @return dstPrimaryKeyValues + */ + @Valid + @Schema(name = "dst_primary_key_values", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dst_primary_key_values") + public List<@Valid Property> getDstPrimaryKeyValues() { + return dstPrimaryKeyValues; + } + + public void setDstPrimaryKeyValues(List<@Valid Property> dstPrimaryKeyValues) { + this.dstPrimaryKeyValues = dstPrimaryKeyValues; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteEdgeRequest deleteEdgeRequest = (DeleteEdgeRequest) o; + return Objects.equals(this.srcPrimaryKeyValues, deleteEdgeRequest.srcPrimaryKeyValues) && + Objects.equals(this.dstPrimaryKeyValues, deleteEdgeRequest.dstPrimaryKeyValues); + } + + @Override + public int hashCode() { + return Objects.hash(srcPrimaryKeyValues, dstPrimaryKeyValues); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteEdgeRequest {\n"); + sb.append(" srcPrimaryKeyValues: ").append(toIndentedString(srcPrimaryKeyValues)).append("\n"); + sb.append(" dstPrimaryKeyValues: ").append(toIndentedString(dstPrimaryKeyValues)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java new file mode 100644 index 000000000000..7c1baf0ebcf0 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java @@ -0,0 +1,232 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.Property; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EdgeData + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class EdgeData { + + private String srcLabel; + + private String dstLabel; + + private String edgeLabel; + + private JsonNullable srcPrimaryKeyValue = JsonNullable.undefined(); + + private JsonNullable dstPrimaryKeyValue = JsonNullable.undefined(); + + @Valid + private List<@Valid Property> properties = new ArrayList<>(); + + public EdgeData() { + super(); + } + + /** + * Constructor with only required parameters + */ + public EdgeData(String srcLabel, String dstLabel, String edgeLabel, Object srcPrimaryKeyValue, Object dstPrimaryKeyValue, List<@Valid Property> properties) { + this.srcLabel = srcLabel; + this.dstLabel = dstLabel; + this.edgeLabel = edgeLabel; + this.srcPrimaryKeyValue = JsonNullable.of(srcPrimaryKeyValue); + this.dstPrimaryKeyValue = JsonNullable.of(dstPrimaryKeyValue); + this.properties = properties; + } + + public EdgeData srcLabel(String srcLabel) { + this.srcLabel = srcLabel; + return this; + } + + /** + * Get srcLabel + * @return srcLabel + */ + @NotNull + @Schema(name = "src_label", example = "person", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("src_label") + public String getSrcLabel() { + return srcLabel; + } + + public void setSrcLabel(String srcLabel) { + this.srcLabel = srcLabel; + } + + public EdgeData dstLabel(String dstLabel) { + this.dstLabel = dstLabel; + return this; + } + + /** + * Get dstLabel + * @return dstLabel + */ + @NotNull + @Schema(name = "dst_label", example = "software", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("dst_label") + public String getDstLabel() { + return dstLabel; + } + + public void setDstLabel(String dstLabel) { + this.dstLabel = dstLabel; + } + + public EdgeData edgeLabel(String edgeLabel) { + this.edgeLabel = edgeLabel; + return this; + } + + /** + * Get edgeLabel + * @return edgeLabel + */ + @NotNull + @Schema(name = "edge_label", example = "created", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("edge_label") + public String getEdgeLabel() { + return edgeLabel; + } + + public void setEdgeLabel(String edgeLabel) { + this.edgeLabel = edgeLabel; + } + + public EdgeData srcPrimaryKeyValue(Object srcPrimaryKeyValue) { + this.srcPrimaryKeyValue = JsonNullable.of(srcPrimaryKeyValue); + return this; + } + + /** + * Get srcPrimaryKeyValue + * @return srcPrimaryKeyValue + */ + @NotNull + @Schema(name = "src_primary_key_value", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("src_primary_key_value") + public JsonNullable getSrcPrimaryKeyValue() { + return srcPrimaryKeyValue; + } + + public void setSrcPrimaryKeyValue(JsonNullable srcPrimaryKeyValue) { + this.srcPrimaryKeyValue = srcPrimaryKeyValue; + } + + public EdgeData dstPrimaryKeyValue(Object dstPrimaryKeyValue) { + this.dstPrimaryKeyValue = JsonNullable.of(dstPrimaryKeyValue); + return this; + } + + /** + * Get dstPrimaryKeyValue + * @return dstPrimaryKeyValue + */ + @NotNull + @Schema(name = "dst_primary_key_value", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("dst_primary_key_value") + public JsonNullable getDstPrimaryKeyValue() { + return dstPrimaryKeyValue; + } + + public void setDstPrimaryKeyValue(JsonNullable dstPrimaryKeyValue) { + this.dstPrimaryKeyValue = dstPrimaryKeyValue; + } + + public EdgeData properties(List<@Valid Property> properties) { + this.properties = properties; + return this; + } + + public EdgeData addPropertiesItem(Property propertiesItem) { + if (this.properties == null) { + this.properties = new ArrayList<>(); + } + this.properties.add(propertiesItem); + return this; + } + + /** + * Get properties + * @return properties + */ + @NotNull @Valid + @Schema(name = "properties", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("properties") + public List<@Valid Property> getProperties() { + return properties; + } + + public void setProperties(List<@Valid Property> properties) { + this.properties = properties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EdgeData edgeData = (EdgeData) o; + return Objects.equals(this.srcLabel, edgeData.srcLabel) && + Objects.equals(this.dstLabel, edgeData.dstLabel) && + Objects.equals(this.edgeLabel, edgeData.edgeLabel) && + Objects.equals(this.srcPrimaryKeyValue, edgeData.srcPrimaryKeyValue) && + Objects.equals(this.dstPrimaryKeyValue, edgeData.dstPrimaryKeyValue) && + Objects.equals(this.properties, edgeData.properties); + } + + @Override + public int hashCode() { + return Objects.hash(srcLabel, dstLabel, edgeLabel, srcPrimaryKeyValue, dstPrimaryKeyValue, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EdgeData {\n"); + sb.append(" srcLabel: ").append(toIndentedString(srcLabel)).append("\n"); + sb.append(" dstLabel: ").append(toIndentedString(dstLabel)).append("\n"); + sb.append(" edgeLabel: ").append(toIndentedString(edgeLabel)).append("\n"); + sb.append(" srcPrimaryKeyValue: ").append(toIndentedString(srcPrimaryKeyValue)).append("\n"); + sb.append(" dstPrimaryKeyValue: ").append(toIndentedString(dstPrimaryKeyValue)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java new file mode 100644 index 000000000000..e42fd7341718 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java @@ -0,0 +1,222 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.ColumnMapping; +import com.alibaba.graphscope.groot.service.models.EdgeMappingDestinationVertexMappingsInner; +import com.alibaba.graphscope.groot.service.models.EdgeMappingSourceVertexMappingsInner; +import com.alibaba.graphscope.groot.service.models.EdgeMappingTypeTriplet; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EdgeMapping + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class EdgeMapping { + + private EdgeMappingTypeTriplet typeTriplet; + + @Valid + private List inputs; + + @Valid + private List<@Valid EdgeMappingSourceVertexMappingsInner> sourceVertexMappings; + + @Valid + private List<@Valid EdgeMappingDestinationVertexMappingsInner> destinationVertexMappings; + + @Valid + private List<@Valid ColumnMapping> columnMappings; + + public EdgeMapping typeTriplet(EdgeMappingTypeTriplet typeTriplet) { + this.typeTriplet = typeTriplet; + return this; + } + + /** + * Get typeTriplet + * @return typeTriplet + */ + @Valid + @Schema(name = "type_triplet", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_triplet") + public EdgeMappingTypeTriplet getTypeTriplet() { + return typeTriplet; + } + + public void setTypeTriplet(EdgeMappingTypeTriplet typeTriplet) { + this.typeTriplet = typeTriplet; + } + + public EdgeMapping inputs(List inputs) { + this.inputs = inputs; + return this; + } + + public EdgeMapping addInputsItem(String inputsItem) { + if (this.inputs == null) { + this.inputs = new ArrayList<>(); + } + this.inputs.add(inputsItem); + return this; + } + + /** + * Get inputs + * @return inputs + */ + + @Schema(name = "inputs", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("inputs") + public List getInputs() { + return inputs; + } + + public void setInputs(List inputs) { + this.inputs = inputs; + } + + public EdgeMapping sourceVertexMappings(List<@Valid EdgeMappingSourceVertexMappingsInner> sourceVertexMappings) { + this.sourceVertexMappings = sourceVertexMappings; + return this; + } + + public EdgeMapping addSourceVertexMappingsItem(EdgeMappingSourceVertexMappingsInner sourceVertexMappingsItem) { + if (this.sourceVertexMappings == null) { + this.sourceVertexMappings = new ArrayList<>(); + } + this.sourceVertexMappings.add(sourceVertexMappingsItem); + return this; + } + + /** + * Get sourceVertexMappings + * @return sourceVertexMappings + */ + @Valid + @Schema(name = "source_vertex_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("source_vertex_mappings") + public List<@Valid EdgeMappingSourceVertexMappingsInner> getSourceVertexMappings() { + return sourceVertexMappings; + } + + public void setSourceVertexMappings(List<@Valid EdgeMappingSourceVertexMappingsInner> sourceVertexMappings) { + this.sourceVertexMappings = sourceVertexMappings; + } + + public EdgeMapping destinationVertexMappings(List<@Valid EdgeMappingDestinationVertexMappingsInner> destinationVertexMappings) { + this.destinationVertexMappings = destinationVertexMappings; + return this; + } + + public EdgeMapping addDestinationVertexMappingsItem(EdgeMappingDestinationVertexMappingsInner destinationVertexMappingsItem) { + if (this.destinationVertexMappings == null) { + this.destinationVertexMappings = new ArrayList<>(); + } + this.destinationVertexMappings.add(destinationVertexMappingsItem); + return this; + } + + /** + * Get destinationVertexMappings + * @return destinationVertexMappings + */ + @Valid + @Schema(name = "destination_vertex_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("destination_vertex_mappings") + public List<@Valid EdgeMappingDestinationVertexMappingsInner> getDestinationVertexMappings() { + return destinationVertexMappings; + } + + public void setDestinationVertexMappings(List<@Valid EdgeMappingDestinationVertexMappingsInner> destinationVertexMappings) { + this.destinationVertexMappings = destinationVertexMappings; + } + + public EdgeMapping columnMappings(List<@Valid ColumnMapping> columnMappings) { + this.columnMappings = columnMappings; + return this; + } + + public EdgeMapping addColumnMappingsItem(ColumnMapping columnMappingsItem) { + if (this.columnMappings == null) { + this.columnMappings = new ArrayList<>(); + } + this.columnMappings.add(columnMappingsItem); + return this; + } + + /** + * Get columnMappings + * @return columnMappings + */ + @Valid + @Schema(name = "column_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("column_mappings") + public List<@Valid ColumnMapping> getColumnMappings() { + return columnMappings; + } + + public void setColumnMappings(List<@Valid ColumnMapping> columnMappings) { + this.columnMappings = columnMappings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EdgeMapping edgeMapping = (EdgeMapping) o; + return Objects.equals(this.typeTriplet, edgeMapping.typeTriplet) && + Objects.equals(this.inputs, edgeMapping.inputs) && + Objects.equals(this.sourceVertexMappings, edgeMapping.sourceVertexMappings) && + Objects.equals(this.destinationVertexMappings, edgeMapping.destinationVertexMappings) && + Objects.equals(this.columnMappings, edgeMapping.columnMappings); + } + + @Override + public int hashCode() { + return Objects.hash(typeTriplet, inputs, sourceVertexMappings, destinationVertexMappings, columnMappings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EdgeMapping {\n"); + sb.append(" typeTriplet: ").append(toIndentedString(typeTriplet)).append("\n"); + sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n"); + sb.append(" sourceVertexMappings: ").append(toIndentedString(sourceVertexMappings)).append("\n"); + sb.append(" destinationVertexMappings: ").append(toIndentedString(destinationVertexMappings)).append("\n"); + sb.append(" columnMappings: ").append(toIndentedString(columnMappings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java new file mode 100644 index 000000000000..f224fa321d2f --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java @@ -0,0 +1,111 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.EdgeMappingSourceVertexMappingsInnerColumn; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Mapping column to the primary key of destination vertex + */ + +@Schema(name = "EdgeMapping_destination_vertex_mappings_inner", description = "Mapping column to the primary key of destination vertex") +@JsonTypeName("EdgeMapping_destination_vertex_mappings_inner") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class EdgeMappingDestinationVertexMappingsInner { + + private EdgeMappingSourceVertexMappingsInnerColumn column; + + private String property; + + public EdgeMappingDestinationVertexMappingsInner column(EdgeMappingSourceVertexMappingsInnerColumn column) { + this.column = column; + return this; + } + + /** + * Get column + * @return column + */ + @Valid + @Schema(name = "column", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("column") + public EdgeMappingSourceVertexMappingsInnerColumn getColumn() { + return column; + } + + public void setColumn(EdgeMappingSourceVertexMappingsInnerColumn column) { + this.column = column; + } + + public EdgeMappingDestinationVertexMappingsInner property(String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + */ + + @Schema(name = "property", example = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property") + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EdgeMappingDestinationVertexMappingsInner edgeMappingDestinationVertexMappingsInner = (EdgeMappingDestinationVertexMappingsInner) o; + return Objects.equals(this.column, edgeMappingDestinationVertexMappingsInner.column) && + Objects.equals(this.property, edgeMappingDestinationVertexMappingsInner.property); + } + + @Override + public int hashCode() { + return Objects.hash(column, property); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EdgeMappingDestinationVertexMappingsInner {\n"); + sb.append(" column: ").append(toIndentedString(column)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java new file mode 100644 index 000000000000..2314f22a399f --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java @@ -0,0 +1,111 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.EdgeMappingSourceVertexMappingsInnerColumn; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Mapping column to the primary key of source vertex + */ + +@Schema(name = "EdgeMapping_source_vertex_mappings_inner", description = "Mapping column to the primary key of source vertex") +@JsonTypeName("EdgeMapping_source_vertex_mappings_inner") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class EdgeMappingSourceVertexMappingsInner { + + private EdgeMappingSourceVertexMappingsInnerColumn column; + + private String property; + + public EdgeMappingSourceVertexMappingsInner column(EdgeMappingSourceVertexMappingsInnerColumn column) { + this.column = column; + return this; + } + + /** + * Get column + * @return column + */ + @Valid + @Schema(name = "column", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("column") + public EdgeMappingSourceVertexMappingsInnerColumn getColumn() { + return column; + } + + public void setColumn(EdgeMappingSourceVertexMappingsInnerColumn column) { + this.column = column; + } + + public EdgeMappingSourceVertexMappingsInner property(String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + */ + + @Schema(name = "property", example = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property") + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EdgeMappingSourceVertexMappingsInner edgeMappingSourceVertexMappingsInner = (EdgeMappingSourceVertexMappingsInner) o; + return Objects.equals(this.column, edgeMappingSourceVertexMappingsInner.column) && + Objects.equals(this.property, edgeMappingSourceVertexMappingsInner.property); + } + + @Override + public int hashCode() { + return Objects.hash(column, property); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EdgeMappingSourceVertexMappingsInner {\n"); + sb.append(" column: ").append(toIndentedString(column)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java new file mode 100644 index 000000000000..8f8119f6547e --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java @@ -0,0 +1,109 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EdgeMappingSourceVertexMappingsInnerColumn + */ + +@JsonTypeName("EdgeMapping_source_vertex_mappings_inner_column") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class EdgeMappingSourceVertexMappingsInnerColumn { + + private Integer index; + + private String name; + + public EdgeMappingSourceVertexMappingsInnerColumn index(Integer index) { + this.index = index; + return this; + } + + /** + * Get index + * @return index + */ + + @Schema(name = "index", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("index") + public Integer getIndex() { + return index; + } + + public void setIndex(Integer index) { + this.index = index; + } + + public EdgeMappingSourceVertexMappingsInnerColumn name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EdgeMappingSourceVertexMappingsInnerColumn edgeMappingSourceVertexMappingsInnerColumn = (EdgeMappingSourceVertexMappingsInnerColumn) o; + return Objects.equals(this.index, edgeMappingSourceVertexMappingsInnerColumn.index) && + Objects.equals(this.name, edgeMappingSourceVertexMappingsInnerColumn.name); + } + + @Override + public int hashCode() { + return Objects.hash(index, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EdgeMappingSourceVertexMappingsInnerColumn {\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java new file mode 100644 index 000000000000..1b9c751196ee --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java @@ -0,0 +1,134 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * source label -> [edge label] -> destination label + */ + +@Schema(name = "EdgeMapping_type_triplet", description = "source label -> [edge label] -> destination label") +@JsonTypeName("EdgeMapping_type_triplet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class EdgeMappingTypeTriplet { + + private String edge; + + private String sourceVertex; + + private String destinationVertex; + + public EdgeMappingTypeTriplet edge(String edge) { + this.edge = edge; + return this; + } + + /** + * Get edge + * @return edge + */ + + @Schema(name = "edge", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("edge") + public String getEdge() { + return edge; + } + + public void setEdge(String edge) { + this.edge = edge; + } + + public EdgeMappingTypeTriplet sourceVertex(String sourceVertex) { + this.sourceVertex = sourceVertex; + return this; + } + + /** + * Get sourceVertex + * @return sourceVertex + */ + + @Schema(name = "source_vertex", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("source_vertex") + public String getSourceVertex() { + return sourceVertex; + } + + public void setSourceVertex(String sourceVertex) { + this.sourceVertex = sourceVertex; + } + + public EdgeMappingTypeTriplet destinationVertex(String destinationVertex) { + this.destinationVertex = destinationVertex; + return this; + } + + /** + * Get destinationVertex + * @return destinationVertex + */ + + @Schema(name = "destination_vertex", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("destination_vertex") + public String getDestinationVertex() { + return destinationVertex; + } + + public void setDestinationVertex(String destinationVertex) { + this.destinationVertex = destinationVertex; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EdgeMappingTypeTriplet edgeMappingTypeTriplet = (EdgeMappingTypeTriplet) o; + return Objects.equals(this.edge, edgeMappingTypeTriplet.edge) && + Objects.equals(this.sourceVertex, edgeMappingTypeTriplet.sourceVertex) && + Objects.equals(this.destinationVertex, edgeMappingTypeTriplet.destinationVertex); + } + + @Override + public int hashCode() { + return Objects.hash(edge, sourceVertex, destinationVertex); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EdgeMappingTypeTriplet {\n"); + sb.append(" edge: ").append(toIndentedString(edge)).append("\n"); + sb.append(" sourceVertex: ").append(toIndentedString(sourceVertex)).append("\n"); + sb.append(" destinationVertex: ").append(toIndentedString(destinationVertex)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java new file mode 100644 index 000000000000..91095ac03a0a --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java @@ -0,0 +1,249 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.Property; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EdgeRequest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class EdgeRequest { + + private String srcLabel; + + private String dstLabel; + + private String edgeLabel; + + @Valid + private List<@Valid Property> srcPrimaryKeyValues = new ArrayList<>(); + + @Valid + private List<@Valid Property> dstPrimaryKeyValues = new ArrayList<>(); + + @Valid + private List<@Valid Property> properties; + + public EdgeRequest() { + super(); + } + + /** + * Constructor with only required parameters + */ + public EdgeRequest(String srcLabel, String dstLabel, String edgeLabel, List<@Valid Property> srcPrimaryKeyValues, List<@Valid Property> dstPrimaryKeyValues) { + this.srcLabel = srcLabel; + this.dstLabel = dstLabel; + this.edgeLabel = edgeLabel; + this.srcPrimaryKeyValues = srcPrimaryKeyValues; + this.dstPrimaryKeyValues = dstPrimaryKeyValues; + } + + public EdgeRequest srcLabel(String srcLabel) { + this.srcLabel = srcLabel; + return this; + } + + /** + * Get srcLabel + * @return srcLabel + */ + @NotNull + @Schema(name = "src_label", example = "person", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("src_label") + public String getSrcLabel() { + return srcLabel; + } + + public void setSrcLabel(String srcLabel) { + this.srcLabel = srcLabel; + } + + public EdgeRequest dstLabel(String dstLabel) { + this.dstLabel = dstLabel; + return this; + } + + /** + * Get dstLabel + * @return dstLabel + */ + @NotNull + @Schema(name = "dst_label", example = "software", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("dst_label") + public String getDstLabel() { + return dstLabel; + } + + public void setDstLabel(String dstLabel) { + this.dstLabel = dstLabel; + } + + public EdgeRequest edgeLabel(String edgeLabel) { + this.edgeLabel = edgeLabel; + return this; + } + + /** + * Get edgeLabel + * @return edgeLabel + */ + @NotNull + @Schema(name = "edge_label", example = "created", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("edge_label") + public String getEdgeLabel() { + return edgeLabel; + } + + public void setEdgeLabel(String edgeLabel) { + this.edgeLabel = edgeLabel; + } + + public EdgeRequest srcPrimaryKeyValues(List<@Valid Property> srcPrimaryKeyValues) { + this.srcPrimaryKeyValues = srcPrimaryKeyValues; + return this; + } + + public EdgeRequest addSrcPrimaryKeyValuesItem(Property srcPrimaryKeyValuesItem) { + if (this.srcPrimaryKeyValues == null) { + this.srcPrimaryKeyValues = new ArrayList<>(); + } + this.srcPrimaryKeyValues.add(srcPrimaryKeyValuesItem); + return this; + } + + /** + * Get srcPrimaryKeyValues + * @return srcPrimaryKeyValues + */ + @NotNull @Valid + @Schema(name = "src_primary_key_values", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("src_primary_key_values") + public List<@Valid Property> getSrcPrimaryKeyValues() { + return srcPrimaryKeyValues; + } + + public void setSrcPrimaryKeyValues(List<@Valid Property> srcPrimaryKeyValues) { + this.srcPrimaryKeyValues = srcPrimaryKeyValues; + } + + public EdgeRequest dstPrimaryKeyValues(List<@Valid Property> dstPrimaryKeyValues) { + this.dstPrimaryKeyValues = dstPrimaryKeyValues; + return this; + } + + public EdgeRequest addDstPrimaryKeyValuesItem(Property dstPrimaryKeyValuesItem) { + if (this.dstPrimaryKeyValues == null) { + this.dstPrimaryKeyValues = new ArrayList<>(); + } + this.dstPrimaryKeyValues.add(dstPrimaryKeyValuesItem); + return this; + } + + /** + * Get dstPrimaryKeyValues + * @return dstPrimaryKeyValues + */ + @NotNull @Valid + @Schema(name = "dst_primary_key_values", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("dst_primary_key_values") + public List<@Valid Property> getDstPrimaryKeyValues() { + return dstPrimaryKeyValues; + } + + public void setDstPrimaryKeyValues(List<@Valid Property> dstPrimaryKeyValues) { + this.dstPrimaryKeyValues = dstPrimaryKeyValues; + } + + public EdgeRequest properties(List<@Valid Property> properties) { + this.properties = properties; + return this; + } + + public EdgeRequest addPropertiesItem(Property propertiesItem) { + if (this.properties == null) { + this.properties = new ArrayList<>(); + } + this.properties.add(propertiesItem); + return this; + } + + /** + * Get properties + * @return properties + */ + @Valid + @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("properties") + public List<@Valid Property> getProperties() { + return properties; + } + + public void setProperties(List<@Valid Property> properties) { + this.properties = properties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EdgeRequest edgeRequest = (EdgeRequest) o; + return Objects.equals(this.srcLabel, edgeRequest.srcLabel) && + Objects.equals(this.dstLabel, edgeRequest.dstLabel) && + Objects.equals(this.edgeLabel, edgeRequest.edgeLabel) && + Objects.equals(this.srcPrimaryKeyValues, edgeRequest.srcPrimaryKeyValues) && + Objects.equals(this.dstPrimaryKeyValues, edgeRequest.dstPrimaryKeyValues) && + Objects.equals(this.properties, edgeRequest.properties); + } + + @Override + public int hashCode() { + return Objects.hash(srcLabel, dstLabel, edgeLabel, srcPrimaryKeyValues, dstPrimaryKeyValues, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EdgeRequest {\n"); + sb.append(" srcLabel: ").append(toIndentedString(srcLabel)).append("\n"); + sb.append(" dstLabel: ").append(toIndentedString(dstLabel)).append("\n"); + sb.append(" edgeLabel: ").append(toIndentedString(edgeLabel)).append("\n"); + sb.append(" srcPrimaryKeyValues: ").append(toIndentedString(srcPrimaryKeyValues)).append("\n"); + sb.append(" dstPrimaryKeyValues: ").append(toIndentedString(dstPrimaryKeyValues)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java new file mode 100644 index 000000000000..ef04908756e1 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java @@ -0,0 +1,144 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.VertexTypePairStatistics; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EdgeStatistics + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class EdgeStatistics { + + private Integer typeId; + + private String typeName; + + @Valid + private List<@Valid VertexTypePairStatistics> vertexTypePairStatistics; + + public EdgeStatistics typeId(Integer typeId) { + this.typeId = typeId; + return this; + } + + /** + * Get typeId + * @return typeId + */ + + @Schema(name = "type_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_id") + public Integer getTypeId() { + return typeId; + } + + public void setTypeId(Integer typeId) { + this.typeId = typeId; + } + + public EdgeStatistics typeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get typeName + * @return typeName + */ + + @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_name") + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public EdgeStatistics vertexTypePairStatistics(List<@Valid VertexTypePairStatistics> vertexTypePairStatistics) { + this.vertexTypePairStatistics = vertexTypePairStatistics; + return this; + } + + public EdgeStatistics addVertexTypePairStatisticsItem(VertexTypePairStatistics vertexTypePairStatisticsItem) { + if (this.vertexTypePairStatistics == null) { + this.vertexTypePairStatistics = new ArrayList<>(); + } + this.vertexTypePairStatistics.add(vertexTypePairStatisticsItem); + return this; + } + + /** + * Get vertexTypePairStatistics + * @return vertexTypePairStatistics + */ + @Valid + @Schema(name = "vertex_type_pair_statistics", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("vertex_type_pair_statistics") + public List<@Valid VertexTypePairStatistics> getVertexTypePairStatistics() { + return vertexTypePairStatistics; + } + + public void setVertexTypePairStatistics(List<@Valid VertexTypePairStatistics> vertexTypePairStatistics) { + this.vertexTypePairStatistics = vertexTypePairStatistics; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EdgeStatistics edgeStatistics = (EdgeStatistics) o; + return Objects.equals(this.typeId, edgeStatistics.typeId) && + Objects.equals(this.typeName, edgeStatistics.typeName) && + Objects.equals(this.vertexTypePairStatistics, edgeStatistics.vertexTypePairStatistics); + } + + @Override + public int hashCode() { + return Objects.hash(typeId, typeName, vertexTypePairStatistics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EdgeStatistics {\n"); + sb.append(" typeId: ").append(toIndentedString(typeId)).append("\n"); + sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); + sb.append(" vertexTypePairStatistics: ").append(toIndentedString(vertexTypePairStatistics)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java new file mode 100644 index 000000000000..b235249964a2 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java @@ -0,0 +1,96 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.FixedCharChar; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FixedChar + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class FixedChar implements StringTypeString { + + private FixedCharChar _char; + + public FixedChar() { + super(); + } + + /** + * Constructor with only required parameters + */ + public FixedChar(FixedCharChar _char) { + this._char = _char; + } + + public FixedChar _char(FixedCharChar _char) { + this._char = _char; + return this; + } + + /** + * Get _char + * @return _char + */ + @NotNull @Valid + @Schema(name = "char", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("char") + public FixedCharChar getChar() { + return _char; + } + + public void setChar(FixedCharChar _char) { + this._char = _char; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FixedChar fixedChar = (FixedChar) o; + return Objects.equals(this._char, fixedChar._char); + } + + @Override + public int hashCode() { + return Objects.hash(_char); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FixedChar {\n"); + sb.append(" _char: ").append(toIndentedString(_char)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java new file mode 100644 index 000000000000..f31ba0cb0494 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java @@ -0,0 +1,96 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FixedCharChar + */ + +@JsonTypeName("FixedChar_char") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class FixedCharChar { + + private Integer fixedLength; + + public FixedCharChar() { + super(); + } + + /** + * Constructor with only required parameters + */ + public FixedCharChar(Integer fixedLength) { + this.fixedLength = fixedLength; + } + + public FixedCharChar fixedLength(Integer fixedLength) { + this.fixedLength = fixedLength; + return this; + } + + /** + * Get fixedLength + * @return fixedLength + */ + @NotNull + @Schema(name = "fixed_length", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("fixed_length") + public Integer getFixedLength() { + return fixedLength; + } + + public void setFixedLength(Integer fixedLength) { + this.fixedLength = fixedLength; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FixedCharChar fixedCharChar = (FixedCharChar) o; + return Objects.equals(this.fixedLength, fixedCharChar.fixedLength); + } + + @Override + public int hashCode() { + return Objects.hash(fixedLength); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FixedCharChar {\n"); + sb.append(" fixedLength: ").append(toIndentedString(fixedLength)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java new file mode 100644 index 000000000000..3683f7e8836f --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java @@ -0,0 +1,28 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.PrimitiveType; +import com.alibaba.graphscope.groot.service.models.StringType; +import com.alibaba.graphscope.groot.service.models.StringTypeString; +import com.alibaba.graphscope.groot.service.models.TemporalType; +import com.alibaba.graphscope.groot.service.models.TemporalTypeTemporal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public interface GSDataType { +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java new file mode 100644 index 000000000000..674534c77c22 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java @@ -0,0 +1,202 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; +import com.alibaba.graphscope.groot.service.models.GetPropertyMeta; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * GetEdgeType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class GetEdgeType { + + private String typeName; + + @Valid + private List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations; + + private Integer typeId; + + private String description; + + @Valid + private List<@Valid GetPropertyMeta> properties; + + public GetEdgeType typeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get typeName + * @return typeName + */ + + @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_name") + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public GetEdgeType vertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { + this.vertexTypePairRelations = vertexTypePairRelations; + return this; + } + + public GetEdgeType addVertexTypePairRelationsItem(BaseEdgeTypeVertexTypePairRelationsInner vertexTypePairRelationsItem) { + if (this.vertexTypePairRelations == null) { + this.vertexTypePairRelations = new ArrayList<>(); + } + this.vertexTypePairRelations.add(vertexTypePairRelationsItem); + return this; + } + + /** + * Get vertexTypePairRelations + * @return vertexTypePairRelations + */ + @Valid + @Schema(name = "vertex_type_pair_relations", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("vertex_type_pair_relations") + public List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> getVertexTypePairRelations() { + return vertexTypePairRelations; + } + + public void setVertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { + this.vertexTypePairRelations = vertexTypePairRelations; + } + + public GetEdgeType typeId(Integer typeId) { + this.typeId = typeId; + return this; + } + + /** + * Get typeId + * @return typeId + */ + + @Schema(name = "type_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_id") + public Integer getTypeId() { + return typeId; + } + + public void setTypeId(Integer typeId) { + this.typeId = typeId; + } + + public GetEdgeType description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public GetEdgeType properties(List<@Valid GetPropertyMeta> properties) { + this.properties = properties; + return this; + } + + public GetEdgeType addPropertiesItem(GetPropertyMeta propertiesItem) { + if (this.properties == null) { + this.properties = new ArrayList<>(); + } + this.properties.add(propertiesItem); + return this; + } + + /** + * Get properties + * @return properties + */ + @Valid + @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("properties") + public List<@Valid GetPropertyMeta> getProperties() { + return properties; + } + + public void setProperties(List<@Valid GetPropertyMeta> properties) { + this.properties = properties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEdgeType getEdgeType = (GetEdgeType) o; + return Objects.equals(this.typeName, getEdgeType.typeName) && + Objects.equals(this.vertexTypePairRelations, getEdgeType.vertexTypePairRelations) && + Objects.equals(this.typeId, getEdgeType.typeId) && + Objects.equals(this.description, getEdgeType.description) && + Objects.equals(this.properties, getEdgeType.properties); + } + + @Override + public int hashCode() { + return Objects.hash(typeName, vertexTypePairRelations, typeId, description, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEdgeType {\n"); + sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); + sb.append(" vertexTypePairRelations: ").append(toIndentedString(vertexTypePairRelations)).append("\n"); + sb.append(" typeId: ").append(toIndentedString(typeId)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java new file mode 100644 index 000000000000..5334e684e00e --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java @@ -0,0 +1,348 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; +import com.alibaba.graphscope.groot.service.models.GetProcedureResponse; +import com.alibaba.graphscope.groot.service.models.SchemaMapping; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * GetGraphResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class GetGraphResponse { + + private String version; + + private String id; + + private String name; + + private String description; + + /** + * Gets or Sets storeType + */ + public enum StoreTypeEnum { + MUTABLE_CSR("mutable_csr"); + + private String value; + + StoreTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StoreTypeEnum fromValue(String value) { + for (StoreTypeEnum b : StoreTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private StoreTypeEnum storeType; + + private Integer creationTime; + + private Integer dataUpdateTime; + + @Valid + private List<@Valid GetProcedureResponse> storedProcedures; + + private GetGraphSchemaResponse schema; + + private SchemaMapping dataImportConfig; + + public GetGraphResponse version(String version) { + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + + @Schema(name = "version", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("version") + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public GetGraphResponse id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GetGraphResponse name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GetGraphResponse description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public GetGraphResponse storeType(StoreTypeEnum storeType) { + this.storeType = storeType; + return this; + } + + /** + * Get storeType + * @return storeType + */ + + @Schema(name = "store_type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("store_type") + public StoreTypeEnum getStoreType() { + return storeType; + } + + public void setStoreType(StoreTypeEnum storeType) { + this.storeType = storeType; + } + + public GetGraphResponse creationTime(Integer creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Get creationTime + * @return creationTime + */ + + @Schema(name = "creation_time", example = "11223444", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("creation_time") + public Integer getCreationTime() { + return creationTime; + } + + public void setCreationTime(Integer creationTime) { + this.creationTime = creationTime; + } + + public GetGraphResponse dataUpdateTime(Integer dataUpdateTime) { + this.dataUpdateTime = dataUpdateTime; + return this; + } + + /** + * Get dataUpdateTime + * @return dataUpdateTime + */ + + @Schema(name = "data_update_time", example = "11123445", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("data_update_time") + public Integer getDataUpdateTime() { + return dataUpdateTime; + } + + public void setDataUpdateTime(Integer dataUpdateTime) { + this.dataUpdateTime = dataUpdateTime; + } + + public GetGraphResponse storedProcedures(List<@Valid GetProcedureResponse> storedProcedures) { + this.storedProcedures = storedProcedures; + return this; + } + + public GetGraphResponse addStoredProceduresItem(GetProcedureResponse storedProceduresItem) { + if (this.storedProcedures == null) { + this.storedProcedures = new ArrayList<>(); + } + this.storedProcedures.add(storedProceduresItem); + return this; + } + + /** + * Get storedProcedures + * @return storedProcedures + */ + @Valid + @Schema(name = "stored_procedures", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("stored_procedures") + public List<@Valid GetProcedureResponse> getStoredProcedures() { + return storedProcedures; + } + + public void setStoredProcedures(List<@Valid GetProcedureResponse> storedProcedures) { + this.storedProcedures = storedProcedures; + } + + public GetGraphResponse schema(GetGraphSchemaResponse schema) { + this.schema = schema; + return this; + } + + /** + * Get schema + * @return schema + */ + @Valid + @Schema(name = "schema", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("schema") + public GetGraphSchemaResponse getSchema() { + return schema; + } + + public void setSchema(GetGraphSchemaResponse schema) { + this.schema = schema; + } + + public GetGraphResponse dataImportConfig(SchemaMapping dataImportConfig) { + this.dataImportConfig = dataImportConfig; + return this; + } + + /** + * Get dataImportConfig + * @return dataImportConfig + */ + @Valid + @Schema(name = "data_import_config", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("data_import_config") + public SchemaMapping getDataImportConfig() { + return dataImportConfig; + } + + public void setDataImportConfig(SchemaMapping dataImportConfig) { + this.dataImportConfig = dataImportConfig; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGraphResponse getGraphResponse = (GetGraphResponse) o; + return Objects.equals(this.version, getGraphResponse.version) && + Objects.equals(this.id, getGraphResponse.id) && + Objects.equals(this.name, getGraphResponse.name) && + Objects.equals(this.description, getGraphResponse.description) && + Objects.equals(this.storeType, getGraphResponse.storeType) && + Objects.equals(this.creationTime, getGraphResponse.creationTime) && + Objects.equals(this.dataUpdateTime, getGraphResponse.dataUpdateTime) && + Objects.equals(this.storedProcedures, getGraphResponse.storedProcedures) && + Objects.equals(this.schema, getGraphResponse.schema) && + Objects.equals(this.dataImportConfig, getGraphResponse.dataImportConfig); + } + + @Override + public int hashCode() { + return Objects.hash(version, id, name, description, storeType, creationTime, dataUpdateTime, storedProcedures, schema, dataImportConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetGraphResponse {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" storeType: ").append(toIndentedString(storeType)).append("\n"); + sb.append(" creationTime: ").append(toIndentedString(creationTime)).append("\n"); + sb.append(" dataUpdateTime: ").append(toIndentedString(dataUpdateTime)).append("\n"); + sb.append(" storedProcedures: ").append(toIndentedString(storedProcedures)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" dataImportConfig: ").append(toIndentedString(dataImportConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java new file mode 100644 index 000000000000..c6167b8b18db --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java @@ -0,0 +1,130 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.GetEdgeType; +import com.alibaba.graphscope.groot.service.models.GetVertexType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * GetGraphSchemaResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class GetGraphSchemaResponse { + + @Valid + private List<@Valid GetVertexType> vertexTypes; + + @Valid + private List<@Valid GetEdgeType> edgeTypes; + + public GetGraphSchemaResponse vertexTypes(List<@Valid GetVertexType> vertexTypes) { + this.vertexTypes = vertexTypes; + return this; + } + + public GetGraphSchemaResponse addVertexTypesItem(GetVertexType vertexTypesItem) { + if (this.vertexTypes == null) { + this.vertexTypes = new ArrayList<>(); + } + this.vertexTypes.add(vertexTypesItem); + return this; + } + + /** + * Get vertexTypes + * @return vertexTypes + */ + @Valid + @Schema(name = "vertex_types", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("vertex_types") + public List<@Valid GetVertexType> getVertexTypes() { + return vertexTypes; + } + + public void setVertexTypes(List<@Valid GetVertexType> vertexTypes) { + this.vertexTypes = vertexTypes; + } + + public GetGraphSchemaResponse edgeTypes(List<@Valid GetEdgeType> edgeTypes) { + this.edgeTypes = edgeTypes; + return this; + } + + public GetGraphSchemaResponse addEdgeTypesItem(GetEdgeType edgeTypesItem) { + if (this.edgeTypes == null) { + this.edgeTypes = new ArrayList<>(); + } + this.edgeTypes.add(edgeTypesItem); + return this; + } + + /** + * Get edgeTypes + * @return edgeTypes + */ + @Valid + @Schema(name = "edge_types", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("edge_types") + public List<@Valid GetEdgeType> getEdgeTypes() { + return edgeTypes; + } + + public void setEdgeTypes(List<@Valid GetEdgeType> edgeTypes) { + this.edgeTypes = edgeTypes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGraphSchemaResponse getGraphSchemaResponse = (GetGraphSchemaResponse) o; + return Objects.equals(this.vertexTypes, getGraphSchemaResponse.vertexTypes) && + Objects.equals(this.edgeTypes, getGraphSchemaResponse.edgeTypes); + } + + @Override + public int hashCode() { + return Objects.hash(vertexTypes, edgeTypes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetGraphSchemaResponse {\n"); + sb.append(" vertexTypes: ").append(toIndentedString(vertexTypes)).append("\n"); + sb.append(" edgeTypes: ").append(toIndentedString(edgeTypes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java new file mode 100644 index 000000000000..61d0adc5cb60 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java @@ -0,0 +1,190 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.EdgeStatistics; +import com.alibaba.graphscope.groot.service.models.VertexStatistics; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * GetGraphStatisticsResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class GetGraphStatisticsResponse { + + private Integer totalVertexCount; + + private Integer totalEdgeCount; + + @Valid + private List<@Valid VertexStatistics> vertexTypeStatistics; + + @Valid + private List<@Valid EdgeStatistics> edgeTypeStatistics; + + public GetGraphStatisticsResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public GetGraphStatisticsResponse(Integer totalVertexCount, Integer totalEdgeCount) { + this.totalVertexCount = totalVertexCount; + this.totalEdgeCount = totalEdgeCount; + } + + public GetGraphStatisticsResponse totalVertexCount(Integer totalVertexCount) { + this.totalVertexCount = totalVertexCount; + return this; + } + + /** + * Get totalVertexCount + * @return totalVertexCount + */ + @NotNull + @Schema(name = "total_vertex_count", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("total_vertex_count") + public Integer getTotalVertexCount() { + return totalVertexCount; + } + + public void setTotalVertexCount(Integer totalVertexCount) { + this.totalVertexCount = totalVertexCount; + } + + public GetGraphStatisticsResponse totalEdgeCount(Integer totalEdgeCount) { + this.totalEdgeCount = totalEdgeCount; + return this; + } + + /** + * Get totalEdgeCount + * @return totalEdgeCount + */ + @NotNull + @Schema(name = "total_edge_count", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("total_edge_count") + public Integer getTotalEdgeCount() { + return totalEdgeCount; + } + + public void setTotalEdgeCount(Integer totalEdgeCount) { + this.totalEdgeCount = totalEdgeCount; + } + + public GetGraphStatisticsResponse vertexTypeStatistics(List<@Valid VertexStatistics> vertexTypeStatistics) { + this.vertexTypeStatistics = vertexTypeStatistics; + return this; + } + + public GetGraphStatisticsResponse addVertexTypeStatisticsItem(VertexStatistics vertexTypeStatisticsItem) { + if (this.vertexTypeStatistics == null) { + this.vertexTypeStatistics = new ArrayList<>(); + } + this.vertexTypeStatistics.add(vertexTypeStatisticsItem); + return this; + } + + /** + * Get vertexTypeStatistics + * @return vertexTypeStatistics + */ + @Valid + @Schema(name = "vertex_type_statistics", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("vertex_type_statistics") + public List<@Valid VertexStatistics> getVertexTypeStatistics() { + return vertexTypeStatistics; + } + + public void setVertexTypeStatistics(List<@Valid VertexStatistics> vertexTypeStatistics) { + this.vertexTypeStatistics = vertexTypeStatistics; + } + + public GetGraphStatisticsResponse edgeTypeStatistics(List<@Valid EdgeStatistics> edgeTypeStatistics) { + this.edgeTypeStatistics = edgeTypeStatistics; + return this; + } + + public GetGraphStatisticsResponse addEdgeTypeStatisticsItem(EdgeStatistics edgeTypeStatisticsItem) { + if (this.edgeTypeStatistics == null) { + this.edgeTypeStatistics = new ArrayList<>(); + } + this.edgeTypeStatistics.add(edgeTypeStatisticsItem); + return this; + } + + /** + * Get edgeTypeStatistics + * @return edgeTypeStatistics + */ + @Valid + @Schema(name = "edge_type_statistics", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("edge_type_statistics") + public List<@Valid EdgeStatistics> getEdgeTypeStatistics() { + return edgeTypeStatistics; + } + + public void setEdgeTypeStatistics(List<@Valid EdgeStatistics> edgeTypeStatistics) { + this.edgeTypeStatistics = edgeTypeStatistics; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGraphStatisticsResponse getGraphStatisticsResponse = (GetGraphStatisticsResponse) o; + return Objects.equals(this.totalVertexCount, getGraphStatisticsResponse.totalVertexCount) && + Objects.equals(this.totalEdgeCount, getGraphStatisticsResponse.totalEdgeCount) && + Objects.equals(this.vertexTypeStatistics, getGraphStatisticsResponse.vertexTypeStatistics) && + Objects.equals(this.edgeTypeStatistics, getGraphStatisticsResponse.edgeTypeStatistics); + } + + @Override + public int hashCode() { + return Objects.hash(totalVertexCount, totalEdgeCount, vertexTypeStatistics, edgeTypeStatistics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetGraphStatisticsResponse {\n"); + sb.append(" totalVertexCount: ").append(toIndentedString(totalVertexCount)).append("\n"); + sb.append(" totalEdgeCount: ").append(toIndentedString(totalEdgeCount)).append("\n"); + sb.append(" vertexTypeStatistics: ").append(toIndentedString(vertexTypeStatistics)).append("\n"); + sb.append(" edgeTypeStatistics: ").append(toIndentedString(edgeTypeStatistics)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java new file mode 100644 index 000000000000..2a34dc66cb8a --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java @@ -0,0 +1,477 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.Parameter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * GetProcedureResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class GetProcedureResponse { + + private String name; + + private String description; + + /** + * Gets or Sets type + */ + public enum TypeEnum { + CPP("cpp"), + + CYPHER("cypher"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private TypeEnum type; + + private String query; + + private String id; + + private String library; + + @Valid + private List<@Valid Parameter> params; + + @Valid + private List<@Valid Parameter> returns; + + private Boolean enable; + + @Valid + private Map option = new HashMap<>(); + + private String boundGraph; + + private Boolean runnable; + + private Integer creationTime; + + private Integer updateTime; + + public GetProcedureResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public GetProcedureResponse(String name, TypeEnum type, String query) { + this.name = name; + this.type = type; + this.query = query; + } + + public GetProcedureResponse name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", example = "query1", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GetProcedureResponse description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", example = "A sample stored procedure", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public GetProcedureResponse type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @NotNull + @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("type") + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public GetProcedureResponse query(String query) { + this.query = query; + return this; + } + + /** + * Get query + * @return query + */ + @NotNull + @Schema(name = "query", example = "MATCH(a) return COUNT(a);", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("query") + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public GetProcedureResponse id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", example = "The unique identifier of procedure, currently is same with name.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GetProcedureResponse library(String library) { + this.library = library; + return this; + } + + /** + * Get library + * @return library + */ + + @Schema(name = "library", example = "/path/to/library", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("library") + public String getLibrary() { + return library; + } + + public void setLibrary(String library) { + this.library = library; + } + + public GetProcedureResponse params(List<@Valid Parameter> params) { + this.params = params; + return this; + } + + public GetProcedureResponse addParamsItem(Parameter paramsItem) { + if (this.params == null) { + this.params = new ArrayList<>(); + } + this.params.add(paramsItem); + return this; + } + + /** + * Get params + * @return params + */ + @Valid + @Schema(name = "params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("params") + public List<@Valid Parameter> getParams() { + return params; + } + + public void setParams(List<@Valid Parameter> params) { + this.params = params; + } + + public GetProcedureResponse returns(List<@Valid Parameter> returns) { + this.returns = returns; + return this; + } + + public GetProcedureResponse addReturnsItem(Parameter returnsItem) { + if (this.returns == null) { + this.returns = new ArrayList<>(); + } + this.returns.add(returnsItem); + return this; + } + + /** + * Get returns + * @return returns + */ + @Valid + @Schema(name = "returns", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("returns") + public List<@Valid Parameter> getReturns() { + return returns; + } + + public void setReturns(List<@Valid Parameter> returns) { + this.returns = returns; + } + + public GetProcedureResponse enable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Get enable + * @return enable + */ + + @Schema(name = "enable", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enable") + public Boolean getEnable() { + return enable; + } + + public void setEnable(Boolean enable) { + this.enable = enable; + } + + public GetProcedureResponse option(Map option) { + this.option = option; + return this; + } + + public GetProcedureResponse putOptionItem(String key, Object optionItem) { + if (this.option == null) { + this.option = new HashMap<>(); + } + this.option.put(key, optionItem); + return this; + } + + /** + * Get option + * @return option + */ + + @Schema(name = "option", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("option") + public Map getOption() { + return option; + } + + public void setOption(Map option) { + this.option = option; + } + + public GetProcedureResponse boundGraph(String boundGraph) { + this.boundGraph = boundGraph; + return this; + } + + /** + * Get boundGraph + * @return boundGraph + */ + + @Schema(name = "bound_graph", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bound_graph") + public String getBoundGraph() { + return boundGraph; + } + + public void setBoundGraph(String boundGraph) { + this.boundGraph = boundGraph; + } + + public GetProcedureResponse runnable(Boolean runnable) { + this.runnable = runnable; + return this; + } + + /** + * Get runnable + * @return runnable + */ + + @Schema(name = "runnable", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("runnable") + public Boolean getRunnable() { + return runnable; + } + + public void setRunnable(Boolean runnable) { + this.runnable = runnable; + } + + public GetProcedureResponse creationTime(Integer creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Get creationTime + * @return creationTime + */ + + @Schema(name = "creation_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("creation_time") + public Integer getCreationTime() { + return creationTime; + } + + public void setCreationTime(Integer creationTime) { + this.creationTime = creationTime; + } + + public GetProcedureResponse updateTime(Integer updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * @return updateTime + */ + + @Schema(name = "update_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("update_time") + public Integer getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Integer updateTime) { + this.updateTime = updateTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetProcedureResponse getProcedureResponse = (GetProcedureResponse) o; + return Objects.equals(this.name, getProcedureResponse.name) && + Objects.equals(this.description, getProcedureResponse.description) && + Objects.equals(this.type, getProcedureResponse.type) && + Objects.equals(this.query, getProcedureResponse.query) && + Objects.equals(this.id, getProcedureResponse.id) && + Objects.equals(this.library, getProcedureResponse.library) && + Objects.equals(this.params, getProcedureResponse.params) && + Objects.equals(this.returns, getProcedureResponse.returns) && + Objects.equals(this.enable, getProcedureResponse.enable) && + Objects.equals(this.option, getProcedureResponse.option) && + Objects.equals(this.boundGraph, getProcedureResponse.boundGraph) && + Objects.equals(this.runnable, getProcedureResponse.runnable) && + Objects.equals(this.creationTime, getProcedureResponse.creationTime) && + Objects.equals(this.updateTime, getProcedureResponse.updateTime); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, type, query, id, library, params, returns, enable, option, boundGraph, runnable, creationTime, updateTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetProcedureResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" library: ").append(toIndentedString(library)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" returns: ").append(toIndentedString(returns)).append("\n"); + sb.append(" enable: ").append(toIndentedString(enable)).append("\n"); + sb.append(" option: ").append(toIndentedString(option)).append("\n"); + sb.append(" boundGraph: ").append(toIndentedString(boundGraph)).append("\n"); + sb.append(" runnable: ").append(toIndentedString(runnable)).append("\n"); + sb.append(" creationTime: ").append(toIndentedString(creationTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java new file mode 100644 index 000000000000..d2f6c68b233d --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java @@ -0,0 +1,132 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.GSDataType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * GetPropertyMeta + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class GetPropertyMeta { + + private String propertyName; + + private GSDataType propertyType; + + private Integer propertyId; + + public GetPropertyMeta propertyName(String propertyName) { + this.propertyName = propertyName; + return this; + } + + /** + * Get propertyName + * @return propertyName + */ + + @Schema(name = "property_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property_name") + public String getPropertyName() { + return propertyName; + } + + public void setPropertyName(String propertyName) { + this.propertyName = propertyName; + } + + public GetPropertyMeta propertyType(GSDataType propertyType) { + this.propertyType = propertyType; + return this; + } + + /** + * Get propertyType + * @return propertyType + */ + @Valid + @Schema(name = "property_type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property_type") + public GSDataType getPropertyType() { + return propertyType; + } + + public void setPropertyType(GSDataType propertyType) { + this.propertyType = propertyType; + } + + public GetPropertyMeta propertyId(Integer propertyId) { + this.propertyId = propertyId; + return this; + } + + /** + * Get propertyId + * @return propertyId + */ + + @Schema(name = "property_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property_id") + public Integer getPropertyId() { + return propertyId; + } + + public void setPropertyId(Integer propertyId) { + this.propertyId = propertyId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPropertyMeta getPropertyMeta = (GetPropertyMeta) o; + return Objects.equals(this.propertyName, getPropertyMeta.propertyName) && + Objects.equals(this.propertyType, getPropertyMeta.propertyType) && + Objects.equals(this.propertyId, getPropertyMeta.propertyId); + } + + @Override + public int hashCode() { + return Objects.hash(propertyName, propertyType, propertyId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPropertyMeta {\n"); + sb.append(" propertyName: ").append(toIndentedString(propertyName)).append("\n"); + sb.append(" propertyType: ").append(toIndentedString(propertyType)).append("\n"); + sb.append(" propertyId: ").append(toIndentedString(propertyId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java new file mode 100644 index 000000000000..a4000ad0376d --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java @@ -0,0 +1,226 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.BaseVertexTypeXCsrParams; +import com.alibaba.graphscope.groot.service.models.GetPropertyMeta; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * GetVertexType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class GetVertexType { + + private String typeName; + + @Valid + private List primaryKeys; + + private BaseVertexTypeXCsrParams xCsrParams; + + private Integer typeId; + + @Valid + private List<@Valid GetPropertyMeta> properties; + + private String description; + + public GetVertexType typeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get typeName + * @return typeName + */ + + @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_name") + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public GetVertexType primaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + return this; + } + + public GetVertexType addPrimaryKeysItem(String primaryKeysItem) { + if (this.primaryKeys == null) { + this.primaryKeys = new ArrayList<>(); + } + this.primaryKeys.add(primaryKeysItem); + return this; + } + + /** + * Get primaryKeys + * @return primaryKeys + */ + + @Schema(name = "primary_keys", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("primary_keys") + public List getPrimaryKeys() { + return primaryKeys; + } + + public void setPrimaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + } + + public GetVertexType xCsrParams(BaseVertexTypeXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + return this; + } + + /** + * Get xCsrParams + * @return xCsrParams + */ + @Valid + @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("x_csr_params") + public BaseVertexTypeXCsrParams getxCsrParams() { + return xCsrParams; + } + + public void setxCsrParams(BaseVertexTypeXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + } + + public GetVertexType typeId(Integer typeId) { + this.typeId = typeId; + return this; + } + + /** + * Get typeId + * @return typeId + */ + + @Schema(name = "type_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_id") + public Integer getTypeId() { + return typeId; + } + + public void setTypeId(Integer typeId) { + this.typeId = typeId; + } + + public GetVertexType properties(List<@Valid GetPropertyMeta> properties) { + this.properties = properties; + return this; + } + + public GetVertexType addPropertiesItem(GetPropertyMeta propertiesItem) { + if (this.properties == null) { + this.properties = new ArrayList<>(); + } + this.properties.add(propertiesItem); + return this; + } + + /** + * Get properties + * @return properties + */ + @Valid + @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("properties") + public List<@Valid GetPropertyMeta> getProperties() { + return properties; + } + + public void setProperties(List<@Valid GetPropertyMeta> properties) { + this.properties = properties; + } + + public GetVertexType description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetVertexType getVertexType = (GetVertexType) o; + return Objects.equals(this.typeName, getVertexType.typeName) && + Objects.equals(this.primaryKeys, getVertexType.primaryKeys) && + Objects.equals(this.xCsrParams, getVertexType.xCsrParams) && + Objects.equals(this.typeId, getVertexType.typeId) && + Objects.equals(this.properties, getVertexType.properties) && + Objects.equals(this.description, getVertexType.description); + } + + @Override + public int hashCode() { + return Objects.hash(typeName, primaryKeys, xCsrParams, typeId, properties, description); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetVertexType {\n"); + sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); + sb.append(" primaryKeys: ").append(toIndentedString(primaryKeys)).append("\n"); + sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); + sb.append(" typeId: ").append(toIndentedString(typeId)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java new file mode 100644 index 000000000000..d06fb3abd5cf --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java @@ -0,0 +1,83 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * JobResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class JobResponse { + + private String jobId; + + public JobResponse jobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get jobId + * @return jobId + */ + + @Schema(name = "job_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("job_id") + public String getJobId() { + return jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JobResponse jobResponse = (JobResponse) o; + return Objects.equals(this.jobId, jobResponse.jobId); + } + + @Override + public int hashCode() { + return Objects.hash(jobId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JobResponse {\n"); + sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java new file mode 100644 index 000000000000..160fcc06d953 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java @@ -0,0 +1,280 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * JobStatus + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class JobStatus { + + private String id; + + private String type; + + /** + * Gets or Sets status + */ + public enum StatusEnum { + RUNNING("RUNNING"), + + SUCCESS("SUCCESS"), + + FAILED("FAILED"), + + CANCELLED("CANCELLED"), + + WAITING("WAITING"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private StatusEnum status; + + private Integer startTime; + + private Integer endTime; + + private String log; + + @Valid + private Map detail = new HashMap<>(); + + public JobStatus id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public JobStatus type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public JobStatus status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + + @Schema(name = "status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public JobStatus startTime(Integer startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get startTime + * @return startTime + */ + + @Schema(name = "start_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("start_time") + public Integer getStartTime() { + return startTime; + } + + public void setStartTime(Integer startTime) { + this.startTime = startTime; + } + + public JobStatus endTime(Integer endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * @return endTime + */ + + @Schema(name = "end_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("end_time") + public Integer getEndTime() { + return endTime; + } + + public void setEndTime(Integer endTime) { + this.endTime = endTime; + } + + public JobStatus log(String log) { + this.log = log; + return this; + } + + /** + * URL or log string + * @return log + */ + + @Schema(name = "log", description = "URL or log string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("log") + public String getLog() { + return log; + } + + public void setLog(String log) { + this.log = log; + } + + public JobStatus detail(Map detail) { + this.detail = detail; + return this; + } + + public JobStatus putDetailItem(String key, Object detailItem) { + if (this.detail == null) { + this.detail = new HashMap<>(); + } + this.detail.put(key, detailItem); + return this; + } + + /** + * Get detail + * @return detail + */ + + @Schema(name = "detail", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("detail") + public Map getDetail() { + return detail; + } + + public void setDetail(Map detail) { + this.detail = detail; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JobStatus jobStatus = (JobStatus) o; + return Objects.equals(this.id, jobStatus.id) && + Objects.equals(this.type, jobStatus.type) && + Objects.equals(this.status, jobStatus.status) && + Objects.equals(this.startTime, jobStatus.startTime) && + Objects.equals(this.endTime, jobStatus.endTime) && + Objects.equals(this.log, jobStatus.log) && + Objects.equals(this.detail, jobStatus.detail); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, status, startTime, endTime, log, detail); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JobStatus {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" log: ").append(toIndentedString(log)).append("\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java new file mode 100644 index 000000000000..887798f4bb48 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java @@ -0,0 +1,95 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * LongText + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class LongText implements StringTypeString { + + private JsonNullable longText = JsonNullable.undefined(); + + public LongText() { + super(); + } + + /** + * Constructor with only required parameters + */ + public LongText(String longText) { + this.longText = JsonNullable.of(longText); + } + + public LongText longText(String longText) { + this.longText = JsonNullable.of(longText); + return this; + } + + /** + * Get longText + * @return longText + */ + @NotNull + @Schema(name = "long_text", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("long_text") + public JsonNullable getLongText() { + return longText; + } + + public void setLongText(JsonNullable longText) { + this.longText = longText; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LongText longText = (LongText) o; + return Objects.equals(this.longText, longText.longText); + } + + @Override + public int hashCode() { + return Objects.hash(longText); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LongText {\n"); + sb.append(" longText: ").append(toIndentedString(longText)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java new file mode 100644 index 000000000000..825ab131495e --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java @@ -0,0 +1,120 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.GSDataType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Parameter + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class Parameter { + + private String name; + + private GSDataType type; + + public Parameter() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Parameter(String name, GSDataType type) { + this.name = name; + this.type = type; + } + + public Parameter name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", example = "param1", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Parameter type(GSDataType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @NotNull @Valid + @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("type") + public GSDataType getType() { + return type; + } + + public void setType(GSDataType type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Parameter parameter = (Parameter) o; + return Objects.equals(this.name, parameter.name) && + Objects.equals(this.type, parameter.type); + } + + @Override + public int hashCode() { + return Objects.hash(name, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Parameter {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java new file mode 100644 index 000000000000..81987a64a8d0 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java @@ -0,0 +1,142 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * PrimitiveType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class PrimitiveType implements GSDataType { + + /** + * Gets or Sets primitiveType + */ + public enum PrimitiveTypeEnum { + SIGNED_INT32("DT_SIGNED_INT32"), + + UNSIGNED_INT32("DT_UNSIGNED_INT32"), + + SIGNED_INT64("DT_SIGNED_INT64"), + + UNSIGNED_INT64("DT_UNSIGNED_INT64"), + + BOOL("DT_BOOL"), + + FLOAT("DT_FLOAT"), + + DOUBLE("DT_DOUBLE"), + + STRING("DT_STRING"); + + private String value; + + PrimitiveTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PrimitiveTypeEnum fromValue(String value) { + for (PrimitiveTypeEnum b : PrimitiveTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private PrimitiveTypeEnum primitiveType; + + public PrimitiveType() { + super(); + } + + /** + * Constructor with only required parameters + */ + public PrimitiveType(PrimitiveTypeEnum primitiveType) { + this.primitiveType = primitiveType; + } + + public PrimitiveType primitiveType(PrimitiveTypeEnum primitiveType) { + this.primitiveType = primitiveType; + return this; + } + + /** + * Get primitiveType + * @return primitiveType + */ + @NotNull + @Schema(name = "primitive_type", example = "DT_SIGNED_INT32", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("primitive_type") + public PrimitiveTypeEnum getPrimitiveType() { + return primitiveType; + } + + public void setPrimitiveType(PrimitiveTypeEnum primitiveType) { + this.primitiveType = primitiveType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrimitiveType primitiveType = (PrimitiveType) o; + return Objects.equals(this.primitiveType, primitiveType.primitiveType); + } + + @Override + public int hashCode() { + return Objects.hash(primitiveType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrimitiveType {\n"); + sb.append(" primitiveType: ").append(toIndentedString(primitiveType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java new file mode 100644 index 000000000000..41c9e305b934 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java @@ -0,0 +1,119 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Property + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class Property { + + private String name; + + private JsonNullable value = JsonNullable.undefined(); + + public Property() { + super(); + } + + /** + * Constructor with only required parameters + */ + public Property(String name, Object value) { + this.name = name; + this.value = JsonNullable.of(value); + } + + public Property name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", example = "id", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Property value(Object value) { + this.value = JsonNullable.of(value); + return this; + } + + /** + * Get value + * @return value + */ + @NotNull + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("value") + public JsonNullable getValue() { + return value; + } + + public void setValue(JsonNullable value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Property property = (Property) o; + return Objects.equals(this.name, property.name) && + Objects.equals(this.value, property.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Property {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java new file mode 100644 index 000000000000..cde427e9f322 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java @@ -0,0 +1,131 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.TypedValue; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * QueryRequest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class QueryRequest { + + private String queryName; + + @Valid + private List<@Valid TypedValue> arguments; + + public QueryRequest() { + super(); + } + + /** + * Constructor with only required parameters + */ + public QueryRequest(String queryName) { + this.queryName = queryName; + } + + public QueryRequest queryName(String queryName) { + this.queryName = queryName; + return this; + } + + /** + * Get queryName + * @return queryName + */ + @NotNull + @Schema(name = "query_name", example = "ic1", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("query_name") + public String getQueryName() { + return queryName; + } + + public void setQueryName(String queryName) { + this.queryName = queryName; + } + + public QueryRequest arguments(List<@Valid TypedValue> arguments) { + this.arguments = arguments; + return this; + } + + public QueryRequest addArgumentsItem(TypedValue argumentsItem) { + if (this.arguments == null) { + this.arguments = new ArrayList<>(); + } + this.arguments.add(argumentsItem); + return this; + } + + /** + * Get arguments + * @return arguments + */ + @Valid + @Schema(name = "arguments", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("arguments") + public List<@Valid TypedValue> getArguments() { + return arguments; + } + + public void setArguments(List<@Valid TypedValue> arguments) { + this.arguments = arguments; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryRequest queryRequest = (QueryRequest) o; + return Objects.equals(this.queryName, queryRequest.queryName) && + Objects.equals(this.arguments, queryRequest.arguments); + } + + @Override + public int hashCode() { + return Objects.hash(queryName, arguments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryRequest {\n"); + sb.append(" queryName: ").append(toIndentedString(queryName)).append("\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java new file mode 100644 index 000000000000..e998fc768e66 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java @@ -0,0 +1,155 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.EdgeMapping; +import com.alibaba.graphscope.groot.service.models.SchemaMappingLoadingConfig; +import com.alibaba.graphscope.groot.service.models.VertexMapping; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * SchemaMapping + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class SchemaMapping { + + private SchemaMappingLoadingConfig loadingConfig; + + @Valid + private List<@Valid VertexMapping> vertexMappings; + + @Valid + private List<@Valid EdgeMapping> edgeMappings; + + public SchemaMapping loadingConfig(SchemaMappingLoadingConfig loadingConfig) { + this.loadingConfig = loadingConfig; + return this; + } + + /** + * Get loadingConfig + * @return loadingConfig + */ + @Valid + @Schema(name = "loading_config", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("loading_config") + public SchemaMappingLoadingConfig getLoadingConfig() { + return loadingConfig; + } + + public void setLoadingConfig(SchemaMappingLoadingConfig loadingConfig) { + this.loadingConfig = loadingConfig; + } + + public SchemaMapping vertexMappings(List<@Valid VertexMapping> vertexMappings) { + this.vertexMappings = vertexMappings; + return this; + } + + public SchemaMapping addVertexMappingsItem(VertexMapping vertexMappingsItem) { + if (this.vertexMappings == null) { + this.vertexMappings = new ArrayList<>(); + } + this.vertexMappings.add(vertexMappingsItem); + return this; + } + + /** + * Get vertexMappings + * @return vertexMappings + */ + @Valid + @Schema(name = "vertex_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("vertex_mappings") + public List<@Valid VertexMapping> getVertexMappings() { + return vertexMappings; + } + + public void setVertexMappings(List<@Valid VertexMapping> vertexMappings) { + this.vertexMappings = vertexMappings; + } + + public SchemaMapping edgeMappings(List<@Valid EdgeMapping> edgeMappings) { + this.edgeMappings = edgeMappings; + return this; + } + + public SchemaMapping addEdgeMappingsItem(EdgeMapping edgeMappingsItem) { + if (this.edgeMappings == null) { + this.edgeMappings = new ArrayList<>(); + } + this.edgeMappings.add(edgeMappingsItem); + return this; + } + + /** + * Get edgeMappings + * @return edgeMappings + */ + @Valid + @Schema(name = "edge_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("edge_mappings") + public List<@Valid EdgeMapping> getEdgeMappings() { + return edgeMappings; + } + + public void setEdgeMappings(List<@Valid EdgeMapping> edgeMappings) { + this.edgeMappings = edgeMappings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemaMapping schemaMapping = (SchemaMapping) o; + return Objects.equals(this.loadingConfig, schemaMapping.loadingConfig) && + Objects.equals(this.vertexMappings, schemaMapping.vertexMappings) && + Objects.equals(this.edgeMappings, schemaMapping.edgeMappings); + } + + @Override + public int hashCode() { + return Objects.hash(loadingConfig, vertexMappings, edgeMappings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SchemaMapping {\n"); + sb.append(" loadingConfig: ").append(toIndentedString(loadingConfig)).append("\n"); + sb.append(" vertexMappings: ").append(toIndentedString(vertexMappings)).append("\n"); + sb.append(" edgeMappings: ").append(toIndentedString(edgeMappings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java new file mode 100644 index 000000000000..e40f2a5103c4 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java @@ -0,0 +1,196 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.SchemaMappingLoadingConfigDataSource; +import com.alibaba.graphscope.groot.service.models.SchemaMappingLoadingConfigFormat; +import com.alibaba.graphscope.groot.service.models.SchemaMappingLoadingConfigXCsrParams; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * SchemaMappingLoadingConfig + */ + +@JsonTypeName("SchemaMapping_loading_config") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class SchemaMappingLoadingConfig { + + private SchemaMappingLoadingConfigXCsrParams xCsrParams; + + private SchemaMappingLoadingConfigDataSource dataSource; + + /** + * Gets or Sets importOption + */ + public enum ImportOptionEnum { + INIT("init"), + + OVERWRITE("overwrite"); + + private String value; + + ImportOptionEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ImportOptionEnum fromValue(String value) { + for (ImportOptionEnum b : ImportOptionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private ImportOptionEnum importOption; + + private SchemaMappingLoadingConfigFormat format; + + public SchemaMappingLoadingConfig xCsrParams(SchemaMappingLoadingConfigXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + return this; + } + + /** + * Get xCsrParams + * @return xCsrParams + */ + @Valid + @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("x_csr_params") + public SchemaMappingLoadingConfigXCsrParams getxCsrParams() { + return xCsrParams; + } + + public void setxCsrParams(SchemaMappingLoadingConfigXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + } + + public SchemaMappingLoadingConfig dataSource(SchemaMappingLoadingConfigDataSource dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get dataSource + * @return dataSource + */ + @Valid + @Schema(name = "data_source", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("data_source") + public SchemaMappingLoadingConfigDataSource getDataSource() { + return dataSource; + } + + public void setDataSource(SchemaMappingLoadingConfigDataSource dataSource) { + this.dataSource = dataSource; + } + + public SchemaMappingLoadingConfig importOption(ImportOptionEnum importOption) { + this.importOption = importOption; + return this; + } + + /** + * Get importOption + * @return importOption + */ + + @Schema(name = "import_option", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("import_option") + public ImportOptionEnum getImportOption() { + return importOption; + } + + public void setImportOption(ImportOptionEnum importOption) { + this.importOption = importOption; + } + + public SchemaMappingLoadingConfig format(SchemaMappingLoadingConfigFormat format) { + this.format = format; + return this; + } + + /** + * Get format + * @return format + */ + @Valid + @Schema(name = "format", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("format") + public SchemaMappingLoadingConfigFormat getFormat() { + return format; + } + + public void setFormat(SchemaMappingLoadingConfigFormat format) { + this.format = format; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemaMappingLoadingConfig schemaMappingLoadingConfig = (SchemaMappingLoadingConfig) o; + return Objects.equals(this.xCsrParams, schemaMappingLoadingConfig.xCsrParams) && + Objects.equals(this.dataSource, schemaMappingLoadingConfig.dataSource) && + Objects.equals(this.importOption, schemaMappingLoadingConfig.importOption) && + Objects.equals(this.format, schemaMappingLoadingConfig.format); + } + + @Override + public int hashCode() { + return Objects.hash(xCsrParams, dataSource, importOption, format); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SchemaMappingLoadingConfig {\n"); + sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" importOption: ").append(toIndentedString(importOption)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java new file mode 100644 index 000000000000..916d9b4c9ba7 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java @@ -0,0 +1,145 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * SchemaMappingLoadingConfigDataSource + */ + +@JsonTypeName("SchemaMapping_loading_config_data_source") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class SchemaMappingLoadingConfigDataSource { + + /** + * Gets or Sets scheme + */ + public enum SchemeEnum { + ODPS("odps"), + + FILE("file"); + + private String value; + + SchemeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SchemeEnum fromValue(String value) { + for (SchemeEnum b : SchemeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private SchemeEnum scheme; + + private String location; + + public SchemaMappingLoadingConfigDataSource scheme(SchemeEnum scheme) { + this.scheme = scheme; + return this; + } + + /** + * Get scheme + * @return scheme + */ + + @Schema(name = "scheme", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("scheme") + public SchemeEnum getScheme() { + return scheme; + } + + public void setScheme(SchemeEnum scheme) { + this.scheme = scheme; + } + + public SchemaMappingLoadingConfigDataSource location(String location) { + this.location = location; + return this; + } + + /** + * Get location + * @return location + */ + + @Schema(name = "location", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("location") + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemaMappingLoadingConfigDataSource schemaMappingLoadingConfigDataSource = (SchemaMappingLoadingConfigDataSource) o; + return Objects.equals(this.scheme, schemaMappingLoadingConfigDataSource.scheme) && + Objects.equals(this.location, schemaMappingLoadingConfigDataSource.location); + } + + @Override + public int hashCode() { + return Objects.hash(scheme, location); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SchemaMappingLoadingConfigDataSource {\n"); + sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java new file mode 100644 index 000000000000..e3cd81ccad24 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java @@ -0,0 +1,120 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * SchemaMappingLoadingConfigFormat + */ + +@JsonTypeName("SchemaMapping_loading_config_format") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class SchemaMappingLoadingConfigFormat { + + private String type; + + @Valid + private Map metadata = new HashMap<>(); + + public SchemaMappingLoadingConfigFormat type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public SchemaMappingLoadingConfigFormat metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SchemaMappingLoadingConfigFormat putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + */ + + @Schema(name = "metadata", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("metadata") + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemaMappingLoadingConfigFormat schemaMappingLoadingConfigFormat = (SchemaMappingLoadingConfigFormat) o; + return Objects.equals(this.type, schemaMappingLoadingConfigFormat.type) && + Objects.equals(this.metadata, schemaMappingLoadingConfigFormat.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(type, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SchemaMappingLoadingConfigFormat {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java new file mode 100644 index 000000000000..691f05739b40 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java @@ -0,0 +1,134 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * mutable_csr specific parameters + */ + +@Schema(name = "SchemaMapping_loading_config_x_csr_params", description = "mutable_csr specific parameters") +@JsonTypeName("SchemaMapping_loading_config_x_csr_params") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class SchemaMappingLoadingConfigXCsrParams { + + private Integer parallelism; + + private Boolean buildCsrInMem; + + private Boolean useMmapVector; + + public SchemaMappingLoadingConfigXCsrParams parallelism(Integer parallelism) { + this.parallelism = parallelism; + return this; + } + + /** + * Get parallelism + * @return parallelism + */ + + @Schema(name = "parallelism", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("parallelism") + public Integer getParallelism() { + return parallelism; + } + + public void setParallelism(Integer parallelism) { + this.parallelism = parallelism; + } + + public SchemaMappingLoadingConfigXCsrParams buildCsrInMem(Boolean buildCsrInMem) { + this.buildCsrInMem = buildCsrInMem; + return this; + } + + /** + * Get buildCsrInMem + * @return buildCsrInMem + */ + + @Schema(name = "build_csr_in_mem", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("build_csr_in_mem") + public Boolean getBuildCsrInMem() { + return buildCsrInMem; + } + + public void setBuildCsrInMem(Boolean buildCsrInMem) { + this.buildCsrInMem = buildCsrInMem; + } + + public SchemaMappingLoadingConfigXCsrParams useMmapVector(Boolean useMmapVector) { + this.useMmapVector = useMmapVector; + return this; + } + + /** + * Get useMmapVector + * @return useMmapVector + */ + + @Schema(name = "use_mmap_vector", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("use_mmap_vector") + public Boolean getUseMmapVector() { + return useMmapVector; + } + + public void setUseMmapVector(Boolean useMmapVector) { + this.useMmapVector = useMmapVector; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SchemaMappingLoadingConfigXCsrParams schemaMappingLoadingConfigXCsrParams = (SchemaMappingLoadingConfigXCsrParams) o; + return Objects.equals(this.parallelism, schemaMappingLoadingConfigXCsrParams.parallelism) && + Objects.equals(this.buildCsrInMem, schemaMappingLoadingConfigXCsrParams.buildCsrInMem) && + Objects.equals(this.useMmapVector, schemaMappingLoadingConfigXCsrParams.useMmapVector); + } + + @Override + public int hashCode() { + return Objects.hash(parallelism, buildCsrInMem, useMmapVector); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SchemaMappingLoadingConfigXCsrParams {\n"); + sb.append(" parallelism: ").append(toIndentedString(parallelism)).append("\n"); + sb.append(" buildCsrInMem: ").append(toIndentedString(buildCsrInMem)).append("\n"); + sb.append(" useMmapVector: ").append(toIndentedString(useMmapVector)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java new file mode 100644 index 000000000000..59c9ea611580 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java @@ -0,0 +1,228 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.GetGraphResponse; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ServiceStatus + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class ServiceStatus { + + private Boolean statisticsEnabled; + + private String status; + + private GetGraphResponse graph; + + private Integer boltPort; + + private Integer hqpsPort; + + private Integer gremlinPort; + + private Integer startTime; + + public ServiceStatus statisticsEnabled(Boolean statisticsEnabled) { + this.statisticsEnabled = statisticsEnabled; + return this; + } + + /** + * Get statisticsEnabled + * @return statisticsEnabled + */ + + @Schema(name = "statistics_enabled", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("statistics_enabled") + public Boolean getStatisticsEnabled() { + return statisticsEnabled; + } + + public void setStatisticsEnabled(Boolean statisticsEnabled) { + this.statisticsEnabled = statisticsEnabled; + } + + public ServiceStatus status(String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + + @Schema(name = "status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public ServiceStatus graph(GetGraphResponse graph) { + this.graph = graph; + return this; + } + + /** + * Get graph + * @return graph + */ + @Valid + @Schema(name = "graph", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("graph") + public GetGraphResponse getGraph() { + return graph; + } + + public void setGraph(GetGraphResponse graph) { + this.graph = graph; + } + + public ServiceStatus boltPort(Integer boltPort) { + this.boltPort = boltPort; + return this; + } + + /** + * Get boltPort + * @return boltPort + */ + + @Schema(name = "bolt_port", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bolt_port") + public Integer getBoltPort() { + return boltPort; + } + + public void setBoltPort(Integer boltPort) { + this.boltPort = boltPort; + } + + public ServiceStatus hqpsPort(Integer hqpsPort) { + this.hqpsPort = hqpsPort; + return this; + } + + /** + * Get hqpsPort + * @return hqpsPort + */ + + @Schema(name = "hqps_port", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("hqps_port") + public Integer getHqpsPort() { + return hqpsPort; + } + + public void setHqpsPort(Integer hqpsPort) { + this.hqpsPort = hqpsPort; + } + + public ServiceStatus gremlinPort(Integer gremlinPort) { + this.gremlinPort = gremlinPort; + return this; + } + + /** + * Get gremlinPort + * @return gremlinPort + */ + + @Schema(name = "gremlin_port", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("gremlin_port") + public Integer getGremlinPort() { + return gremlinPort; + } + + public void setGremlinPort(Integer gremlinPort) { + this.gremlinPort = gremlinPort; + } + + public ServiceStatus startTime(Integer startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get startTime + * @return startTime + */ + + @Schema(name = "start_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("start_time") + public Integer getStartTime() { + return startTime; + } + + public void setStartTime(Integer startTime) { + this.startTime = startTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceStatus serviceStatus = (ServiceStatus) o; + return Objects.equals(this.statisticsEnabled, serviceStatus.statisticsEnabled) && + Objects.equals(this.status, serviceStatus.status) && + Objects.equals(this.graph, serviceStatus.graph) && + Objects.equals(this.boltPort, serviceStatus.boltPort) && + Objects.equals(this.hqpsPort, serviceStatus.hqpsPort) && + Objects.equals(this.gremlinPort, serviceStatus.gremlinPort) && + Objects.equals(this.startTime, serviceStatus.startTime); + } + + @Override + public int hashCode() { + return Objects.hash(statisticsEnabled, status, graph, boltPort, hqpsPort, gremlinPort, startTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceStatus {\n"); + sb.append(" statisticsEnabled: ").append(toIndentedString(statisticsEnabled)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" graph: ").append(toIndentedString(graph)).append("\n"); + sb.append(" boltPort: ").append(toIndentedString(boltPort)).append("\n"); + sb.append(" hqpsPort: ").append(toIndentedString(hqpsPort)).append("\n"); + sb.append(" gremlinPort: ").append(toIndentedString(gremlinPort)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java new file mode 100644 index 000000000000..5bada3d6a573 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java @@ -0,0 +1,83 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * StartServiceRequest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class StartServiceRequest { + + private String graphId; + + public StartServiceRequest graphId(String graphId) { + this.graphId = graphId; + return this; + } + + /** + * Get graphId + * @return graphId + */ + + @Schema(name = "graph_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("graph_id") + public String getGraphId() { + return graphId; + } + + public void setGraphId(String graphId) { + this.graphId = graphId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartServiceRequest startServiceRequest = (StartServiceRequest) o; + return Objects.equals(this.graphId, startServiceRequest.graphId); + } + + @Override + public int hashCode() { + return Objects.hash(graphId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartServiceRequest {\n"); + sb.append(" graphId: ").append(toIndentedString(graphId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java new file mode 100644 index 000000000000..40bd1c5d9393 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java @@ -0,0 +1,97 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * StopServiceRequest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class StopServiceRequest { + + private JsonNullable graphId = JsonNullable.undefined(); + + public StopServiceRequest graphId(String graphId) { + this.graphId = JsonNullable.of(graphId); + return this; + } + + /** + * Get graphId + * @return graphId + */ + + @Schema(name = "graph_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("graph_id") + public JsonNullable getGraphId() { + return graphId; + } + + public void setGraphId(JsonNullable graphId) { + this.graphId = graphId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopServiceRequest stopServiceRequest = (StopServiceRequest) o; + return equalsNullable(this.graphId, stopServiceRequest.graphId); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(graphId)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StopServiceRequest {\n"); + sb.append(" graphId: ").append(toIndentedString(graphId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java new file mode 100644 index 000000000000..669471a630a7 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java @@ -0,0 +1,381 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.Parameter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * StoredProcedureMeta + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class StoredProcedureMeta { + + private String name; + + private String description; + + /** + * Gets or Sets type + */ + public enum TypeEnum { + CPP("cpp"), + + CYPHER("cypher"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private TypeEnum type; + + private String query; + + private String id; + + private String library; + + @Valid + private List<@Valid Parameter> params; + + @Valid + private List<@Valid Parameter> returns; + + private Boolean enable; + + @Valid + private Map option = new HashMap<>(); + + public StoredProcedureMeta() { + super(); + } + + /** + * Constructor with only required parameters + */ + public StoredProcedureMeta(String name, TypeEnum type, String query) { + this.name = name; + this.type = type; + this.query = query; + } + + public StoredProcedureMeta name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @Schema(name = "name", example = "query1", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public StoredProcedureMeta description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", example = "A sample stored procedure", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public StoredProcedureMeta type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @NotNull + @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("type") + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public StoredProcedureMeta query(String query) { + this.query = query; + return this; + } + + /** + * Get query + * @return query + */ + @NotNull + @Schema(name = "query", example = "MATCH(a) return COUNT(a);", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("query") + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public StoredProcedureMeta id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", example = "The unique identifier of procedure, currently is same with name.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public StoredProcedureMeta library(String library) { + this.library = library; + return this; + } + + /** + * Get library + * @return library + */ + + @Schema(name = "library", example = "/path/to/library", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("library") + public String getLibrary() { + return library; + } + + public void setLibrary(String library) { + this.library = library; + } + + public StoredProcedureMeta params(List<@Valid Parameter> params) { + this.params = params; + return this; + } + + public StoredProcedureMeta addParamsItem(Parameter paramsItem) { + if (this.params == null) { + this.params = new ArrayList<>(); + } + this.params.add(paramsItem); + return this; + } + + /** + * Get params + * @return params + */ + @Valid + @Schema(name = "params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("params") + public List<@Valid Parameter> getParams() { + return params; + } + + public void setParams(List<@Valid Parameter> params) { + this.params = params; + } + + public StoredProcedureMeta returns(List<@Valid Parameter> returns) { + this.returns = returns; + return this; + } + + public StoredProcedureMeta addReturnsItem(Parameter returnsItem) { + if (this.returns == null) { + this.returns = new ArrayList<>(); + } + this.returns.add(returnsItem); + return this; + } + + /** + * Get returns + * @return returns + */ + @Valid + @Schema(name = "returns", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("returns") + public List<@Valid Parameter> getReturns() { + return returns; + } + + public void setReturns(List<@Valid Parameter> returns) { + this.returns = returns; + } + + public StoredProcedureMeta enable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Get enable + * @return enable + */ + + @Schema(name = "enable", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enable") + public Boolean getEnable() { + return enable; + } + + public void setEnable(Boolean enable) { + this.enable = enable; + } + + public StoredProcedureMeta option(Map option) { + this.option = option; + return this; + } + + public StoredProcedureMeta putOptionItem(String key, Object optionItem) { + if (this.option == null) { + this.option = new HashMap<>(); + } + this.option.put(key, optionItem); + return this; + } + + /** + * Get option + * @return option + */ + + @Schema(name = "option", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("option") + public Map getOption() { + return option; + } + + public void setOption(Map option) { + this.option = option; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredProcedureMeta storedProcedureMeta = (StoredProcedureMeta) o; + return Objects.equals(this.name, storedProcedureMeta.name) && + Objects.equals(this.description, storedProcedureMeta.description) && + Objects.equals(this.type, storedProcedureMeta.type) && + Objects.equals(this.query, storedProcedureMeta.query) && + Objects.equals(this.id, storedProcedureMeta.id) && + Objects.equals(this.library, storedProcedureMeta.library) && + Objects.equals(this.params, storedProcedureMeta.params) && + Objects.equals(this.returns, storedProcedureMeta.returns) && + Objects.equals(this.enable, storedProcedureMeta.enable) && + Objects.equals(this.option, storedProcedureMeta.option); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, type, query, id, library, params, returns, enable, option); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredProcedureMeta {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" library: ").append(toIndentedString(library)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" returns: ").append(toIndentedString(returns)).append("\n"); + sb.append(" enable: ").append(toIndentedString(enable)).append("\n"); + sb.append(" option: ").append(toIndentedString(option)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java new file mode 100644 index 000000000000..a4d91ba0c8c4 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java @@ -0,0 +1,96 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.StringTypeString; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * StringType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class StringType implements GSDataType { + + private StringTypeString string; + + public StringType() { + super(); + } + + /** + * Constructor with only required parameters + */ + public StringType(StringTypeString string) { + this.string = string; + } + + public StringType string(StringTypeString string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + */ + @NotNull @Valid + @Schema(name = "string", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("string") + public StringTypeString getString() { + return string; + } + + public void setString(StringTypeString string) { + this.string = string; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StringType stringType = (StringType) o; + return Objects.equals(this.string, stringType.string); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringType {\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java new file mode 100644 index 000000000000..eac9f8bb72cf --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java @@ -0,0 +1,28 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.FixedChar; +import com.alibaba.graphscope.groot.service.models.FixedCharChar; +import com.alibaba.graphscope.groot.service.models.LongText; +import com.alibaba.graphscope.groot.service.models.VarChar; +import com.alibaba.graphscope.groot.service.models.VarCharVarChar; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public interface StringTypeString { +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java new file mode 100644 index 000000000000..80a628e1ca6d --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java @@ -0,0 +1,96 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.TemporalTypeTemporal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * TemporalType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class TemporalType implements GSDataType { + + private TemporalTypeTemporal temporal; + + public TemporalType() { + super(); + } + + /** + * Constructor with only required parameters + */ + public TemporalType(TemporalTypeTemporal temporal) { + this.temporal = temporal; + } + + public TemporalType temporal(TemporalTypeTemporal temporal) { + this.temporal = temporal; + return this; + } + + /** + * Get temporal + * @return temporal + */ + @NotNull @Valid + @Schema(name = "temporal", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("temporal") + public TemporalTypeTemporal getTemporal() { + return temporal; + } + + public void setTemporal(TemporalTypeTemporal temporal) { + this.temporal = temporal; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemporalType temporalType = (TemporalType) o; + return Objects.equals(this.temporal, temporalType.temporal); + } + + @Override + public int hashCode() { + return Objects.hash(temporal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemporalType {\n"); + sb.append(" temporal: ").append(toIndentedString(temporal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java new file mode 100644 index 000000000000..d272b77816ef --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java @@ -0,0 +1,25 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.DateType; +import com.alibaba.graphscope.groot.service.models.TimeStampType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public interface TemporalTypeTemporal { +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java new file mode 100644 index 000000000000..812b8c4c6f25 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java @@ -0,0 +1,95 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * TimeStampType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class TimeStampType implements TemporalTypeTemporal { + + private String timestamp; + + public TimeStampType() { + super(); + } + + /** + * Constructor with only required parameters + */ + public TimeStampType(String timestamp) { + this.timestamp = timestamp; + } + + public TimeStampType timestamp(String timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + */ + @NotNull + @Schema(name = "timestamp", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("timestamp") + public String getTimestamp() { + return timestamp; + } + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeStampType timeStampType = (TimeStampType) o; + return Objects.equals(this.timestamp, timeStampType.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeStampType {\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java new file mode 100644 index 000000000000..48802d161b75 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java @@ -0,0 +1,120 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.GSDataType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * TypedValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class TypedValue { + + private GSDataType type; + + private JsonNullable value = JsonNullable.undefined(); + + public TypedValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public TypedValue(GSDataType type, Object value) { + this.type = type; + this.value = JsonNullable.of(value); + } + + public TypedValue type(GSDataType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @NotNull @Valid + @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("type") + public GSDataType getType() { + return type; + } + + public void setType(GSDataType type) { + this.type = type; + } + + public TypedValue value(Object value) { + this.value = JsonNullable.of(value); + return this; + } + + /** + * Get value + * @return value + */ + @NotNull + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("value") + public JsonNullable getValue() { + return value; + } + + public void setValue(JsonNullable value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypedValue typedValue = (TypedValue) o; + return Objects.equals(this.type, typedValue.type) && + Objects.equals(this.value, typedValue.value); + } + + @Override + public int hashCode() { + return Objects.hash(type, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypedValue {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java new file mode 100644 index 000000000000..d34cea228799 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java @@ -0,0 +1,83 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * UpdateProcedureRequest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class UpdateProcedureRequest { + + private String description; + + public UpdateProcedureRequest description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + + @Schema(name = "description", example = "A sample stored procedure", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("description") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateProcedureRequest updateProcedureRequest = (UpdateProcedureRequest) o; + return Objects.equals(this.description, updateProcedureRequest.description); + } + + @Override + public int hashCode() { + return Objects.hash(description); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateProcedureRequest {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java new file mode 100644 index 000000000000..6997b70ccd5d --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java @@ -0,0 +1,129 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * UploadFileResponse + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class UploadFileResponse { + + private String filePath; + + @Valid + private Map metadata = new HashMap<>(); + + public UploadFileResponse() { + super(); + } + + /** + * Constructor with only required parameters + */ + public UploadFileResponse(String filePath) { + this.filePath = filePath; + } + + public UploadFileResponse filePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get filePath + * @return filePath + */ + @NotNull + @Schema(name = "file_path", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("file_path") + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + public UploadFileResponse metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public UploadFileResponse putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + */ + + @Schema(name = "metadata", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("metadata") + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadFileResponse uploadFileResponse = (UploadFileResponse) o; + return Objects.equals(this.filePath, uploadFileResponse.filePath) && + Objects.equals(this.metadata, uploadFileResponse.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(filePath, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UploadFileResponse {\n"); + sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java new file mode 100644 index 000000000000..7dd28dbecee2 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java @@ -0,0 +1,96 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.VarCharVarChar; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * VarChar + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class VarChar implements StringTypeString { + + private VarCharVarChar varChar; + + public VarChar() { + super(); + } + + /** + * Constructor with only required parameters + */ + public VarChar(VarCharVarChar varChar) { + this.varChar = varChar; + } + + public VarChar varChar(VarCharVarChar varChar) { + this.varChar = varChar; + return this; + } + + /** + * Get varChar + * @return varChar + */ + @NotNull @Valid + @Schema(name = "var_char", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("var_char") + public VarCharVarChar getVarChar() { + return varChar; + } + + public void setVarChar(VarCharVarChar varChar) { + this.varChar = varChar; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VarChar varChar = (VarChar) o; + return Objects.equals(this.varChar, varChar.varChar); + } + + @Override + public int hashCode() { + return Objects.hash(varChar); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VarChar {\n"); + sb.append(" varChar: ").append(toIndentedString(varChar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java new file mode 100644 index 000000000000..68ee4d031475 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java @@ -0,0 +1,96 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * VarCharVarChar + */ + +@JsonTypeName("VarChar_var_char") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class VarCharVarChar { + + private Integer maxLength; + + public VarCharVarChar() { + super(); + } + + /** + * Constructor with only required parameters + */ + public VarCharVarChar(Integer maxLength) { + this.maxLength = maxLength; + } + + public VarCharVarChar maxLength(Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + /** + * Get maxLength + * @return maxLength + */ + @NotNull + @Schema(name = "max_length", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("max_length") + public Integer getMaxLength() { + return maxLength; + } + + public void setMaxLength(Integer maxLength) { + this.maxLength = maxLength; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VarCharVarChar varCharVarChar = (VarCharVarChar) o; + return Objects.equals(this.maxLength, varCharVarChar.maxLength); + } + + @Override + public int hashCode() { + return Objects.hash(maxLength); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VarCharVarChar {\n"); + sb.append(" maxLength: ").append(toIndentedString(maxLength)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java new file mode 100644 index 000000000000..5461b4e7d75d --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java @@ -0,0 +1,131 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.Property; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * VertexData + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class VertexData { + + private String label; + + @Valid + private List<@Valid Property> values; + + public VertexData() { + super(); + } + + /** + * Constructor with only required parameters + */ + public VertexData(String label) { + this.label = label; + } + + public VertexData label(String label) { + this.label = label; + return this; + } + + /** + * Get label + * @return label + */ + @NotNull + @Schema(name = "label", example = "person", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("label") + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public VertexData values(List<@Valid Property> values) { + this.values = values; + return this; + } + + public VertexData addValuesItem(Property valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * Get values + * @return values + */ + @Valid + @Schema(name = "values", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("values") + public List<@Valid Property> getValues() { + return values; + } + + public void setValues(List<@Valid Property> values) { + this.values = values; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VertexData vertexData = (VertexData) o; + return Objects.equals(this.label, vertexData.label) && + Objects.equals(this.values, vertexData.values); + } + + @Override + public int hashCode() { + return Objects.hash(label, values); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VertexData {\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java new file mode 100644 index 000000000000..05bd29c74027 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java @@ -0,0 +1,142 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.EdgeRequest; +import com.alibaba.graphscope.groot.service.models.VertexRequest; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * VertexEdgeRequest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class VertexEdgeRequest { + + @Valid + private List<@Valid VertexRequest> vertexRequest = new ArrayList<>(); + + @Valid + private List<@Valid EdgeRequest> edgeRequest = new ArrayList<>(); + + public VertexEdgeRequest() { + super(); + } + + /** + * Constructor with only required parameters + */ + public VertexEdgeRequest(List<@Valid VertexRequest> vertexRequest, List<@Valid EdgeRequest> edgeRequest) { + this.vertexRequest = vertexRequest; + this.edgeRequest = edgeRequest; + } + + public VertexEdgeRequest vertexRequest(List<@Valid VertexRequest> vertexRequest) { + this.vertexRequest = vertexRequest; + return this; + } + + public VertexEdgeRequest addVertexRequestItem(VertexRequest vertexRequestItem) { + if (this.vertexRequest == null) { + this.vertexRequest = new ArrayList<>(); + } + this.vertexRequest.add(vertexRequestItem); + return this; + } + + /** + * Get vertexRequest + * @return vertexRequest + */ + @NotNull @Valid + @Schema(name = "vertex_request", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("vertex_request") + public List<@Valid VertexRequest> getVertexRequest() { + return vertexRequest; + } + + public void setVertexRequest(List<@Valid VertexRequest> vertexRequest) { + this.vertexRequest = vertexRequest; + } + + public VertexEdgeRequest edgeRequest(List<@Valid EdgeRequest> edgeRequest) { + this.edgeRequest = edgeRequest; + return this; + } + + public VertexEdgeRequest addEdgeRequestItem(EdgeRequest edgeRequestItem) { + if (this.edgeRequest == null) { + this.edgeRequest = new ArrayList<>(); + } + this.edgeRequest.add(edgeRequestItem); + return this; + } + + /** + * Get edgeRequest + * @return edgeRequest + */ + @NotNull @Valid + @Schema(name = "edge_request", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("edge_request") + public List<@Valid EdgeRequest> getEdgeRequest() { + return edgeRequest; + } + + public void setEdgeRequest(List<@Valid EdgeRequest> edgeRequest) { + this.edgeRequest = edgeRequest; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VertexEdgeRequest vertexEdgeRequest = (VertexEdgeRequest) o; + return Objects.equals(this.vertexRequest, vertexEdgeRequest.vertexRequest) && + Objects.equals(this.edgeRequest, vertexEdgeRequest.edgeRequest); + } + + @Override + public int hashCode() { + return Objects.hash(vertexRequest, edgeRequest); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VertexEdgeRequest {\n"); + sb.append(" vertexRequest: ").append(toIndentedString(vertexRequest)).append("\n"); + sb.append(" edgeRequest: ").append(toIndentedString(edgeRequest)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java new file mode 100644 index 000000000000..a462ba9edafa --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java @@ -0,0 +1,153 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.ColumnMapping; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * VertexMapping + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class VertexMapping { + + private String typeName; + + @Valid + private List inputs; + + @Valid + private List<@Valid ColumnMapping> columnMappings; + + public VertexMapping typeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get typeName + * @return typeName + */ + + @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_name") + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public VertexMapping inputs(List inputs) { + this.inputs = inputs; + return this; + } + + public VertexMapping addInputsItem(String inputsItem) { + if (this.inputs == null) { + this.inputs = new ArrayList<>(); + } + this.inputs.add(inputsItem); + return this; + } + + /** + * Get inputs + * @return inputs + */ + + @Schema(name = "inputs", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("inputs") + public List getInputs() { + return inputs; + } + + public void setInputs(List inputs) { + this.inputs = inputs; + } + + public VertexMapping columnMappings(List<@Valid ColumnMapping> columnMappings) { + this.columnMappings = columnMappings; + return this; + } + + public VertexMapping addColumnMappingsItem(ColumnMapping columnMappingsItem) { + if (this.columnMappings == null) { + this.columnMappings = new ArrayList<>(); + } + this.columnMappings.add(columnMappingsItem); + return this; + } + + /** + * Get columnMappings + * @return columnMappings + */ + @Valid + @Schema(name = "column_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("column_mappings") + public List<@Valid ColumnMapping> getColumnMappings() { + return columnMappings; + } + + public void setColumnMappings(List<@Valid ColumnMapping> columnMappings) { + this.columnMappings = columnMappings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VertexMapping vertexMapping = (VertexMapping) o; + return Objects.equals(this.typeName, vertexMapping.typeName) && + Objects.equals(this.inputs, vertexMapping.inputs) && + Objects.equals(this.columnMappings, vertexMapping.columnMappings); + } + + @Override + public int hashCode() { + return Objects.hash(typeName, inputs, columnMappings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VertexMapping {\n"); + sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); + sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n"); + sb.append(" columnMappings: ").append(toIndentedString(columnMappings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java new file mode 100644 index 000000000000..8e16458fb821 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java @@ -0,0 +1,166 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.Property; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * VertexRequest + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class VertexRequest { + + private String label; + + @Valid + private List<@Valid Property> primaryKeyValues = new ArrayList<>(); + + @Valid + private List<@Valid Property> properties = new ArrayList<>(); + + public VertexRequest() { + super(); + } + + /** + * Constructor with only required parameters + */ + public VertexRequest(String label, List<@Valid Property> primaryKeyValues, List<@Valid Property> properties) { + this.label = label; + this.primaryKeyValues = primaryKeyValues; + this.properties = properties; + } + + public VertexRequest label(String label) { + this.label = label; + return this; + } + + /** + * Get label + * @return label + */ + @NotNull + @Schema(name = "label", example = "person", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("label") + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public VertexRequest primaryKeyValues(List<@Valid Property> primaryKeyValues) { + this.primaryKeyValues = primaryKeyValues; + return this; + } + + public VertexRequest addPrimaryKeyValuesItem(Property primaryKeyValuesItem) { + if (this.primaryKeyValues == null) { + this.primaryKeyValues = new ArrayList<>(); + } + this.primaryKeyValues.add(primaryKeyValuesItem); + return this; + } + + /** + * Get primaryKeyValues + * @return primaryKeyValues + */ + @NotNull @Valid + @Schema(name = "primary_key_values", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("primary_key_values") + public List<@Valid Property> getPrimaryKeyValues() { + return primaryKeyValues; + } + + public void setPrimaryKeyValues(List<@Valid Property> primaryKeyValues) { + this.primaryKeyValues = primaryKeyValues; + } + + public VertexRequest properties(List<@Valid Property> properties) { + this.properties = properties; + return this; + } + + public VertexRequest addPropertiesItem(Property propertiesItem) { + if (this.properties == null) { + this.properties = new ArrayList<>(); + } + this.properties.add(propertiesItem); + return this; + } + + /** + * Get properties + * @return properties + */ + @NotNull @Valid + @Schema(name = "properties", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("properties") + public List<@Valid Property> getProperties() { + return properties; + } + + public void setProperties(List<@Valid Property> properties) { + this.properties = properties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VertexRequest vertexRequest = (VertexRequest) o; + return Objects.equals(this.label, vertexRequest.label) && + Objects.equals(this.primaryKeyValues, vertexRequest.primaryKeyValues) && + Objects.equals(this.properties, vertexRequest.properties); + } + + @Override + public int hashCode() { + return Objects.hash(label, primaryKeyValues, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VertexRequest {\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" primaryKeyValues: ").append(toIndentedString(primaryKeyValues)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java new file mode 100644 index 000000000000..54bcb6615b8f --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java @@ -0,0 +1,131 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * VertexStatistics + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class VertexStatistics { + + private Integer typeId; + + private String typeName; + + private Integer count; + + public VertexStatistics typeId(Integer typeId) { + this.typeId = typeId; + return this; + } + + /** + * Get typeId + * @return typeId + */ + + @Schema(name = "type_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_id") + public Integer getTypeId() { + return typeId; + } + + public void setTypeId(Integer typeId) { + this.typeId = typeId; + } + + public VertexStatistics typeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get typeName + * @return typeName + */ + + @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_name") + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public VertexStatistics count(Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * @return count + */ + + @Schema(name = "count", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("count") + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VertexStatistics vertexStatistics = (VertexStatistics) o; + return Objects.equals(this.typeId, vertexStatistics.typeId) && + Objects.equals(this.typeName, vertexStatistics.typeName) && + Objects.equals(this.count, vertexStatistics.count); + } + + @Override + public int hashCode() { + return Objects.hash(typeId, typeName, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VertexStatistics {\n"); + sb.append(" typeId: ").append(toIndentedString(typeId)).append("\n"); + sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java new file mode 100644 index 000000000000..33f0b3745469 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java @@ -0,0 +1,144 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * VertexTypePairStatistics + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +public class VertexTypePairStatistics { + + private String sourceVertex; + + private String destinationVertex; + + private Integer count; + + public VertexTypePairStatistics() { + super(); + } + + /** + * Constructor with only required parameters + */ + public VertexTypePairStatistics(String sourceVertex, String destinationVertex, Integer count) { + this.sourceVertex = sourceVertex; + this.destinationVertex = destinationVertex; + this.count = count; + } + + public VertexTypePairStatistics sourceVertex(String sourceVertex) { + this.sourceVertex = sourceVertex; + return this; + } + + /** + * Get sourceVertex + * @return sourceVertex + */ + @NotNull + @Schema(name = "source_vertex", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("source_vertex") + public String getSourceVertex() { + return sourceVertex; + } + + public void setSourceVertex(String sourceVertex) { + this.sourceVertex = sourceVertex; + } + + public VertexTypePairStatistics destinationVertex(String destinationVertex) { + this.destinationVertex = destinationVertex; + return this; + } + + /** + * Get destinationVertex + * @return destinationVertex + */ + @NotNull + @Schema(name = "destination_vertex", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("destination_vertex") + public String getDestinationVertex() { + return destinationVertex; + } + + public void setDestinationVertex(String destinationVertex) { + this.destinationVertex = destinationVertex; + } + + public VertexTypePairStatistics count(Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * @return count + */ + @NotNull + @Schema(name = "count", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("count") + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VertexTypePairStatistics vertexTypePairStatistics = (VertexTypePairStatistics) o; + return Objects.equals(this.sourceVertex, vertexTypePairStatistics.sourceVertex) && + Objects.equals(this.destinationVertex, vertexTypePairStatistics.destinationVertex) && + Objects.equals(this.count, vertexTypePairStatistics.count); + } + + @Override + public int hashCode() { + return Objects.hash(sourceVertex, destinationVertex, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VertexTypePairStatistics {\n"); + sb.append(" sourceVertex: ").append(toIndentedString(sourceVertex)).append("\n"); + sb.append(" destinationVertex: ").append(toIndentedString(destinationVertex)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/HomeController.java b/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/HomeController.java new file mode 100644 index 000000000000..9aa29284ab5f --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/HomeController.java @@ -0,0 +1,20 @@ +package org.openapitools.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; + +/** + * Home redirection to OpenAPI api documentation + */ +@Controller +public class HomeController { + + @RequestMapping("/") + public String index() { + return "redirect:swagger-ui.html"; + } + +} \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..89a279010dd4 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java @@ -0,0 +1,36 @@ +package org.openapitools.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.security.SecurityScheme; + +@Configuration +public class SpringDocConfiguration { + + @Bean(name = "org.openapitools.configuration.SpringDocConfiguration.apiInfo") + OpenAPI apiInfo() { + return new OpenAPI() + .info( + new Info() + .title("GraphScope Interactive API v0.3") + .description("This is the definition of GraphScope Interactive API, including - AdminService API - Vertex/Edge API - QueryService AdminService API (with tag AdminService) defines the API for GraphManagement, ProcedureManagement and Service Management. Vertex/Edge API (with tag GraphService) defines the API for Vertex/Edge management, including creation/updating/delete/retrive. QueryService API (with tag QueryService) defines the API for procedure_call, Ahodc query. ") + .contact( + new Contact() + .email("graphscope@alibaba-inc.com") + ) + .license( + new License() + .name("Apache 2.0") + .url("http://www.apache.org/licenses/LICENSE-2.0.html") + ) + .version("1.0.0") + ) + ; + } +} \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/resources/application.properties b/interactive_engine/groot-http/src/main/resources/application.properties new file mode 100644 index 000000000000..d28c43b756f7 --- /dev/null +++ b/interactive_engine/groot-http/src/main/resources/application.properties @@ -0,0 +1,3 @@ +server.port=8080 +spring.jackson.date-format=com.alibaba.graphscope.groot.RFC3339DateFormat +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/interactive_engine/groot-http/src/main/resources/openapi.yaml b/interactive_engine/groot-http/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d665f130aa30 --- /dev/null +++ b/interactive_engine/groot-http/src/main/resources/openapi.yaml @@ -0,0 +1,2951 @@ +openapi: 3.0.3 +info: + contact: + email: graphscope@alibaba-inc.com + description: | + This is the definition of GraphScope Interactive API, including + - AdminService API + - Vertex/Edge API + - QueryService + + + AdminService API (with tag AdminService) defines the API for GraphManagement, ProcedureManagement and Service Management. + + Vertex/Edge API (with tag GraphService) defines the API for Vertex/Edge management, including creation/updating/delete/retrive. + + QueryService API (with tag QueryService) defines the API for procedure_call, Ahodc query. + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: GraphScope Interactive API v0.3 + version: 1.0.0 +externalDocs: + description: Find out More about GraphScope + url: http://graphscope.io +servers: +- description: SwaggerHub API Auto Mocking + url: https://virtserver.swaggerhub.com/GRAPHSCOPE/InteractiveAPI/1.0.0 +- description: SwaggerHub API Auto Mocking + url: https://virtserver.swaggerhub.com/GRAPHSCOPE/interactive/1.0.0 +tags: +- description: GraphManagement + name: AdminService/GraphManagement +- description: ProcedureManagement + name: AdminService/ProcedureManagement +- description: ServiceManagement + name: AdminService/ServiceManagement +- description: VertexManagement + name: GraphService/VertexManagement +- description: EdgeManagement + name: GraphService/EdgeManagement +- description: Graph query + name: QueryService +paths: + /v1/graph: + get: + description: List all graphs + operationId: list_graphs + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/GetGraphResponse' + type: array + description: Successful operation + tags: + - AdminService/GraphManagement + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement + post: + description: Create a new graph + operationId: create_graph + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateGraphRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CreateGraphResponse' + description: successful operation + "400": + content: + application/json: + schema: + type: string + description: BadRequest + "500": + content: + application/json: + schema: + type: string + description: Internal error + tags: + - AdminService/GraphManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement + /v1/graph/{graph_id}: + delete: + description: Delete a graph by id + operationId: delete_graph + parameters: + - description: The id of graph to delete + explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: Successfully delete graph + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful operation + "404": + content: + application/json: + example: + code: 4 + message: Graph not found + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Not Found + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Internal Error + tags: + - AdminService/GraphManagement + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement + get: + description: Get a graph by name + operationId: get_graph + parameters: + - description: The id of graph to get + explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetGraphResponse' + description: Successful operation + "404": + content: + application/json: + schema: + example: graph not exists + type: string + description: Not found + tags: + - AdminService/GraphManagement + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement + /v1/graph/{graph_id}/schema: + get: + description: Get schema by graph id + operationId: get_schema + parameters: + - description: The id of graph to delete + explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetGraphSchemaResponse' + description: successful operation + tags: + - AdminService/GraphManagement + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement + /v1/graph/{graph_id}/statistics: + get: + description: "Get the statics info of a graph, including number of vertices\ + \ for each label, number of edges for each label." + operationId: get_graph_statistic + parameters: + - description: The id of graph to get statistics + explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetGraphStatisticsResponse' + description: successful operation + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server Internal Error + "404": + content: + application/json: + example: + code: 4 + message: Graph not found + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Not Found + "503": + content: + application/json: + example: + code: 15 + message: Service Unavailable + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Service Unavailable + tags: + - AdminService/GraphManagement + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement + /v1/graph/{graph_id}/dataloading: + post: + description: Create a dataloading job + operationId: create_dataloading_job + parameters: + - description: The id of graph to do bulk loading. + explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SchemaMapping' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/JobResponse' + description: successful operation + tags: + - AdminService/GraphManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement + /v1/job/{job_id}: + delete: + operationId: delete_job_by_id + parameters: + - explode: false + in: path + name: job_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: "Successfully cancel job: 123" + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful operation + tags: + - AdminService/JobManagement + x-accepts: application/json + x-tags: + - tag: AdminService/JobManagement + get: + operationId: get_job_by_id + parameters: + - description: "The id of the job, returned from POST /v1/graph/{graph_id}/dataloading" + explode: false + in: path + name: job_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatus' + description: successful operation + tags: + - AdminService/JobManagement + x-accepts: application/json + x-tags: + - tag: AdminService/JobManagement + /v1/job: + get: + operationId: list_jobs + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/JobStatus' + type: array + description: successful operation + tags: + - AdminService/JobManagement + x-accepts: application/json + x-tags: + - tag: AdminService/JobManagement + /v1/graph/{graph_id}/procedure: + get: + description: List all procedures + operationId: list_procedures + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/GetProcedureResponse' + type: array + description: Successful operation + "404": + content: + application/json: + schema: + example: Graph not found + type: string + description: Not found + tags: + - AdminService/ProcedureManagement + x-accepts: application/json + x-tags: + - tag: AdminService/ProcedureManagement + post: + description: Create a new procedure on a graph + operationId: create_procedure + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProcedureRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProcedureResponse' + description: successful operation + "400": + content: + application/json: + example: + code: 14 + message: Bad request + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Bad request + "404": + content: + application/json: + example: + code: 4 + message: Graph not found + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: not found + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Internal Error + tags: + - AdminService/ProcedureManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: AdminService/ProcedureManagement + /v1/graph/{graph_id}/procedure/{procedure_id}: + delete: + description: Delete a procedure on a graph by id + operationId: delete_procedure + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: procedure_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful operation + "404": + content: + application/json: + example: + code: 4 + message: Graph not found/Procedure not found + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Not Found + tags: + - AdminService/ProcedureManagement + x-accepts: application/json + x-tags: + - tag: AdminService/ProcedureManagement + get: + description: Get a procedure by id + operationId: get_procedure + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: procedure_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetProcedureResponse' + description: successful operation + "404": + content: + application/json: + schema: + example: Graph not found/procedure not found + type: string + description: Not found + tags: + - AdminService/ProcedureManagement + x-accepts: application/json + x-tags: + - tag: AdminService/ProcedureManagement + put: + description: Update procedure on a graph by id + operationId: update_procedure + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: procedure_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProcedureRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful operation + "400": + content: + application/json: + example: + code: 14 + message: Bad request + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Bad request + "404": + content: + application/json: + example: + code: 4 + message: Graph not found/Procedure not found + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Not Found + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Internal error + tags: + - AdminService/ProcedureManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: AdminService/ProcedureManagement + /v1/service/start: + post: + description: Start service on a specified graph + operationId: start_service + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartServiceRequest' + description: Start service on a specified graph + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: successful operation + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Internal Error + tags: + - AdminService/ServiceManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: AdminService/ServiceManagement + /v1/service/stop: + post: + description: Stop current service + operationId: stop_service + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StopServiceRequest' + description: Stop service on a specified graph + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: successful operation + tags: + - AdminService/ServiceManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: AdminService/ServiceManagement + /v1/service/restart: + post: + description: Start current service + operationId: restart_service + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: successful operation + tags: + - AdminService/ServiceManagement + x-accepts: application/json + x-tags: + - tag: AdminService/ServiceManagement + /v1/service/status: + get: + description: Get service status + operationId: get_service_status + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceStatus' + description: successful operation + tags: + - AdminService/ServiceManagement + x-accepts: application/json + x-tags: + - tag: AdminService/ServiceManagement + /v1/graph/{graph_id}/vertex: + delete: + description: | + Remove the vertex from the specified graph. + operationId: delete_vertex + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - description: The label name of querying vertex. + explode: true + in: query + name: label + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/Property' + type: array + description: The primary key values of the vertex to delete. + required: true + responses: + "200": + content: + application/json: + example: + message: Successfully delete vertex + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully delete vertex + "400": + content: + application/json: + example: + code: 101 + message: Invalid input vertex schema + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Invalid input vertex + "404": + content: + application/json: + example: + code: 4 + message: Vertex not exists + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Vertex not exists or Graph not exits. + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server internal error + summary: Remove vertex from the graph + tags: + - GraphService/VertexManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: GraphService/VertexManagement + get: + description: | + Get the properties for the specified vertex. + example: + ```http + GET /endpoint?param1=value1¶m2=value2 HTTP/1.1 + Host: example.com + ``` + operationId: get_vertex + parameters: + - description: The id of the graph + explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - description: The label name of querying vertex. + explode: true + in: query + name: label + required: true + schema: + type: string + style: form + - description: The primary key value of querying vertex. + explode: true + in: query + name: primary_key_value + required: true + schema: + $ref: '#/components/schemas/AnyValue' + style: form + responses: + "200": + content: + application/json: + example: + label: person + values: + - name: id + value: 1 + - name: age + value: 23 + - name: name + value: amy + schema: + $ref: '#/components/schemas/VertexData' + description: Found vertex + "400": + description: Bad input parameter + "404": + description: Vertex not found or graph not found + "500": + description: Server internal error + summary: Get the vertex's properties with vertex primary key. + tags: + - GraphService/VertexManagement + x-accepts: application/json + x-tags: + - tag: GraphService/VertexManagement + post: + description: | + Add the provided vertex to the specified graph. + operationId: add_vertex + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + example: + - label: person + primary_key_values: + id: 2 + properties: + age: 24 + name: Cindy + schema: + items: + $ref: '#/components/schemas/VertexRequest' + type: array + required: true + responses: + "200": + content: + application/json: + example: + message: Successfully created vertex + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully created vertex + "400": + content: + application/json: + example: + code: 101 + message: Invalid input vertex schema + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Invalid input vertex + "404": + content: + application/json: + example: + code: 4 + message: Graph not found + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Graph not found + "409": + content: + application/json: + example: + code: 102 + message: Vertex already exists + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Vertex already exists + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server internal error + summary: Add vertex to the graph + tags: + - GraphService/VertexManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: GraphService/VertexManagement + put: + description: | + Remove the vertex from the specified graph. + operationId: update_vertex + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + example: + label: person + primary_key_value: 2 + properties: + age: 24 + name: Cindy + schema: + $ref: '#/components/schemas/VertexRequest' + responses: + "200": + content: + application/json: + example: + message: Successfully updated vertex + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully update vertex + "400": + content: + application/json: + example: + code: 101 + message: Invalid input vertex schema + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Invalid input parameters + "404": + content: + application/json: + example: + code: 4 + message: Vertex not exists + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Vertex not exists + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server internal error + summary: Update vertex's property + tags: + - GraphService/VertexManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: GraphService/VertexManagement + /v1/graph/{graph_id}/edge: + delete: + description: | + Remove the edge from current graph. + operationId: delete_edge + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - description: The label name of edge. + example: created + explode: true + in: query + name: edge_label + required: true + schema: + type: string + style: form + - description: The label name of src vertex. + example: person + explode: true + in: query + name: src_label + required: true + schema: + type: string + style: form + - description: The label name of dst vertex. + example: software + explode: true + in: query + name: dst_label + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/delete_edge_request' + description: The primary key values of the src and dst vertices. + required: true + responses: + "200": + content: + application/json: + example: + message: Successfully delete edge + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully delete edge + "400": + content: + application/json: + example: + code: 101 + message: Invalid input edge schema + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Invalid input edge + "404": + content: + application/json: + example: + code: 4 + message: Edge not exists + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Edge not exists or Graph not exits + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server internal error + summary: Remove edge from the graph + tags: + - GraphService/EdgeManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: GraphService/EdgeManagement + get: + description: | + Get the properties for the specified vertex. + operationId: get_edge + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - description: The label name of querying edge. + example: created + explode: true + in: query + name: edge_label + required: true + schema: + type: string + style: form + - description: The label name of src vertex. + example: person + explode: true + in: query + name: src_label + required: true + schema: + type: string + style: form + - description: The primary key value of src vertex. + example: 1 + explode: true + in: query + name: src_primary_key_value + required: true + schema: + $ref: '#/components/schemas/AnyValue' + style: form + - description: The label name of dst vertex. + example: software + explode: true + in: query + name: dst_label + required: true + schema: + type: string + style: form + - description: The value of dst vertex's primary key + example: 3 + explode: true + in: query + name: dst_primary_key_value + required: true + schema: + $ref: '#/components/schemas/AnyValue' + style: form + responses: + "200": + content: + application/json: + example: + src_label: person + dst_label: software + edge_label: created + src_pk_value: 1 + dst_pk_value: 3 + properties: + - name: weight + value: 0.2 + schema: + $ref: '#/components/schemas/EdgeData' + description: Found Edge + "400": + content: + application/json: + example: + code: 101 + message: Invalid input edge schema + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Bad input parameter + "404": + content: + application/json: + example: + code: 4 + message: Edge not found + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Edge not found or Graph not found + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server internal error + summary: Get the edge's properties with src and dst vertex primary keys. + tags: + - GraphService/EdgeManagement + x-accepts: application/json + x-tags: + - tag: GraphService/EdgeManagement + post: + description: | + Add the edge to graph. + operationId: add_edge + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + example: + - src_label: person + dst_label: software + edge_label: created + src_pk_name: id + src_pk_value: 1 + dst_pk_name: id + dst_pk_value: 3 + properties: + - name: weight + value: 0.2 + schema: + items: + $ref: '#/components/schemas/EdgeRequest' + type: array + required: true + responses: + "200": + content: + application/json: + example: + message: Successfuly create edge + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully insert the edge + "400": + content: + application/json: + example: + code: 101 + message: Invalid input edge schema + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Invalid input edge + "409": + content: + application/json: + example: + code: 102 + message: Edge already exists + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: edge already exists + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server internal error + summary: Add edge to the graph + tags: + - GraphService/EdgeManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: GraphService/EdgeManagement + put: + description: | + Update the edge on the running graph. + operationId: update_edge + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + example: + src_label: person + dst_label: software + edge_label: created + src_pk_name: id + src_pk_value: 1 + dst_pk_name: id + dst_pk_value: 3 + properties: + - name: weight + value: 0.3 + schema: + $ref: '#/components/schemas/EdgeRequest' + responses: + "200": + content: + application/json: + example: + message: Successfully update edge + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully update edge + "400": + content: + application/json: + example: + code: 101 + message: Invalid input edge schema + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Invalid input parameters + "404": + content: + application/json: + example: + code: 4 + message: Edge not exists + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Edge not exists + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server internal error + summary: Update edge's property + tags: + - GraphService/EdgeManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: GraphService/EdgeManagement + /v1/graph/{graph_id}/query: + post: + description: | + After the procedure is created, user can use this API to run the procedure. + operationId: call_proc + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + text/plain: + schema: + format: byte + type: string + responses: + "200": + content: + text/plain: + schema: + format: byte + type: string + description: Successfully runned. + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server internal error + summary: run queries on graph + tags: + - QueryService + x-content-type: text/plain + x-accepts: application/json + x-tags: + - tag: QueryService + /v1/graph/current/query: + post: + description: | + Submit a query to the running graph. + operationId: call_proc_current + requestBody: + content: + text/plain: + schema: + format: byte + type: string + responses: + "200": + content: + text/plain: + schema: + format: byte + type: string + description: Successfully runned. Empty if failed? + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server internal error + summary: run queries on the running graph + tags: + - QueryService + x-content-type: text/plain + x-accepts: application/json + x-tags: + - tag: QueryService + /v1/graph/current/adhoc_query: + post: + description: | + Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: + https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto + operationId: run_adhoc_current + requestBody: + content: + text/plain: + schema: + format: byte + type: string + responses: + "200": + content: + text/plain: + schema: + format: byte + type: string + description: Successfully runned. Empty if failed? + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server internal error + summary: Submit adhoc query to the Interactive Query Service. + tags: + - QueryService + x-content-type: text/plain + x-accepts: application/json + x-tags: + - tag: QueryService + /v1/graph/{graph_id}/adhoc_query: + post: + description: | + Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: + https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto + operationId: run_adhoc + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + text/plain: + schema: + format: byte + type: string + responses: + "200": + content: + text/plain: + schema: + format: byte + type: string + description: Successfully runned. + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server internal error + summary: Submit adhoc query to the Interactive Query Service. + tags: + - QueryService + x-content-type: text/plain + x-accepts: application/json + x-tags: + - tag: QueryService + /v1/file/upload: + post: + operationId: uploadFile + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + required: true + responses: + "200": + content: + application/json: + example: + file_path: /home/graphscope/path/to/file.csv + schema: + $ref: '#/components/schemas/UploadFileResponse' + description: successful operation + "500": + content: + application/json: + example: + code: 103 + message: Internal error + schema: + $ref: '#/components/schemas/APIResponseWithCode' + description: Server Internal Error + tags: + - Utils + x-content-type: multipart/form-data + x-accepts: application/json + x-tags: + - tag: Utils +components: + schemas: + AnyValue: {} + TypedValue: + properties: + type: + $ref: '#/components/schemas/GSDataType' + value: {} + required: + - type + - value + type: object + PrimitiveType: + properties: + primitive_type: + enum: + - DT_SIGNED_INT32 + - DT_UNSIGNED_INT32 + - DT_SIGNED_INT64 + - DT_UNSIGNED_INT64 + - DT_BOOL + - DT_FLOAT + - DT_DOUBLE + - DT_STRING + example: DT_SIGNED_INT32 + type: string + required: + - primitive_type + type: object + x-body-name: primitive_type + LongText: + additionalProperties: false + properties: + long_text: + nullable: true + type: string + required: + - long_text + type: object + x-body-name: long_text + FixedChar: + additionalProperties: false + properties: + char: + $ref: '#/components/schemas/FixedChar_char' + required: + - char + type: object + x-body-name: fixed_char + VarChar: + additionalProperties: false + properties: + var_char: + $ref: '#/components/schemas/VarChar_var_char' + required: + - var_char + type: object + x-body-name: var_char + StringType: + properties: + string: + $ref: '#/components/schemas/StringType_string' + required: + - string + type: object + x-body-name: string_type + TimeStampType: + properties: + timestamp: + type: string + required: + - timestamp + type: object + x-body-name: time_stamp_type + DateType: + properties: + date32: + type: string + required: + - date32 + type: object + x-body-name: date_type + TemporalType: + properties: + temporal: + $ref: '#/components/schemas/TemporalType_temporal' + required: + - temporal + type: object + x-body-name: temporal_type + GSDataType: + oneOf: + - $ref: '#/components/schemas/PrimitiveType' + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/TemporalType' + x-body-name: gs_data_type + x-one-of-name: GSDataType + Property: + example: + name: id + value: "" + properties: + name: + example: id + type: string + value: {} + required: + - name + - value + type: object + x-body-name: property + Parameter: + properties: + name: + example: param1 + type: string + type: + $ref: '#/components/schemas/GSDataType' + required: + - name + - type + type: object + x-body-name: parameter + VertexRequest: + example: + primary_key_values: + - name: id + value: "" + - name: id + value: "" + label: person + properties: + - name: id + value: "" + - name: id + value: "" + properties: + label: + example: person + type: string + primary_key_values: + items: + $ref: '#/components/schemas/Property' + type: array + properties: + items: + $ref: '#/components/schemas/Property' + type: array + required: + - label + - primary_key_values + - properties + type: object + x-body-name: vertex_request + VertexData: + example: + values: + - name: id + value: "" + - name: id + value: "" + label: person + properties: + label: + example: person + type: string + values: + items: + $ref: '#/components/schemas/Property' + type: array + required: + - label + type: object + x-body-name: vertex_data + EdgeData: + example: + src_label: person + src_primary_key_value: "" + dst_label: software + edge_label: created + dst_primary_key_value: "" + properties: + - name: id + value: "" + - name: id + value: "" + properties: + src_label: + example: person + type: string + dst_label: + example: software + type: string + edge_label: + example: created + type: string + src_primary_key_value: {} + dst_primary_key_value: {} + properties: + items: + $ref: '#/components/schemas/Property' + type: array + required: + - dst_label + - dst_primary_key_value + - edge_label + - properties + - src_label + - src_primary_key_value + type: object + x-body-name: edge_data + EdgeRequest: + example: + src_label: person + dst_primary_key_values: + - name: id + value: "" + - name: id + value: "" + dst_label: software + src_primary_key_values: + - name: id + value: "" + - name: id + value: "" + edge_label: created + properties: + - name: id + value: "" + - name: id + value: "" + properties: + src_label: + example: person + type: string + dst_label: + example: software + type: string + edge_label: + example: created + type: string + src_primary_key_values: + items: + $ref: '#/components/schemas/Property' + type: array + dst_primary_key_values: + items: + $ref: '#/components/schemas/Property' + type: array + properties: + items: + $ref: '#/components/schemas/Property' + type: array + required: + - dst_label + - dst_primary_key_values + - edge_label + - src_label + - src_primary_key_values + type: object + x-body-name: edge_request + QueryRequest: + properties: + query_name: + example: ic1 + type: string + arguments: + items: + $ref: '#/components/schemas/TypedValue' + type: array + required: + - query_name + type: object + x-body-name: query_request + CreateProcedureRequest: + example: + query: MATCH(a) return COUNT(a); + name: query1 + description: A sample stored procedure + type: cpp + properties: + name: + example: query1 + type: string + description: + example: A sample stored procedure + type: string + type: + enum: + - cpp + - cypher + type: string + query: + example: MATCH(a) return COUNT(a); + type: string + required: + - name + - query + - type + type: object + x-body-name: create_procedure_request + CreateProcedureResponse: + example: + procedure_id: proc1 + properties: + procedure_id: + example: proc1 + type: string + required: + - procedure_id + type: object + x-body-name: create_procedure_response + StoredProcedureMeta: + allOf: + - $ref: '#/components/schemas/CreateProcedureRequest' + - properties: + id: + example: "The unique identifier of procedure, currently is same with name." + type: string + library: + example: /path/to/library + type: string + params: + items: + $ref: '#/components/schemas/Parameter' + type: array + returns: + items: + $ref: '#/components/schemas/Parameter' + type: array + enable: + example: true + type: boolean + option: + additionalProperties: true + type: object + type: object + x-body-name: stored_procedure_meta + GetProcedureResponse: + allOf: + - $ref: '#/components/schemas/StoredProcedureMeta' + - properties: + bound_graph: + type: string + runnable: + type: boolean + creation_time: + type: integer + update_time: + type: integer + type: object + x-body-name: get_procedure_response + UpdateProcedureRequest: + example: + description: A sample stored procedure + properties: + description: + example: A sample stored procedure + type: string + type: object + x-body-name: update_procedure_request + CreateGraphResponse: + example: + graph_id: "1" + properties: + graph_id: + example: "1" + type: string + type: object + x-body-name: create_graph_response + CreateGraphRequest: + example: + schema: + vertex_types: + - null + - null + edge_types: + - null + - null + stored_procedures: + - query: MATCH(a) return COUNT(a); + name: query1 + description: A sample stored procedure + type: cpp + - query: MATCH(a) return COUNT(a); + name: query1 + description: A sample stored procedure + type: cpp + name: modern_graph + description: A default description + properties: + name: + example: modern_graph + type: string + description: + example: A default description + type: string + stored_procedures: + items: + $ref: '#/components/schemas/CreateProcedureRequest' + type: array + schema: + $ref: '#/components/schemas/CreateGraphSchemaRequest' + type: object + x-body-name: create_graph_request + APIResponse: + example: Response string + type: string + x-body-name: api_response + APIResponseWithCode: + example: + code: 500 + message: Internal Error + properties: + code: + format: int32 + type: integer + message: + type: string + type: object + x-body-name: api_response_with_code + VertexStatistics: + example: + type_name: type_name + type_id: 1 + count: 5 + properties: + type_id: + type: integer + type_name: + type: string + count: + type: integer + type: object + x-body-name: vertex_statistics + VertexTypePairStatistics: + example: + source_vertex: source_vertex + destination_vertex: destination_vertex + count: 2 + properties: + source_vertex: + type: string + destination_vertex: + type: string + count: + type: integer + required: + - count + - destination_vertex + - source_vertex + type: object + x-body-name: vertex_type_pair_statistics + EdgeStatistics: + example: + type_name: type_name + type_id: 5 + vertex_type_pair_statistics: + - source_vertex: source_vertex + destination_vertex: destination_vertex + count: 2 + - source_vertex: source_vertex + destination_vertex: destination_vertex + count: 2 + properties: + type_id: + type: integer + type_name: + type: string + vertex_type_pair_statistics: + items: + $ref: '#/components/schemas/VertexTypePairStatistics' + type: array + type: object + x-body-name: edge_statistics + GetGraphStatisticsResponse: + example: + edge_type_statistics: + - type_name: type_name + type_id: 5 + vertex_type_pair_statistics: + - source_vertex: source_vertex + destination_vertex: destination_vertex + count: 2 + - source_vertex: source_vertex + destination_vertex: destination_vertex + count: 2 + - type_name: type_name + type_id: 5 + vertex_type_pair_statistics: + - source_vertex: source_vertex + destination_vertex: destination_vertex + count: 2 + - source_vertex: source_vertex + destination_vertex: destination_vertex + count: 2 + total_vertex_count: 0 + vertex_type_statistics: + - type_name: type_name + type_id: 1 + count: 5 + - type_name: type_name + type_id: 1 + count: 5 + total_edge_count: 6 + properties: + total_vertex_count: + type: integer + total_edge_count: + type: integer + vertex_type_statistics: + items: + $ref: '#/components/schemas/VertexStatistics' + type: array + edge_type_statistics: + items: + $ref: '#/components/schemas/EdgeStatistics' + type: array + required: + - total_edge_count + - total_vertex_count + type: object + x-body-name: graph_statistics_response + GetGraphResponse: + example: + creation_time: 11223444 + schema: + vertex_types: + - null + - null + edge_types: + - null + - null + stored_procedures: + - null + - null + name: name + description: description + id: id + store_type: mutable_csr + data_import_config: + loading_config: + x_csr_params: + parallelism: 0 + build_csr_in_mem: true + use_mmap_vector: true + format: + metadata: + key: "" + type: type + import_option: init + data_source: + scheme: odps + location: location + edge_mappings: + - inputs: + - inputs + - inputs + source_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + destination_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + type_triplet: + edge: edge + source_vertex: source_vertex + destination_vertex: destination_vertex + - inputs: + - inputs + - inputs + source_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + destination_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + type_triplet: + edge: edge + source_vertex: source_vertex + destination_vertex: destination_vertex + vertex_mappings: + - type_name: type_name + inputs: + - file:///path/to/person.csv + - file:///path/to/person.csv + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + - type_name: type_name + inputs: + - file:///path/to/person.csv + - file:///path/to/person.csv + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + version: version + data_update_time: 11123445 + properties: + version: + type: string + id: + type: string + name: + type: string + description: + type: string + store_type: + enum: + - mutable_csr + type: string + creation_time: + example: 11223444 + type: integer + data_update_time: + example: 11123445 + type: integer + stored_procedures: + items: + $ref: '#/components/schemas/GetProcedureResponse' + type: array + schema: + $ref: '#/components/schemas/GetGraphSchemaResponse' + data_import_config: + $ref: '#/components/schemas/SchemaMapping' + type: object + x-body-name: get_graph_response + CreateGraphSchemaRequest: + example: + vertex_types: + - null + - null + edge_types: + - null + - null + properties: + vertex_types: + items: + $ref: '#/components/schemas/CreateVertexType' + type: array + edge_types: + items: + $ref: '#/components/schemas/CreateEdgeType' + type: array + type: object + x-body-name: create_graph_schema_request + GetGraphSchemaResponse: + example: + vertex_types: + - null + - null + edge_types: + - null + - null + properties: + vertex_types: + items: + $ref: '#/components/schemas/GetVertexType' + type: array + edge_types: + items: + $ref: '#/components/schemas/GetEdgeType' + type: array + type: object + x-body-name: get_graph_schema_response + BaseVertexType: + properties: + type_name: + type: string + primary_keys: + items: + type: string + type: array + x_csr_params: + $ref: '#/components/schemas/BaseVertexType_x_csr_params' + type: object + CreateVertexType: + allOf: + - $ref: '#/components/schemas/BaseVertexType' + - properties: + properties: + items: + $ref: '#/components/schemas/CreatePropertyMeta' + type: array + type: object + x-body-name: create_vertex_type + GetVertexType: + allOf: + - $ref: '#/components/schemas/BaseVertexType' + - properties: + type_id: + format: int32 + type: integer + properties: + items: + $ref: '#/components/schemas/GetPropertyMeta' + type: array + description: + type: string + type: object + x-body-name: get_vertex_type + BaseEdgeType: + properties: + type_name: + type: string + vertex_type_pair_relations: + items: + $ref: '#/components/schemas/BaseEdgeType_vertex_type_pair_relations_inner' + type: array + type: object + CreateEdgeType: + allOf: + - $ref: '#/components/schemas/BaseEdgeType' + - properties: + properties: + items: + $ref: '#/components/schemas/CreatePropertyMeta' + type: array + type: object + x-body-name: create_edge_type + GetEdgeType: + allOf: + - $ref: '#/components/schemas/BaseEdgeType' + - properties: + type_id: + format: int32 + type: integer + description: + type: string + properties: + items: + $ref: '#/components/schemas/GetPropertyMeta' + type: array + type: object + x-body-name: get_edge_type + BasePropertyMeta: + properties: + property_name: + type: string + property_type: + $ref: '#/components/schemas/GSDataType' + type: object + CreatePropertyMeta: + allOf: + - $ref: '#/components/schemas/BasePropertyMeta' + x-body-name: create_property_meta + GetPropertyMeta: + allOf: + - $ref: '#/components/schemas/BasePropertyMeta' + - properties: + property_id: + format: int32 + type: integer + type: object + x-body-name: get_property_meta + SchemaMapping: + example: + loading_config: + x_csr_params: + parallelism: 0 + build_csr_in_mem: true + use_mmap_vector: true + format: + metadata: + key: "" + type: type + import_option: init + data_source: + scheme: odps + location: location + edge_mappings: + - inputs: + - inputs + - inputs + source_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + destination_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + type_triplet: + edge: edge + source_vertex: source_vertex + destination_vertex: destination_vertex + - inputs: + - inputs + - inputs + source_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + destination_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + type_triplet: + edge: edge + source_vertex: source_vertex + destination_vertex: destination_vertex + vertex_mappings: + - type_name: type_name + inputs: + - file:///path/to/person.csv + - file:///path/to/person.csv + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + - type_name: type_name + inputs: + - file:///path/to/person.csv + - file:///path/to/person.csv + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + properties: + loading_config: + $ref: '#/components/schemas/SchemaMapping_loading_config' + vertex_mappings: + items: + $ref: '#/components/schemas/VertexMapping' + type: array + edge_mappings: + items: + $ref: '#/components/schemas/EdgeMapping' + type: array + type: object + x-body-name: schema_mapping + VertexMapping: + example: + type_name: type_name + inputs: + - file:///path/to/person.csv + - file:///path/to/person.csv + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + properties: + type_name: + type: string + inputs: + items: + example: file:///path/to/person.csv + type: string + type: array + column_mappings: + items: + $ref: '#/components/schemas/ColumnMapping' + type: array + type: object + x-body-name: vertex_mapping + EdgeMapping: + example: + inputs: + - inputs + - inputs + source_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + destination_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + type_triplet: + edge: edge + source_vertex: source_vertex + destination_vertex: destination_vertex + properties: + type_triplet: + $ref: '#/components/schemas/EdgeMapping_type_triplet' + inputs: + items: + type: string + type: array + source_vertex_mappings: + items: + $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner' + type: array + destination_vertex_mappings: + items: + $ref: '#/components/schemas/EdgeMapping_destination_vertex_mappings_inner' + type: array + column_mappings: + items: + $ref: '#/components/schemas/ColumnMapping' + type: array + type: object + x-body-name: edge_mapping + ColumnMapping: + example: + column: + name: name + index: 6 + property: property + properties: + column: + $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner_column' + property: + description: must align with the schema + type: string + type: object + x-body-name: column_mapping + StartServiceRequest: + example: + graph_id: graph_id + properties: + graph_id: + type: string + x-body-name: start_service_request + StopServiceRequest: + additionalProperties: false + example: + graph_id: graph_id + properties: + graph_id: + nullable: true + type: string + type: object + x-body-name: stop_service_request + ServiceStatus: + example: + start_time: 5 + statistics_enabled: true + bolt_port: 0 + hqps_port: 6 + gremlin_port: 1 + graph: + creation_time: 11223444 + schema: + vertex_types: + - null + - null + edge_types: + - null + - null + stored_procedures: + - null + - null + name: name + description: description + id: id + store_type: mutable_csr + data_import_config: + loading_config: + x_csr_params: + parallelism: 0 + build_csr_in_mem: true + use_mmap_vector: true + format: + metadata: + key: "" + type: type + import_option: init + data_source: + scheme: odps + location: location + edge_mappings: + - inputs: + - inputs + - inputs + source_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + destination_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + type_triplet: + edge: edge + source_vertex: source_vertex + destination_vertex: destination_vertex + - inputs: + - inputs + - inputs + source_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + destination_vertex_mappings: + - column: + name: name + index: 6 + property: id + - column: + name: name + index: 6 + property: id + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + type_triplet: + edge: edge + source_vertex: source_vertex + destination_vertex: destination_vertex + vertex_mappings: + - type_name: type_name + inputs: + - file:///path/to/person.csv + - file:///path/to/person.csv + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + - type_name: type_name + inputs: + - file:///path/to/person.csv + - file:///path/to/person.csv + column_mappings: + - column: + name: name + index: 6 + property: property + - column: + name: name + index: 6 + property: property + version: version + data_update_time: 11123445 + status: status + properties: + statistics_enabled: + type: boolean + status: + type: string + graph: + $ref: '#/components/schemas/GetGraphResponse' + bolt_port: + format: int32 + type: integer + hqps_port: + format: int32 + type: integer + gremlin_port: + format: int32 + type: integer + start_time: + format: int32 + type: integer + type: object + x-body-name: service_status + JobResponse: + example: + job_id: job_id + properties: + job_id: + type: string + type: object + x-body-name: job_response + JobStatus: + example: + start_time: 0 + log: log + end_time: 6 + id: id + detail: + key: "" + type: type + status: RUNNING + properties: + id: + type: string + type: + type: string + status: + enum: + - RUNNING + - SUCCESS + - FAILED + - CANCELLED + - WAITING + type: string + start_time: + format: int32 + type: integer + end_time: + format: int32 + type: integer + log: + description: URL or log string + type: string + detail: + additionalProperties: true + type: object + type: object + x-body-name: job_status + UploadFileResponse: + example: + file_path: file_path + metadata: + key: "" + properties: + file_path: + type: string + metadata: + additionalProperties: true + type: object + required: + - file_path + VertexEdgeRequest: + properties: + vertex_request: + items: + $ref: '#/components/schemas/VertexRequest' + type: array + edge_request: + items: + $ref: '#/components/schemas/EdgeRequest' + type: array + required: + - edge_request + - vertex_request + type: object + delete_edge_request: + properties: + src_primary_key_values: + items: + $ref: '#/components/schemas/Property' + type: array + dst_primary_key_values: + items: + $ref: '#/components/schemas/Property' + type: array + type: object + uploadFile_request: + properties: + filestorage: + format: binary + type: string + type: object + FixedChar_char: + properties: + fixed_length: + type: integer + required: + - fixed_length + type: object + VarChar_var_char: + properties: + max_length: + type: integer + required: + - max_length + type: object + StringType_string: + oneOf: + - $ref: '#/components/schemas/LongText' + - $ref: '#/components/schemas/FixedChar' + - $ref: '#/components/schemas/VarChar' + x-one-of-name: StringTypeString + TemporalType_temporal: + oneOf: + - $ref: '#/components/schemas/TimeStampType' + - $ref: '#/components/schemas/DateType' + x-one-of-name: TemporalTypeTemporal + BaseVertexType_x_csr_params: + description: Used for storage optimization + properties: + max_vertex_num: + type: integer + type: object + BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params: + description: Used for storage optimization + properties: + edge_storage_strategy: + enum: + - ONLY_IN + - ONLY_OUT + - BOTH_OUT_IN + type: string + sort_on_compaction: + type: boolean + oe_mutability: + type: string + ie_mutability: + type: string + type: object + BaseEdgeType_vertex_type_pair_relations_inner: + properties: + source_vertex: + type: string + destination_vertex: + type: string + relation: + enum: + - MANY_TO_MANY + - ONE_TO_MANY + - MANY_TO_ONE + - ONE_TO_ONE + type: string + x_csr_params: + $ref: '#/components/schemas/BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params' + type: object + SchemaMapping_loading_config_x_csr_params: + description: mutable_csr specific parameters + example: + parallelism: 0 + build_csr_in_mem: true + use_mmap_vector: true + properties: + parallelism: + type: integer + build_csr_in_mem: + type: boolean + use_mmap_vector: + type: boolean + type: object + SchemaMapping_loading_config_data_source: + example: + scheme: odps + location: location + properties: + scheme: + enum: + - odps + - file + type: string + location: + type: string + type: object + SchemaMapping_loading_config_format: + example: + metadata: + key: "" + type: type + properties: + type: + type: string + metadata: + additionalProperties: true + type: object + type: object + SchemaMapping_loading_config: + example: + x_csr_params: + parallelism: 0 + build_csr_in_mem: true + use_mmap_vector: true + format: + metadata: + key: "" + type: type + import_option: init + data_source: + scheme: odps + location: location + properties: + x_csr_params: + $ref: '#/components/schemas/SchemaMapping_loading_config_x_csr_params' + data_source: + $ref: '#/components/schemas/SchemaMapping_loading_config_data_source' + import_option: + enum: + - init + - overwrite + type: string + format: + $ref: '#/components/schemas/SchemaMapping_loading_config_format' + type: object + EdgeMapping_type_triplet: + description: "source label -> [edge label] -> destination label" + example: + edge: edge + source_vertex: source_vertex + destination_vertex: destination_vertex + properties: + edge: + type: string + source_vertex: + type: string + destination_vertex: + type: string + type: object + EdgeMapping_source_vertex_mappings_inner_column: + example: + name: name + index: 6 + properties: + index: + format: int32 + type: integer + name: + type: string + type: object + EdgeMapping_source_vertex_mappings_inner: + description: Mapping column to the primary key of source vertex + example: + column: + name: name + index: 6 + property: id + properties: + column: + $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner_column' + property: + example: id + type: string + type: object + EdgeMapping_destination_vertex_mappings_inner: + description: Mapping column to the primary key of destination vertex + example: + column: + name: name + index: 6 + property: id + properties: + column: + $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner_column' + property: + example: id + type: string + type: object diff --git a/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java b/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..a9bd70bc0224 --- /dev/null +++ b/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package com.alibaba.graphscope.groot; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/interactive_engine/pom.xml b/interactive_engine/pom.xml index 285a919e9017..335c19c32367 100644 --- a/interactive_engine/pom.xml +++ b/interactive_engine/pom.xml @@ -80,6 +80,7 @@ groot-module groot-server groot-client + groot-http executor/engine/pegasus/clients/java/client compiler @@ -256,7 +257,7 @@ 0.4.3 no-gaia-ir - 2.5.4 + 2.7.15 @@ -713,6 +714,13 @@ ${spring-boot.version} test + + org.springframework.boot + spring-boot-starter-parent + ${spring-boot.version} + import + pom + From 90847138118dd64d5e1722e5af4cfbaf4bef4919 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Thu, 19 Dec 2024 20:00:25 +0800 Subject: [PATCH 03/23] add ddl apis in openapi Committed-by: bingqing.lbq from Dev container Committed-by: BingqingLyu from Dev container --- flex/openapi/openapi_interactive.yaml | 178 ++++++++++++++++- .../src/main/resources/openapi.yaml | 185 ++++++++++++++++++ 2 files changed, 361 insertions(+), 2 deletions(-) diff --git a/flex/openapi/openapi_interactive.yaml b/flex/openapi/openapi_interactive.yaml index 513b1043e716..a83d4890f310 100644 --- a/flex/openapi/openapi_interactive.yaml +++ b/flex/openapi/openapi_interactive.yaml @@ -155,6 +155,34 @@ paths: code: 103 message: "Internal error" /v1/graph/{graph_id}/schema: + post: + tags: + - AdminService/GraphManagement + summary: Import graph schema + operationId: import_schema + parameters: + - name: graph_id + in : path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateGraphSchemaRequest' + required: true + responses: + 200: + description: Successful imported the graph schema + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" get: tags: - AdminService/GraphManagement @@ -166,14 +194,159 @@ paths: required: true schema: type: string - description: The id of graph to delete + description: The id of graph to get schema responses: - '200': + 200: description: successful operation content: application/json: schema: $ref: '#/components/schemas/GetGraphSchemaResponse' + 500: + $ref: "#/components/responses/500" + delete: + tags: + - AdminService/GraphManagement + description: Delete schema by graph id + operationId: delete_schema + parameters: + - name: graph_id + in : path + required: true + schema: + type: string + description: The id of graph to delete + responses: + 200: + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + /v1/graph/{graph_id}/schema/vertex: + post: + tags: + - AdminService/GraphManagement + description: Create a vertex type + operationId: createVertexType + parameters: + - name: graph_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateVertexType' + required: true + responses: + 200: + description: Successful created a vertex type + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" + + /v1/graph/{graph_id}/schema/vertex/{type_name}: + delete: + tags: + - AdminService/GraphManagement + description: Delete vertex type by name + operationId: deleteVertexTypeByName + parameters: + - name: graph_id + in: path + required: true + schema: + type: string + - name: type_name + in: path + required: true + schema: + type: string + responses: + 200: + description: Successful deleted the vertex type + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /v1/graph/{graph_id}/schema/edge: + post: + tags: + - AdminService/GraphManagement + description: Create a edge type + operationId: createEdgeType + parameters: + - name: graph_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEdgeType' + responses: + 200: + description: Successful created the edge type + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" + + /v1/graph/{graph_id}/schema/edge/{type_name}: + delete: + tags: + - AdminService/GraphManagement + description: Delete edge type by name + operationId: deleteEdgeTypeByName + parameters: + - name: graph_id + in: path + required: true + schema: + type: string + - name: type_name + in: path + required: true + schema: + type: string + - name: source_vertex_type + in: query + required: true + schema: + type: string + - name: destination_vertex_type + in: query + required: true + schema: + type: string + responses: + 200: + description: Successful deleted the edge type + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" /v1/graph/{graph_id}/statistics: get: tags: @@ -1306,6 +1479,7 @@ paths: example: code: 103 message: "Internal error" + components: schemas: AnyValue: {} diff --git a/interactive_engine/groot-http/src/main/resources/openapi.yaml b/interactive_engine/groot-http/src/main/resources/openapi.yaml index d665f130aa30..3089c7c5c27f 100644 --- a/interactive_engine/groot-http/src/main/resources/openapi.yaml +++ b/interactive_engine/groot-http/src/main/resources/openapi.yaml @@ -40,6 +40,8 @@ tags: name: GraphService/EdgeManagement - description: Graph query name: QueryService +- description: SchemaManagement + name: GraphService/SchemaManagement paths: /v1/graph: get: @@ -193,6 +195,40 @@ paths: x-accepts: application/json x-tags: - tag: AdminService/GraphManagement + post: + operationId: import_schema + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateGraphSchemaRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful imported the graph schema + "400": + $ref: '#/components/responses/400' + "500": + $ref: '#/components/responses/500' + summary: Import graph schema + tags: + - GraphService/SchemaManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: GraphService/SchemaManagement /v1/graph/{graph_id}/statistics: get: description: "Get the statics info of a graph, including number of vertices\ @@ -1471,6 +1507,155 @@ paths: x-accepts: application/json x-tags: - tag: Utils + /v1/graph/{graph_id}/schema/vertex: + post: + description: Create a vertex type + operationId: createVertexType + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateVertexType' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful created a vertex type + "400": + $ref: '#/components/responses/400' + "500": + $ref: '#/components/responses/500' + tags: + - GraphService/SchemaManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: GraphService/SchemaManagement + /api/v1/graph/{graph_id}/schema/vertex/{type_name}: + delete: + description: Delete vertex type by name + operationId: deleteVertexTypeByName + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: type_name + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful deleted the vertex type + "500": + $ref: '#/components/responses/500' + tags: + - GraphService/SchemaManagement + x-accepts: application/json + x-tags: + - tag: GraphService/SchemaManagement + /api/v1/graph/{graph_id}/schema/edge: + post: + description: Create a edge type + operationId: createEdgeType + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEdgeType' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful created the edge type + "400": + $ref: '#/components/responses/400' + "500": + $ref: '#/components/responses/500' + tags: + - GraphService/SchemaManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: GraphService/SchemaManagement + /api/v1/graph/{graph_id}/schema/edge/{type_name}: + delete: + description: Delete edge type by name + operationId: deleteEdgeTypeByName + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: type_name + required: true + schema: + type: string + style: simple + - explode: true + in: query + name: source_vertex_type + required: true + schema: + type: string + style: form + - explode: true + in: query + name: destination_vertex_type + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful deleted the edge type + "500": + $ref: '#/components/responses/500' + tags: + - GraphService/SchemaManagement + x-accepts: application/json + x-tags: + - tag: GraphService/SchemaManagement components: schemas: AnyValue: {} From 6ec0e20e1b26e0702f746a224076dadee0932290 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Mon, 23 Dec 2024 20:22:30 +0800 Subject: [PATCH 04/23] wip: implementation of ddl apis Committed-by: bingqing.lbq from Dev container Committed-by: BingqingLyu from Dev container --- .../groot-http/.openapi-generator-ignore | 4 +- .../groot-http/.openapi-generator/FILES | 1 - .../graphscope/groot/service/api/ApiUtil.java | 16 + .../graphscope/groot/service/api/V1Api.java | 287 ++++++++++++++- .../groot/service/impl/DtoConverter.java | 129 +++++++ .../groot/service/impl/GrootController.java | 182 +++++++--- .../service/impl/SchemaManagementService.java | 128 +++++++ .../service/models/APIResponseWithCode.java | 2 +- .../groot/service/models/BaseEdgeType.java | 2 +- ...eEdgeTypeVertexTypePairRelationsInner.java | 2 +- ...ertexTypePairRelationsInnerXCsrParams.java | 2 +- .../service/models/BasePropertyMeta.java | 2 +- .../groot/service/models/BaseVertexType.java | 2 +- .../models/BaseVertexTypeXCsrParams.java | 2 +- .../groot/service/models/ColumnMapping.java | 2 +- .../groot/service/models/CreateEdgeType.java | 2 +- .../service/models/CreateGraphRequest.java | 2 +- .../service/models/CreateGraphResponse.java | 2 +- .../models/CreateGraphSchemaRequest.java | 2 +- .../models/CreateProcedureRequest.java | 2 +- .../models/CreateProcedureResponse.java | 2 +- .../service/models/CreatePropertyMeta.java | 2 +- .../service/models/CreateVertexType.java | 2 +- .../groot/service/models/DateType.java | 2 +- .../service/models/DeleteEdgeRequest.java | 2 +- .../groot/service/models/EdgeData.java | 2 +- .../groot/service/models/EdgeMapping.java | 2 +- ...MappingDestinationVertexMappingsInner.java | 2 +- .../EdgeMappingSourceVertexMappingsInner.java | 2 +- ...appingSourceVertexMappingsInnerColumn.java | 2 +- .../models/EdgeMappingTypeTriplet.java | 2 +- .../groot/service/models/EdgeRequest.java | 2 +- .../groot/service/models/EdgeStatistics.java | 2 +- .../groot/service/models/FixedChar.java | 2 +- .../groot/service/models/FixedCharChar.java | 2 +- .../groot/service/models/GSDataType.java | 10 +- .../groot/service/models/GetEdgeType.java | 2 +- .../service/models/GetGraphResponse.java | 2 +- .../models/GetGraphSchemaResponse.java | 2 +- .../models/GetGraphStatisticsResponse.java | 2 +- .../service/models/GetProcedureResponse.java | 2 +- .../groot/service/models/GetPropertyMeta.java | 2 +- .../groot/service/models/GetVertexType.java | 2 +- .../groot/service/models/JobResponse.java | 2 +- .../groot/service/models/JobStatus.java | 2 +- .../groot/service/models/LongText.java | 2 +- .../groot/service/models/Parameter.java | 2 +- .../groot/service/models/PrimitiveType.java | 2 +- .../groot/service/models/Property.java | 2 +- .../groot/service/models/QueryRequest.java | 2 +- .../groot/service/models/SchemaMapping.java | 2 +- .../models/SchemaMappingLoadingConfig.java | 2 +- .../SchemaMappingLoadingConfigDataSource.java | 2 +- .../SchemaMappingLoadingConfigFormat.java | 2 +- .../SchemaMappingLoadingConfigXCsrParams.java | 2 +- .../groot/service/models/ServiceStatus.java | 2 +- .../service/models/StartServiceRequest.java | 2 +- .../service/models/StopServiceRequest.java | 2 +- .../service/models/StoredProcedureMeta.java | 2 +- .../groot/service/models/StringType.java | 2 +- .../service/models/StringTypeString.java | 2 +- .../groot/service/models/TemporalType.java | 2 +- .../service/models/TemporalTypeTemporal.java | 2 +- .../groot/service/models/TimeStampType.java | 2 +- .../groot/service/models/TypedValue.java | 2 +- .../models/UpdateProcedureRequest.java | 2 +- .../service/models/UploadFileResponse.java | 2 +- .../groot/service/models/VarChar.java | 2 +- .../groot/service/models/VarCharVarChar.java | 2 +- .../groot/service/models/VertexData.java | 2 +- .../service/models/VertexEdgeRequest.java | 2 +- .../groot/service/models/VertexMapping.java | 2 +- .../groot/service/models/VertexRequest.java | 2 +- .../service/models/VertexStatistics.java | 2 +- .../models/VertexTypePairStatistics.java | 2 +- .../src/main/resources/openapi.yaml | 334 ++++++++++-------- 76 files changed, 941 insertions(+), 284 deletions(-) create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java diff --git a/interactive_engine/groot-http/.openapi-generator-ignore b/interactive_engine/groot-http/.openapi-generator-ignore index 0d2353b94de5..d14fc080a342 100644 --- a/interactive_engine/groot-http/.openapi-generator-ignore +++ b/interactive_engine/groot-http/.openapi-generator-ignore @@ -23,4 +23,6 @@ #!docs/README.md pom.xml -src/main/java/com/alibaba/graphscope/groot/service/impl \ No newline at end of file +src/main/java/com/alibaba/graphscope/groot/service/impl +src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java +src/main/java/com/alibaba/graphscope/groot/service/models/GsDataType.java \ No newline at end of file diff --git a/interactive_engine/groot-http/.openapi-generator/FILES b/interactive_engine/groot-http/.openapi-generator/FILES index e97965899cf7..504d5620329f 100644 --- a/interactive_engine/groot-http/.openapi-generator/FILES +++ b/interactive_engine/groot-http/.openapi-generator/FILES @@ -1,7 +1,6 @@ README.md src/main/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplication.java src/main/java/com/alibaba/graphscope/groot/RFC3339DateFormat.java -src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java index 620875a12ddd..564485d8ba2d 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java @@ -1,5 +1,7 @@ package com.alibaba.graphscope.groot.service.api; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; import org.springframework.web.context.request.NativeWebRequest; import javax.servlet.http.HttpServletResponse; @@ -16,4 +18,18 @@ public static void setExampleResponse(NativeWebRequest req, String contentType, throw new RuntimeException(e); } } + + public static ResponseEntity createErrorResponse(HttpStatus status, String message) { + return ResponseEntity.status(status).body(String.format("{\"error\": \"%s\"}", message)); + } + + public static ResponseEntity createSuccessResponse(String message, long snapshotId) { + return ResponseEntity.status(HttpStatus.OK) + .body(String.format("{\"message\": \"%s\", \"snapshot id\": %d}", message, snapshotId)); + } + + public static ResponseEntity createSuccessResponse(String message) { + return ResponseEntity.status(HttpStatus.OK).body(String.format("{\"message\": \"%s\"}", message)); + } + } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java index 6740cf2d3ceb..370b25579be4 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java @@ -6,10 +6,13 @@ package com.alibaba.graphscope.groot.service.api; import com.alibaba.graphscope.groot.service.models.APIResponseWithCode; +import com.alibaba.graphscope.groot.service.models.CreateEdgeType; import com.alibaba.graphscope.groot.service.models.CreateGraphRequest; import com.alibaba.graphscope.groot.service.models.CreateGraphResponse; +import com.alibaba.graphscope.groot.service.models.CreateGraphSchemaRequest; import com.alibaba.graphscope.groot.service.models.CreateProcedureRequest; import com.alibaba.graphscope.groot.service.models.CreateProcedureResponse; +import com.alibaba.graphscope.groot.service.models.CreateVertexType; import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; import com.alibaba.graphscope.groot.service.models.EdgeData; import com.alibaba.graphscope.groot.service.models.EdgeRequest; @@ -54,7 +57,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") @Validated @Tag(name = "GraphService/EdgeManagement", description = "EdgeManagement") public interface V1Api { @@ -302,6 +305,53 @@ default ResponseEntity createDataloadingJob( } + /** + * POST /v1/graph/{graph_id}/schema/edge + * Create a edge type + * + * @param graphId (required) + * @param createEdgeType (optional) + * @return Successful created the edge type (status code 200) + * or (status code 400) + * or (status code 500) + */ + @Operation( + operationId = "createEdgeType", + description = "Create a edge type", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful created the edge type", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = ""), + @ApiResponse(responseCode = "500", description = "") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph/{graph_id}/schema/edge", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity createEdgeType( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "CreateEdgeType", description = "") @Valid @RequestBody(required = false) CreateEdgeType createEdgeType + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * POST /v1/graph * Create a new graph @@ -406,6 +456,53 @@ default ResponseEntity createProcedure( } + /** + * POST /v1/graph/{graph_id}/schema/vertex + * Create a vertex type + * + * @param graphId (required) + * @param createVertexType (required) + * @return Successful created a vertex type (status code 200) + * or (status code 400) + * or (status code 500) + */ + @Operation( + operationId = "createVertexType", + description = "Create a vertex type", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful created a vertex type", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = ""), + @ApiResponse(responseCode = "500", description = "") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph/{graph_id}/schema/vertex", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity createVertexType( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "CreateVertexType", description = "", required = true) @Valid @RequestBody CreateVertexType createVertexType + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * DELETE /v1/graph/{graph_id}/edge : Remove edge from the graph * Remove the edge from current graph. @@ -468,6 +565,54 @@ default ResponseEntity deleteEdge( } + /** + * DELETE /v1/graph/{graph_id}/schema/edge/{type_name} + * Delete edge type by name + * + * @param graphId (required) + * @param typeName (required) + * @param sourceVertexType (required) + * @param destinationVertexType (required) + * @return Successful deleted the edge type (status code 200) + * or (status code 500) + */ + @Operation( + operationId = "deleteEdgeTypeByName", + description = "Delete edge type by name", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful deleted the edge type", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "500", description = "") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/v1/graph/{graph_id}/schema/edge/{type_name}", + produces = { "application/json" } + ) + + default ResponseEntity deleteEdgeTypeByName( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "type_name", description = "", required = true, in = ParameterIn.PATH) @PathVariable("type_name") String typeName, + @NotNull @Parameter(name = "source_vertex_type", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "source_vertex_type", required = true) String sourceVertexType, + @NotNull @Parameter(name = "destination_vertex_type", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "destination_vertex_type", required = true) String destinationVertexType + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * DELETE /v1/graph/{graph_id} * Delete a graph by id @@ -600,6 +745,48 @@ default ResponseEntity deleteProcedure( } + /** + * DELETE /v1/graph/{graph_id}/schema + * Delete schema by graph id + * + * @param graphId The id of graph to delete (required) + * @return successful operation (status code 200) + * or (status code 500) + */ + @Operation( + operationId = "deleteSchema", + description = "Delete schema by graph id", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "500", description = "") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/v1/graph/{graph_id}/schema", + produces = { "application/json" } + ) + + default ResponseEntity deleteSchema( + @Parameter(name = "graph_id", description = "The id of graph to delete", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * DELETE /v1/graph/{graph_id}/vertex : Remove vertex from the graph * Remove the vertex from the specified graph. @@ -658,6 +845,50 @@ default ResponseEntity deleteVertex( } + /** + * DELETE /v1/graph/{graph_id}/schema/vertex/{type_name} + * Delete vertex type by name + * + * @param graphId (required) + * @param typeName (required) + * @return Successful deleted the vertex type (status code 200) + * or (status code 500) + */ + @Operation( + operationId = "deleteVertexTypeByName", + description = "Delete vertex type by name", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful deleted the vertex type", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "500", description = "") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/v1/graph/{graph_id}/schema/vertex/{type_name}", + produces = { "application/json" } + ) + + default ResponseEntity deleteVertexTypeByName( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "type_name", description = "", required = true, in = ParameterIn.PATH) @PathVariable("type_name") String typeName + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * GET /v1/graph/{graph_id}/edge : Get the edge's properties with src and dst vertex primary keys. * Get the properties for the specified vertex. @@ -905,8 +1136,9 @@ default ResponseEntity getProcedure( * GET /v1/graph/{graph_id}/schema * Get schema by graph id * - * @param graphId The id of graph to delete (required) + * @param graphId The id of graph to get schema (required) * @return successful operation (status code 200) + * or (status code 500) */ @Operation( operationId = "getSchema", @@ -915,7 +1147,8 @@ default ResponseEntity getProcedure( responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = GetGraphSchemaResponse.class)) - }) + }), + @ApiResponse(responseCode = "500", description = "") } ) @RequestMapping( @@ -925,7 +1158,7 @@ default ResponseEntity getProcedure( ) default ResponseEntity getSchema( - @Parameter(name = "graph_id", description = "The id of graph to delete", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId + @Parameter(name = "graph_id", description = "The id of graph to get schema", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -1031,6 +1264,52 @@ default ResponseEntity getVertex( } + /** + * POST /v1/graph/{graph_id}/schema : Import graph schema + * + * @param graphId (required) + * @param createGraphSchemaRequest (required) + * @return Successful imported the graph schema (status code 200) + * or (status code 400) + * or (status code 500) + */ + @Operation( + operationId = "importSchema", + summary = "Import graph schema", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful imported the graph schema", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = ""), + @ApiResponse(responseCode = "500", description = "") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/v1/graph/{graph_id}/schema", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity importSchema( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "CreateGraphSchemaRequest", description = "", required = true) @Valid @RequestBody CreateGraphSchemaRequest createGraphSchemaRequest + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * GET /v1/graph * List all graphs diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java index 08874423fdba..cd60d1c6220f 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java @@ -1,5 +1,6 @@ package com.alibaba.graphscope.groot.service.impl; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -7,10 +8,28 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.alibaba.graphscope.groot.sdk.schema.Edge; +import com.alibaba.graphscope.groot.sdk.schema.EdgeLabel; +import com.alibaba.graphscope.groot.sdk.schema.EdgeLabel.EdgeRelation; +import com.alibaba.graphscope.groot.sdk.schema.Schema; import com.alibaba.graphscope.groot.sdk.schema.Vertex; +import com.alibaba.graphscope.groot.sdk.schema.VertexLabel; import com.alibaba.graphscope.groot.service.models.EdgeRequest; +import com.alibaba.graphscope.groot.service.models.GSDataType; +import com.alibaba.graphscope.groot.service.models.GetEdgeType; +import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; +import com.alibaba.graphscope.groot.service.models.GetPropertyMeta; +import com.alibaba.graphscope.groot.service.models.GetVertexType; +import com.alibaba.graphscope.groot.service.models.PrimitiveType; import com.alibaba.graphscope.groot.service.models.Property; +import com.alibaba.graphscope.groot.service.models.StringType; +import com.alibaba.graphscope.groot.service.models.TemporalType; +import com.alibaba.graphscope.groot.service.models.TemporalTypeTemporal; +import com.alibaba.graphscope.groot.service.models.TimeStampType; import com.alibaba.graphscope.groot.service.models.VertexRequest; +import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; +import com.alibaba.graphscope.groot.service.models.DateType; +import com.alibaba.graphscope.proto.groot.DataTypePb; +import com.alibaba.graphscope.proto.groot.GraphDefPb; public class DtoConverter { public static Vertex convertToVertex(VertexRequest vertexRequest) { @@ -43,6 +62,71 @@ public static Edge convertToEdge(String edgeLabel, String srcLabel, String dstLa return new Edge(edgeLabel, srcLabel, dstLabel, srcPkMap, dstPkMap); } + public static DataTypePb convertToDataTypePb(GSDataType dataType) { + if (dataType instanceof PrimitiveType) { + PrimitiveType primitiveType = (PrimitiveType) dataType; + switch (primitiveType.getPrimitiveType()) { + case SIGNED_INT32: + return DataTypePb.INT; + case UNSIGNED_INT32: + return DataTypePb.UINT; + case SIGNED_INT64: + return DataTypePb.LONG; + case UNSIGNED_INT64: + return DataTypePb.ULONG; + case BOOL: + return DataTypePb.BOOL; + case FLOAT: + return DataTypePb.FLOAT; + case DOUBLE: + return DataTypePb.DOUBLE; + case STRING: + return DataTypePb.STRING; + default: + throw new IllegalArgumentException("Unsupported primitive type: " + primitiveType); + } + } else if (dataType instanceof StringType) { + return DataTypePb.STRING; + } else if (dataType instanceof TemporalType) { + TemporalType temporalType = (TemporalType) dataType; + TemporalTypeTemporal temporal = temporalType.getTemporal(); + if (temporal instanceof DateType) { + // TODO: confirm the date type + return DataTypePb.DATE32; + } else if (temporal instanceof TimeStampType) { + // TODO: confirm the timestamp type + return DataTypePb.TIMESTAMP_S; + } else { + throw new IllegalArgumentException("Unsupported temporal type: " + temporalType); + } + } + throw new IllegalArgumentException("Unsupported data type: " + dataType); + } + + public static GetVertexType convertToDtoVertexType(VertexLabel vertexLabel) { + GetVertexType vertexType = new GetVertexType(); + vertexType.setTypeName(vertexLabel.getLabel()); + vertexType.setTypeId(vertexLabel.getId()); + vertexType.setProperties(convertToDtoProperties(vertexLabel.getProperties())); + // TODO: groot does not differentiate primary key and non-primary key properties + // vertexType.setPrimaryKeys(xxx); + return vertexType; + } + + public static GetEdgeType convertToDtoEdgeType(EdgeLabel edgeLabel) { + GetEdgeType edgeType = new GetEdgeType(); + edgeType.setTypeName(edgeLabel.getLabel()); + edgeType.setTypeId(edgeLabel.getId()); + edgeType.setProperties(convertToDtoProperties(edgeLabel.getProperties())); + for (EdgeRelation edgeRelation : edgeLabel.getRelations()) { + BaseEdgeTypeVertexTypePairRelationsInner pair = new BaseEdgeTypeVertexTypePairRelationsInner(); + pair.setSourceVertex(edgeRelation.getSrcLabel()); + pair.setDestinationVertex(edgeRelation.getDstLabel()); + edgeType.addVertexTypePairRelationsItem(pair); + } + return edgeType; + } + private static Map convertToPropertyMap(List properties) { Map propertyMap = new HashMap<>(); for (Property property : properties) { @@ -52,6 +136,51 @@ private static Map convertToPropertyMap(List propertie return propertyMap; } + private static List convertToDtoProperties( + List properties) { + List propertyMetas = new ArrayList<>(); + for (com.alibaba.graphscope.groot.sdk.schema.Property property : properties) { + GetPropertyMeta propertyMeta = new GetPropertyMeta(); + propertyMeta.setPropertyName(property.getName()); + propertyMeta.setPropertyId(property.getId()); + propertyMeta.setPropertyType(convertToDtoDataType(property.getDataType())); + propertyMetas.add(propertyMeta); + } + return propertyMetas; + } + + private static GSDataType convertToDtoDataType(DataTypePb dataType) { + switch (dataType) { + case INT: + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.SIGNED_INT32); + case UINT: + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.UNSIGNED_INT32); + case LONG: + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.SIGNED_INT64); + case ULONG: + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.UNSIGNED_INT64); + case BOOL: + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.BOOL); + case FLOAT: + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.FLOAT); + case DOUBLE: + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.DOUBLE); + case STRING: + // TODO: confirm the string type + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.STRING); + case DATE32: + // TODO: confirm the date type + TemporalTypeTemporal date = new DateType("YYYY-MM-DD".toString()); + return new TemporalType(date); + case TIMESTAMP_S: + // TODO: confirm the timestamp type + TemporalTypeTemporal timestamp = new TimeStampType("YYYY-MM-DD HH:MM:SS".toString()); + return new TemporalType(timestamp); + default: + throw new IllegalArgumentException("Unsupported data type: " + dataType); + } + } + private static String extractValue(JsonNullable jsonNullable) { return jsonNullable.isPresent() ? jsonNullable.get().toString() : null; } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java index cb7b3749a36d..814bf4c524fb 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java @@ -1,28 +1,12 @@ package com.alibaba.graphscope.groot.service.impl; -import com.alibaba.graphscope.groot.service.models.APIResponseWithCode; -import com.alibaba.graphscope.groot.service.models.CreateGraphRequest; -import com.alibaba.graphscope.groot.service.models.CreateGraphResponse; -import com.alibaba.graphscope.groot.service.models.CreateProcedureRequest; -import com.alibaba.graphscope.groot.service.models.CreateProcedureResponse; +import com.alibaba.graphscope.groot.service.models.CreateEdgeType; +import com.alibaba.graphscope.groot.service.models.CreateGraphSchemaRequest; +import com.alibaba.graphscope.groot.service.models.CreateVertexType; import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; -import com.alibaba.graphscope.groot.service.models.EdgeData; import com.alibaba.graphscope.groot.service.models.EdgeRequest; -import com.alibaba.graphscope.groot.service.models.GetGraphResponse; import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; -import com.alibaba.graphscope.groot.service.models.GetGraphStatisticsResponse; -import com.alibaba.graphscope.groot.service.models.GetProcedureResponse; -import com.alibaba.graphscope.groot.service.models.JobResponse; -import com.alibaba.graphscope.groot.service.models.JobStatus; import com.alibaba.graphscope.groot.service.models.Property; -import com.alibaba.graphscope.groot.service.models.SchemaMapping; -import com.alibaba.graphscope.groot.service.models.ServiceStatus; -import com.alibaba.graphscope.groot.service.models.StartServiceRequest; -import com.alibaba.graphscope.groot.service.models.StopServiceRequest; -import com.alibaba.graphscope.groot.service.models.UpdateProcedureRequest; -import com.alibaba.graphscope.groot.service.models.UploadFileResponse; -import com.alibaba.graphscope.groot.service.models.VertexData; -import com.alibaba.graphscope.groot.service.models.VertexEdgeRequest; import com.alibaba.graphscope.groot.service.models.VertexRequest; import io.swagger.v3.oas.annotations.Parameter; @@ -31,19 +15,10 @@ import com.alibaba.graphscope.groot.service.api.ApiUtil; import com.alibaba.graphscope.groot.service.api.V1Api; -import org.apache.tinkerpop.gremlin.driver.Cluster; -import org.apache.tinkerpop.gremlin.util.Gremlin; -import org.checkerframework.checker.units.qual.g; - -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import javax.validation.Valid; -import org.apache.tinkerpop.gremlin.driver.Client; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -58,23 +33,21 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.bind.annotation.RestController; -import com.alibaba.graphscope.groot.sdk.GrootClient; -import com.alibaba.graphscope.groot.sdk.schema.Vertex; - @RestController @RequestMapping("${openapi.graphScopeInteractiveAPIV03.base-path:/v1/graph}") public class GrootController implements V1Api { private final VertexManagementService vertexManagementService; private final EdgeManagementService edgeManagementService; + private final SchemaManagementService schemaManagementService; @Autowired - public GrootController(VertexManagementService vertexService, EdgeManagementService edgeService) { + public GrootController(VertexManagementService vertexService, EdgeManagementService edgeService, SchemaManagementService schemaManagementService) { this.vertexManagementService = vertexService; this.edgeManagementService = edgeService; + this.schemaManagementService = schemaManagementService; } @Override @@ -84,30 +57,28 @@ public ResponseEntity addVertex( @RequestBody @Validated List vertexRequests) { try { if (vertexRequests.isEmpty()) { - return ResponseEntity.status(400).body("{\"error\": \"Vertex request must not be empty\"}"); + return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Vertex request must not be empty"); } long si = vertexManagementService.addVertices(vertexRequests); - return ResponseEntity.status(200) - .body("{\"message\": \"Vertex added successfully\", \"snapshot id\": " + si + "}"); + return ApiUtil.createSuccessResponse("Vertex added successfully", si); } catch (Exception e) { e.printStackTrace(); - return ResponseEntity.status(500).body("{\"error\": \"Failed to add vertex\"}"); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertex"); } } @Override - @DeleteMapping(value = "/{graph_id}/vertex", produces =MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @DeleteMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity deleteVertex( @PathVariable("graph_id") String graphId, @RequestParam(value = "label", required = true) String label, @RequestBody(required = true) List primaryKeyValues) { try { long si = vertexManagementService.deleteVertex(label, primaryKeyValues); - return ResponseEntity.status(200) - .body("{\"message\": \"Vertex deleted successfully\", \"snapshot id\": " + si + "}"); + return ApiUtil.createSuccessResponse("Vertex deleted successfully", si); } catch (Exception e) { e.printStackTrace(); - return ResponseEntity.status(500).body("{\"error\": \"Failed to delete vertex\"}"); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex"); } } @@ -118,13 +89,13 @@ public ResponseEntity updateVertex( @RequestBody(required = false) VertexRequest vertexRequest) { try { if (vertexRequest == null) { - return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("{\"error\": \"Request body must not be null\"}"); + return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Request body must not be null"); } long si = vertexManagementService.updateVertex(vertexRequest); - return ResponseEntity.status(HttpStatus.OK).body("{\"message\": \"Vertex updated successfully\", \"snapshot id\": " + si + "}"); + return ApiUtil.createSuccessResponse("Vertex updated successfully", si); } catch (Exception e) { e.printStackTrace(); - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("{\"error\": \"Failed to update vertex\"}"); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex"); } } @@ -135,15 +106,13 @@ public ResponseEntity addEdge( @RequestBody @Validated List edgeRequests) { try { if (edgeRequests.isEmpty()) { - return ResponseEntity.status(400).body("{\"error\": \"Edge request must not be empty\"}"); + return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Edge request must not be empty"); } - System.out.println("edgeRequests: " + edgeRequests); long si = edgeManagementService.addEdges(edgeRequests); - return ResponseEntity.status(200) - .body("{\"message\": \"Edge added successfully\", \"snapshot id\": " + si + "}"); + return ApiUtil.createSuccessResponse("Edge added successfully", si); } catch (Exception e) { e.printStackTrace(); - return ResponseEntity.status(500).body("{\"error\": \"Failed to add edge\"}"); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add edge"); } } @@ -156,12 +125,12 @@ public ResponseEntity deleteEdge( @RequestParam(value = "dst_label", required = true) String dstLabel, @RequestBody(required = true) DeleteEdgeRequest deleteEdgeRequest) { try { - long si = edgeManagementService.deleteEdge(label, srcLabel, dstLabel, deleteEdgeRequest.getSrcPrimaryKeyValues(), deleteEdgeRequest.getDstPrimaryKeyValues()); - return ResponseEntity.status(200) - .body("{\"message\": \"Edge deleted successfully\", \"snapshot id\": " + si + "}"); + long si = edgeManagementService.deleteEdge(label, srcLabel, dstLabel, + deleteEdgeRequest.getSrcPrimaryKeyValues(), deleteEdgeRequest.getDstPrimaryKeyValues()); + return ApiUtil.createSuccessResponse("Edge deleted successfully", si); } catch (Exception e) { e.printStackTrace(); - return ResponseEntity.status(500).body("{\"error\": \"Failed to delete edge\"}"); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge"); } } @@ -172,15 +141,116 @@ public ResponseEntity updateEdge( @RequestBody(required = false) EdgeRequest edgeRequest) { try { if (edgeRequest == null) { - return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("{\"error\": \"Request body must not be null\"}"); + return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Request body must not be null"); } long si = edgeManagementService.updateEdge(edgeRequest); - return ResponseEntity.status(HttpStatus.OK).body("{\"message\": \"Edge updated successfully\", \"snapshot id\": " + si + "}"); + return ApiUtil.createSuccessResponse("Edge updated successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge"); + } + } + + @Override + @PostMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity createVertexType( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated CreateVertexType createVertexType) { + try { + System.out.println("createVertexType: " + createVertexType); + schemaManagementService.createVertexType(graphId, createVertexType); + return ApiUtil.createSuccessResponse("Vertex type created successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create vertex type"); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteVertexTypeByName( + @PathVariable("graph_id") String graphId, + @RequestParam(value = "type_name", required = true) String typeName) { + try { + schemaManagementService.deleteVertexType(graphId, typeName); + return ApiUtil.createSuccessResponse("Vertex type deleted successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex type"); + } + } + + @Override + @PostMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity createEdgeType( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated CreateEdgeType createEdgeType) { + try { + schemaManagementService.createEdgeType(graphId, createEdgeType); + return ApiUtil.createSuccessResponse("Edge type created successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create edge type"); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteEdgeTypeByName( + @PathVariable("graph_id") String graphId, + @RequestParam(value = "type_name", required = true) String typeName, + @RequestParam(value = "source_vertex_type", required = true) String sourceVertexType, + @RequestParam(value = "destination_vertex_type", required = true) String destinationVertexType) { + try { + schemaManagementService.deleteEdgeType(graphId, typeName, sourceVertexType, destinationVertexType); + return ApiUtil.createSuccessResponse("Edge type deleted successfully"); } catch (Exception e) { e.printStackTrace(); - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("{\"error\": \"Failed to update edge\"}"); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge type"); } } + @Override + @PostMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity importSchema( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated CreateGraphSchemaRequest createGraphSchemaRequest) { + try { + schemaManagementService.importSchema(graphId, createGraphSchemaRequest); + return ApiUtil.createSuccessResponse("Schema imported successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to import schema"); + } + } + + + @Override + @GetMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity getSchema( + @PathVariable("graph_id") String graphId) { + try { + GetGraphSchemaResponse response = schemaManagementService.getSchema(graphId); + return ResponseEntity.status(HttpStatus.OK).body(response); + } catch (Exception e) { + e.printStackTrace(); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteSchema( + @PathVariable("graph_id") String graphId) { + try { + schemaManagementService.dropSchema(graphId); + return ApiUtil.createSuccessResponse("Schema deleted successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete schema"); + } + } + + } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java new file mode 100644 index 000000000000..42cb3bbc60c0 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java @@ -0,0 +1,128 @@ +package com.alibaba.graphscope.groot.service.impl; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.crypto.Data; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.alibaba.graphscope.groot.sdk.GrootClient; +import com.alibaba.graphscope.groot.sdk.schema.EdgeLabel; +import com.alibaba.graphscope.groot.sdk.schema.Property; +import com.alibaba.graphscope.groot.sdk.schema.Schema; +import com.alibaba.graphscope.groot.sdk.schema.VertexLabel; +import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; +import com.alibaba.graphscope.groot.service.models.CreateEdgeType; +import com.alibaba.graphscope.groot.service.models.CreateGraphSchemaRequest; +import com.alibaba.graphscope.groot.service.models.CreatePropertyMeta; +import com.alibaba.graphscope.groot.service.models.CreateVertexType; +import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; +import com.alibaba.graphscope.proto.GraphDefPb; +import com.alibaba.graphscope.proto.groot.DataTypePb; + + +@Service +public class SchemaManagementService { + private final GrootClient grootClient; + + @Autowired + public SchemaManagementService(GrootClient grootClient) { + this.grootClient = grootClient; + } + + public void createVertexType(String graphId, CreateVertexType createVertexType) { + VertexLabel vLabelBuilder = createVertexLabel(graphId, createVertexType); + System.out.println("vLabelBuilder: "); + System.out.println(vLabelBuilder); + Schema.Builder schema = Schema.newBuilder(); + schema.addVertexLabel(vLabelBuilder); + GraphDefPb res = grootClient.submitSchema(schema); + System.out.println("res: " + res); + } + + public void deleteVertexType(String graphId, String vertexType) { + VertexLabel.Builder vLabelBuilder = VertexLabel.newBuilder(); + vLabelBuilder.setLabel(vertexType); + Schema.Builder schema = Schema.newBuilder(); + schema.dropVertexLabel(vLabelBuilder); + grootClient.submitSchema(schema); + } + + public void createEdgeType(String graphId, CreateEdgeType createEdgeType) { + EdgeLabel eLabelBuilder = createEdgeLabel(graphId, createEdgeType); + Schema.Builder schema = Schema.newBuilder(); + schema.addEdgeLabel(eLabelBuilder); + grootClient.submitSchema(schema); + } + + public void deleteEdgeType(String graphId, String edgeType, String srcVertexType, String dstVertexType) { + EdgeLabel.Builder eLabelBuilder = EdgeLabel.newBuilder(); + eLabelBuilder.setLabel(edgeType); + eLabelBuilder.addRelation(srcVertexType, dstVertexType); + Schema.Builder schema = Schema.newBuilder(); + schema.dropEdgeLabelOrKind(eLabelBuilder); + grootClient.submitSchema(schema); + } + + public void importSchema(String graphId, CreateGraphSchemaRequest schema) { + Schema.Builder grootSchema = Schema.newBuilder(); + for (CreateVertexType vertexType : schema.getVertexTypes()) { + VertexLabel vLabelBuilder = createVertexLabel(graphId, vertexType); + grootSchema.addVertexLabel(vLabelBuilder); + } + for (CreateEdgeType edgeType : schema.getEdgeTypes()) { + EdgeLabel eLabelBuilder = createEdgeLabel(graphId, edgeType); + grootSchema.addEdgeLabel(eLabelBuilder); + } + grootClient.submitSchema(grootSchema); + } + + public GetGraphSchemaResponse getSchema(String graphId) { + Schema schema = Schema.fromGraphDef(grootClient.getSchema()); + GetGraphSchemaResponse response = new GetGraphSchemaResponse(); + for (VertexLabel vertex : schema.getVertexLabels()) { + response.addVertexTypesItem(DtoConverter.convertToDtoVertexType(vertex)); + } + for (EdgeLabel edge : schema.getEdgeLabels()) { + response.addEdgeTypesItem(DtoConverter.convertToDtoEdgeType(edge)); + } + return response; + } + + public void dropSchema(String graphId) { + // TODO: seems not working + grootClient.dropSchema(); + } + + private VertexLabel createVertexLabel(String graphId, CreateVertexType createVertexType) { + VertexLabel.Builder vLabelBuilder = VertexLabel.newBuilder(); + vLabelBuilder.setLabel(createVertexType.getTypeName()); + for (String pk : createVertexType.getPrimaryKeys()) { + // TODO: set datatype for primary key + Property.Builder property = Property.newBuilder().setName(pk).setDataType(DataTypePb.STRING).setPrimaryKey(); + vLabelBuilder.addProperty(property); + } + for (CreatePropertyMeta prop : createVertexType.getProperties()) { + DataTypePb dataType = DtoConverter.convertToDataTypePb(prop.getPropertyType()); + Property.Builder property = Property.newBuilder().setName(prop.getPropertyName()).setDataType(dataType); + vLabelBuilder.addProperty(property); + } + return vLabelBuilder.build(); + } + + private EdgeLabel createEdgeLabel(String graphId, CreateEdgeType createEdgeType) { + EdgeLabel.Builder eLabelBuilder = EdgeLabel.newBuilder(); + eLabelBuilder.setLabel(createEdgeType.getTypeName()); + for (BaseEdgeTypeVertexTypePairRelationsInner pair : createEdgeType.getVertexTypePairRelations()) { + eLabelBuilder.addRelation(pair.getSourceVertex(), pair.getDestinationVertex()); + } + for (CreatePropertyMeta prop : createEdgeType.getProperties()) { + DataTypePb dataType = DtoConverter.convertToDataTypePb(prop.getPropertyType()); + Property.Builder property = Property.newBuilder().setName(prop.getPropertyName()).setDataType(dataType); + eLabelBuilder.addProperty(property); + } + return eLabelBuilder.build(); + } +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java index 2b6f915cda26..7ceca4ccbdcb 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java @@ -18,7 +18,7 @@ * APIResponseWithCode */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class APIResponseWithCode { private Integer code; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java index 8d5e067c7dc7..ce23cef205f5 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java @@ -22,7 +22,7 @@ * BaseEdgeType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class BaseEdgeType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java index 504e7d95af0a..328c63034842 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java @@ -22,7 +22,7 @@ */ @JsonTypeName("BaseEdgeType_vertex_type_pair_relations_inner") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class BaseEdgeTypeVertexTypePairRelationsInner { private String sourceVertex; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java index b1a8a8abde36..76de7d7b5321 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java @@ -22,7 +22,7 @@ @Schema(name = "BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params", description = "Used for storage optimization") @JsonTypeName("BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams { /** diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java index aed3d098c72f..00ae9f0f9acb 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java @@ -19,7 +19,7 @@ * BasePropertyMeta */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class BasePropertyMeta { private String propertyName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java index e8fb65901a7c..3c951cabbcc9 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java @@ -22,7 +22,7 @@ * BaseVertexType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class BaseVertexType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java index 3b3eee143e42..89087202a306 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java @@ -21,7 +21,7 @@ @Schema(name = "BaseVertexType_x_csr_params", description = "Used for storage optimization") @JsonTypeName("BaseVertexType_x_csr_params") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class BaseVertexTypeXCsrParams { private Integer maxVertexNum; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java index 9f77e9ad02ed..747f4b8de82b 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java @@ -19,7 +19,7 @@ * ColumnMapping */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class ColumnMapping { private EdgeMappingSourceVertexMappingsInnerColumn column; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java index 8d718f67759e..2ba41342ab02 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java @@ -23,7 +23,7 @@ * CreateEdgeType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class CreateEdgeType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java index 5ffd29d7368b..9f22d5c9f20a 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java @@ -23,7 +23,7 @@ * CreateGraphRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class CreateGraphRequest { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java index 3f04f06c652a..25d9a67259b0 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java @@ -18,7 +18,7 @@ * CreateGraphResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class CreateGraphResponse { private String graphId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java index 687260d953be..ab0a17087b69 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java @@ -23,7 +23,7 @@ * CreateGraphSchemaRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class CreateGraphSchemaRequest { @Valid diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java index d81d8de4bbf1..1cbd98137d55 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java @@ -19,7 +19,7 @@ * CreateProcedureRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class CreateProcedureRequest { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java index ae443cce96a5..712d2a70a572 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java @@ -18,7 +18,7 @@ * CreateProcedureResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class CreateProcedureResponse { private String procedureId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java index 3a1601b58f78..12f91fc60fe9 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java @@ -19,7 +19,7 @@ * CreatePropertyMeta */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class CreatePropertyMeta { private String propertyName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java index b47f6069d837..8b98446d7a15 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java @@ -23,7 +23,7 @@ * CreateVertexType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class CreateVertexType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java index 56ec58448a91..54e8dd93ffda 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java @@ -19,7 +19,7 @@ * DateType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class DateType implements TemporalTypeTemporal { private String date32; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java index 5be9d28e9517..15f114165443 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java @@ -24,7 +24,7 @@ */ @JsonTypeName("delete_edge_request") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class DeleteEdgeRequest { @Valid diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java index 7c1baf0ebcf0..a1c2814d4c65 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java @@ -22,7 +22,7 @@ * EdgeData */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class EdgeData { private String srcLabel; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java index e42fd7341718..1c33d1feb790 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java @@ -25,7 +25,7 @@ * EdgeMapping */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class EdgeMapping { private EdgeMappingTypeTriplet typeTriplet; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java index f224fa321d2f..05949f1ceb03 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java @@ -22,7 +22,7 @@ @Schema(name = "EdgeMapping_destination_vertex_mappings_inner", description = "Mapping column to the primary key of destination vertex") @JsonTypeName("EdgeMapping_destination_vertex_mappings_inner") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class EdgeMappingDestinationVertexMappingsInner { private EdgeMappingSourceVertexMappingsInnerColumn column; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java index 2314f22a399f..68b0a68a3ade 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java @@ -22,7 +22,7 @@ @Schema(name = "EdgeMapping_source_vertex_mappings_inner", description = "Mapping column to the primary key of source vertex") @JsonTypeName("EdgeMapping_source_vertex_mappings_inner") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class EdgeMappingSourceVertexMappingsInner { private EdgeMappingSourceVertexMappingsInnerColumn column; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java index 8f8119f6547e..b1a416d8a41f 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java @@ -20,7 +20,7 @@ */ @JsonTypeName("EdgeMapping_source_vertex_mappings_inner_column") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class EdgeMappingSourceVertexMappingsInnerColumn { private Integer index; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java index 1b9c751196ee..18fbf76a3f2f 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java @@ -21,7 +21,7 @@ @Schema(name = "EdgeMapping_type_triplet", description = "source label -> [edge label] -> destination label") @JsonTypeName("EdgeMapping_type_triplet") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class EdgeMappingTypeTriplet { private String edge; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java index 91095ac03a0a..a4bbaf8ca7c5 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java @@ -22,7 +22,7 @@ * EdgeRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class EdgeRequest { private String srcLabel; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java index ef04908756e1..8eef9424e750 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java @@ -22,7 +22,7 @@ * EdgeStatistics */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class EdgeStatistics { private Integer typeId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java index b235249964a2..f8379d6e70c5 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java @@ -20,7 +20,7 @@ * FixedChar */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class FixedChar implements StringTypeString { private FixedCharChar _char; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java index f31ba0cb0494..e62384c395b4 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java @@ -20,7 +20,7 @@ */ @JsonTypeName("FixedChar_char") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class FixedCharChar { private Integer fixedLength; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java index 3683f7e8836f..cf11e49b9973 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java @@ -23,6 +23,14 @@ import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = PrimitiveType.class, name = "PrimitiveType"), + @JsonSubTypes.Type(value = StringType.class, name = "StringType"), + @JsonSubTypes.Type(value = TemporalType.class, name = "TemporalType") +}) public interface GSDataType { } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java index 674534c77c22..fc789b16283d 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java @@ -23,7 +23,7 @@ * GetEdgeType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class GetEdgeType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java index 5334e684e00e..738b80cb2c70 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java @@ -25,7 +25,7 @@ * GetGraphResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class GetGraphResponse { private String version; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java index c6167b8b18db..050a64c05e99 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java @@ -23,7 +23,7 @@ * GetGraphSchemaResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class GetGraphSchemaResponse { @Valid diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java index 61d0adc5cb60..cde52546d827 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java @@ -23,7 +23,7 @@ * GetGraphStatisticsResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class GetGraphStatisticsResponse { private Integer totalVertexCount; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java index 2a34dc66cb8a..1cf8ac0d4adc 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java @@ -25,7 +25,7 @@ * GetProcedureResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class GetProcedureResponse { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java index d2f6c68b233d..0faae018f4b5 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java @@ -19,7 +19,7 @@ * GetPropertyMeta */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class GetPropertyMeta { private String propertyName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java index a4000ad0376d..aaadcdd8a635 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java @@ -23,7 +23,7 @@ * GetVertexType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class GetVertexType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java index d06fb3abd5cf..519942501203 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java @@ -18,7 +18,7 @@ * JobResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class JobResponse { private String jobId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java index 160fcc06d953..e37ba93a2520 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java @@ -21,7 +21,7 @@ * JobStatus */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class JobStatus { private String id; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java index 887798f4bb48..2a11a113d6f9 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java @@ -19,7 +19,7 @@ * LongText */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class LongText implements StringTypeString { private JsonNullable longText = JsonNullable.undefined(); diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java index 825ab131495e..322781ed94ca 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java @@ -19,7 +19,7 @@ * Parameter */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class Parameter { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java index 81987a64a8d0..f5d2e7bdc54a 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java @@ -19,7 +19,7 @@ * PrimitiveType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class PrimitiveType implements GSDataType { /** diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java index 41c9e305b934..d23fe1731390 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java @@ -18,7 +18,7 @@ * Property */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class Property { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java index cde427e9f322..b1622ce4b32f 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java @@ -22,7 +22,7 @@ * QueryRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class QueryRequest { private String queryName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java index e998fc768e66..41345c6e12bc 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java @@ -24,7 +24,7 @@ * SchemaMapping */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class SchemaMapping { private SchemaMappingLoadingConfig loadingConfig; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java index e40f2a5103c4..9c26004e9212 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java @@ -24,7 +24,7 @@ */ @JsonTypeName("SchemaMapping_loading_config") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class SchemaMappingLoadingConfig { private SchemaMappingLoadingConfigXCsrParams xCsrParams; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java index 916d9b4c9ba7..9cb445ffd320 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java @@ -21,7 +21,7 @@ */ @JsonTypeName("SchemaMapping_loading_config_data_source") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class SchemaMappingLoadingConfigDataSource { /** diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java index e3cd81ccad24..70dec56d6c1a 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java @@ -22,7 +22,7 @@ */ @JsonTypeName("SchemaMapping_loading_config_format") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class SchemaMappingLoadingConfigFormat { private String type; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java index 691f05739b40..0e465cc47a5a 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java @@ -21,7 +21,7 @@ @Schema(name = "SchemaMapping_loading_config_x_csr_params", description = "mutable_csr specific parameters") @JsonTypeName("SchemaMapping_loading_config_x_csr_params") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class SchemaMappingLoadingConfigXCsrParams { private Integer parallelism; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java index 59c9ea611580..ccf453d337be 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java @@ -19,7 +19,7 @@ * ServiceStatus */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class ServiceStatus { private Boolean statisticsEnabled; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java index 5bada3d6a573..7444bfb5c793 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java @@ -18,7 +18,7 @@ * StartServiceRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class StartServiceRequest { private String graphId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java index 40bd1c5d9393..222792e218a4 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java @@ -21,7 +21,7 @@ * StopServiceRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class StopServiceRequest { private JsonNullable graphId = JsonNullable.undefined(); diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java index 669471a630a7..dad12d11adfb 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java @@ -25,7 +25,7 @@ * StoredProcedureMeta */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class StoredProcedureMeta { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java index a4d91ba0c8c4..6caf5ca4329b 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java @@ -20,7 +20,7 @@ * StringType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class StringType implements GSDataType { private StringTypeString string; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java index eac9f8bb72cf..58197d4a8d2a 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java @@ -23,6 +23,6 @@ import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public interface StringTypeString { } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java index 80a628e1ca6d..0e4416a52a31 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java @@ -20,7 +20,7 @@ * TemporalType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class TemporalType implements GSDataType { private TemporalTypeTemporal temporal; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java index d272b77816ef..3e528e7b0b47 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java @@ -20,6 +20,6 @@ import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public interface TemporalTypeTemporal { } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java index 812b8c4c6f25..d37ef17965c7 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java @@ -19,7 +19,7 @@ * TimeStampType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class TimeStampType implements TemporalTypeTemporal { private String timestamp; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java index 48802d161b75..eb2bc2c8d19e 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java @@ -19,7 +19,7 @@ * TypedValue */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class TypedValue { private GSDataType type; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java index d34cea228799..80469e38bebd 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java @@ -18,7 +18,7 @@ * UpdateProcedureRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class UpdateProcedureRequest { private String description; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java index 6997b70ccd5d..b8876d798274 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java @@ -20,7 +20,7 @@ * UploadFileResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class UploadFileResponse { private String filePath; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java index 7dd28dbecee2..3c9623bcf08e 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java @@ -20,7 +20,7 @@ * VarChar */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class VarChar implements StringTypeString { private VarCharVarChar varChar; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java index 68ee4d031475..009a5464911b 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java @@ -20,7 +20,7 @@ */ @JsonTypeName("VarChar_var_char") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class VarCharVarChar { private Integer maxLength; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java index 5461b4e7d75d..9abc38e346a4 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java @@ -22,7 +22,7 @@ * VertexData */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class VertexData { private String label; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java index 05bd29c74027..2906116cee97 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java @@ -23,7 +23,7 @@ * VertexEdgeRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class VertexEdgeRequest { @Valid diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java index a462ba9edafa..c53de657fd0d 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java @@ -22,7 +22,7 @@ * VertexMapping */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class VertexMapping { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java index 8e16458fb821..7c72c4f6c8f2 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java @@ -22,7 +22,7 @@ * VertexRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class VertexRequest { private String label; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java index 54bcb6615b8f..1774caf82dd1 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java @@ -18,7 +18,7 @@ * VertexStatistics */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class VertexStatistics { private Integer typeId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java index 33f0b3745469..0b6e78f33d09 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java @@ -18,7 +18,7 @@ * VertexTypePairStatistics */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-19T17:10:03.937738+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") public class VertexTypePairStatistics { private String sourceVertex; diff --git a/interactive_engine/groot-http/src/main/resources/openapi.yaml b/interactive_engine/groot-http/src/main/resources/openapi.yaml index 3089c7c5c27f..91f368aa2576 100644 --- a/interactive_engine/groot-http/src/main/resources/openapi.yaml +++ b/interactive_engine/groot-http/src/main/resources/openapi.yaml @@ -40,8 +40,6 @@ tags: name: GraphService/EdgeManagement - description: Graph query name: QueryService -- description: SchemaManagement - name: GraphService/SchemaManagement paths: /v1/graph: get: @@ -171,11 +169,37 @@ paths: x-tags: - tag: AdminService/GraphManagement /v1/graph/{graph_id}/schema: + delete: + description: Delete schema by graph id + operationId: delete_schema + parameters: + - description: The id of graph to delete + explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: successful operation + "500": + $ref: '#/components/responses/500' + tags: + - AdminService/GraphManagement + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement get: description: Get schema by graph id operationId: get_schema parameters: - - description: The id of graph to delete + - description: The id of graph to get schema explode: false in: path name: graph_id @@ -190,6 +214,8 @@ paths: schema: $ref: '#/components/schemas/GetGraphSchemaResponse' description: successful operation + "500": + $ref: '#/components/responses/500' tags: - AdminService/GraphManagement x-accepts: application/json @@ -224,11 +250,160 @@ paths: $ref: '#/components/responses/500' summary: Import graph schema tags: - - GraphService/SchemaManagement + - AdminService/GraphManagement x-content-type: application/json x-accepts: application/json x-tags: - - tag: GraphService/SchemaManagement + - tag: AdminService/GraphManagement + /v1/graph/{graph_id}/schema/vertex: + post: + description: Create a vertex type + operationId: createVertexType + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateVertexType' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful created a vertex type + "400": + $ref: '#/components/responses/400' + "500": + $ref: '#/components/responses/500' + tags: + - AdminService/GraphManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement + /v1/graph/{graph_id}/schema/vertex/{type_name}: + delete: + description: Delete vertex type by name + operationId: deleteVertexTypeByName + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: type_name + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful deleted the vertex type + "500": + $ref: '#/components/responses/500' + tags: + - AdminService/GraphManagement + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement + /v1/graph/{graph_id}/schema/edge: + post: + description: Create a edge type + operationId: createEdgeType + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEdgeType' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful created the edge type + "400": + $ref: '#/components/responses/400' + "500": + $ref: '#/components/responses/500' + tags: + - AdminService/GraphManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement + /v1/graph/{graph_id}/schema/edge/{type_name}: + delete: + description: Delete edge type by name + operationId: deleteEdgeTypeByName + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: type_name + required: true + schema: + type: string + style: simple + - explode: true + in: query + name: source_vertex_type + required: true + schema: + type: string + style: form + - explode: true + in: query + name: destination_vertex_type + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful deleted the edge type + "500": + $ref: '#/components/responses/500' + tags: + - AdminService/GraphManagement + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement /v1/graph/{graph_id}/statistics: get: description: "Get the statics info of a graph, including number of vertices\ @@ -1507,155 +1682,6 @@ paths: x-accepts: application/json x-tags: - tag: Utils - /v1/graph/{graph_id}/schema/vertex: - post: - description: Create a vertex type - operationId: createVertexType - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateVertexType' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successful created a vertex type - "400": - $ref: '#/components/responses/400' - "500": - $ref: '#/components/responses/500' - tags: - - GraphService/SchemaManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: GraphService/SchemaManagement - /api/v1/graph/{graph_id}/schema/vertex/{type_name}: - delete: - description: Delete vertex type by name - operationId: deleteVertexTypeByName - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: type_name - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successful deleted the vertex type - "500": - $ref: '#/components/responses/500' - tags: - - GraphService/SchemaManagement - x-accepts: application/json - x-tags: - - tag: GraphService/SchemaManagement - /api/v1/graph/{graph_id}/schema/edge: - post: - description: Create a edge type - operationId: createEdgeType - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateEdgeType' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successful created the edge type - "400": - $ref: '#/components/responses/400' - "500": - $ref: '#/components/responses/500' - tags: - - GraphService/SchemaManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: GraphService/SchemaManagement - /api/v1/graph/{graph_id}/schema/edge/{type_name}: - delete: - description: Delete edge type by name - operationId: deleteEdgeTypeByName - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: type_name - required: true - schema: - type: string - style: simple - - explode: true - in: query - name: source_vertex_type - required: true - schema: - type: string - style: form - - explode: true - in: query - name: destination_vertex_type - required: true - schema: - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successful deleted the edge type - "500": - $ref: '#/components/responses/500' - tags: - - GraphService/SchemaManagement - x-accepts: application/json - x-tags: - - tag: GraphService/SchemaManagement components: schemas: AnyValue: {} From 9d6d09aa3f9ff2c8aa9b3532142d0c49a37d6c05 Mon Sep 17 00:00:00 2001 From: BingqingLyu Date: Wed, 25 Dec 2024 19:00:11 +0800 Subject: [PATCH 05/23] refine openapi, and add update api for vertex type and edge type, for adding new properties Committed-by: BingqingLyu from Dev container Committed-by: BingqingLyu from Dev container --- flex/openapi/openapi_interactive.yaml | 155 +++++++++++++++++--------- 1 file changed, 105 insertions(+), 50 deletions(-) diff --git a/flex/openapi/openapi_interactive.yaml b/flex/openapi/openapi_interactive.yaml index a83d4890f310..920174c9363a 100644 --- a/flex/openapi/openapi_interactive.yaml +++ b/flex/openapi/openapi_interactive.yaml @@ -238,28 +238,27 @@ paths: schema: type: string requestBody: + required: true content: application/json: schema: $ref: '#/components/schemas/CreateVertexType' - required: true responses: - 200: - description: Successful created a vertex type + '200': + description: Successfully created the vertex type content: application/json: schema: $ref: '#/components/schemas/APIResponse' - 400: + '400': $ref: "#/components/responses/400" - 500: + '500': $ref: "#/components/responses/500" - /v1/graph/{graph_id}/schema/vertex/{type_name}: delete: tags: - AdminService/GraphManagement - description: Delete vertex type by name + description: Delete a vertex type by name operationId: deleteVertexTypeByName parameters: - name: graph_id @@ -268,18 +267,49 @@ paths: schema: type: string - name: type_name + in: query + required: true + schema: + type: string + responses: + '200': + description: Successfully deleted the vertex type + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + '400': + $ref: "#/components/responses/400" + '500': + $ref: "#/components/responses/500" + + put: + tags: + - AdminService/GraphManagement + description: Update a vertex type to add more properties + operationId: updateVertexType + parameters: + - name: graph_id in: path required: true schema: type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateVertexType' responses: - 200: - description: Successful deleted the vertex type + '200': + description: Successfully updated the vertex type content: application/json: schema: $ref: '#/components/schemas/APIResponse' - 500: + '400': + $ref: "#/components/responses/400" + '500': $ref: "#/components/responses/500" /v1/graph/{graph_id}/schema/edge: @@ -300,22 +330,21 @@ paths: schema: $ref: '#/components/schemas/CreateEdgeType' responses: - 200: + '200': description: Successful created the edge type content: application/json: schema: $ref: '#/components/schemas/APIResponse' - 400: + '400': $ref: "#/components/responses/400" - 500: + '500': $ref: "#/components/responses/500" - - /v1/graph/{graph_id}/schema/edge/{type_name}: + delete: tags: - AdminService/GraphManagement - description: Delete edge type by name + description: Delete an edge type by name operationId: deleteEdgeTypeByName parameters: - name: graph_id @@ -324,7 +353,7 @@ paths: schema: type: string - name: type_name - in: path + in: query required: true schema: type: string @@ -338,15 +367,47 @@ paths: required: true schema: type: string + responses: + '200': + description: Successfully deleted the edge type + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + '400': + $ref: "#/components/responses/400" + '500': + $ref: "#/components/responses/500" + + put: + tags: + - AdminService/GraphManagement + description: Update an edge type to add more properties + operationId: updateEdgeType + parameters: + - name: graph_id + in: path + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEdgeType' responses: 200: - description: Successful deleted the edge type + description: Successfully updated the edge type content: application/json: schema: $ref: '#/components/schemas/APIResponse' + 400: + $ref: "#/components/responses/400" 500: $ref: "#/components/responses/500" + /v1/graph/{graph_id}/statistics: get: tags: @@ -943,21 +1004,22 @@ paths: required: true schema: type: string - - name: label - in: query - required: true - description: The label name of querying vertex. - schema: - type: string requestBody: - description: The primary key values of the vertex to delete. + description: The label and primary key values of the vertex to be deleted. required: true content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Property' + type: object + properties: + label: + type: string + description: The label name of the vertex to delete. + primary_key_values: + type: array + description: The primary key values for locating the vertex. + items: + $ref: '#/components/schemas/Property' responses: '200': description: Successfully delete vertex @@ -1233,41 +1295,34 @@ paths: required: true schema: type: string - - name: edge_label - in: query - required: true - description: The label name of edge. - schema: - type: string - example: created - - name: src_label - in: query - required: true - description: The label name of src vertex. - schema: - type: string - example: person - - name: dst_label - in: query - required: true - description: The label name of dst vertex. - schema: - type: string - example: software requestBody: - description: The primary key values of the src and dst vertices. + description: The label and primary key values of the src and dst vertices, and the edge label. required: true content: application/json: schema: type: object properties: + edge_label: + type: string + description: The label name of the edge. + example: created + src_label: + type: string + description: The label name of the source vertex. + example: person + dst_label: + type: string + description: The label name of the destination vertex. + example: software src_primary_key_values: type: array + description: Primary key values for the source vertex. items: $ref: '#/components/schemas/Property' dst_primary_key_values: type: array + description: Primary key values for the destination vertex. items: $ref: '#/components/schemas/Property' responses: From 1e65b3d6e30a2805bcfa2eb92549257b993ce0bb Mon Sep 17 00:00:00 2001 From: shirly121 Date: Wed, 25 Dec 2024 19:26:51 +0800 Subject: [PATCH 06/23] fix bugs in schema spec conversion Committed-by: BingqingLyu from Dev container --- .../graphscope/common/ir/meta/schema/SchemaSpecManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/schema/SchemaSpecManager.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/schema/SchemaSpecManager.java index 80079cbff9eb..ab526abe60f3 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/schema/SchemaSpecManager.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/schema/SchemaSpecManager.java @@ -104,7 +104,7 @@ public SchemaSpec getSpec(SchemaSpec.Type type) { } catch (Exception e) { logger.warn( "can not convert from {} to {} due to some unexpected exception:", - source.getType(), + source == null ? null : source.getType(), target, e); return null; From 2e1e13db3ef54e5582fbc3b851585bf6f32b06b7 Mon Sep 17 00:00:00 2001 From: BingqingLyu Date: Wed, 25 Dec 2024 20:29:06 +0800 Subject: [PATCH 07/23] implementation of ddl apis Committed-by: BingqingLyu from Dev container Committed-by: BingqingLyu from Dev container --- .../groot/service/GrootController.java | 35 --- .../groot/service/GrootService.java | 51 ----- .../groot-http/.openapi-generator-ignore | 2 +- .../groot-http/.openapi-generator/FILES | 2 +- .../graphscope/groot/service/api/V1Api.java | 150 ++++++++++--- .../groot/service/impl/DtoConverter.java | 4 +- .../groot/service/impl/GrootController.java | 55 +++-- .../service/impl/SchemaManagementService.java | 71 +++--- .../service/models/DeleteVertexRequest.java | 122 +++++++++++ .../groot/service/models/UpdateEdgeType.java | 154 +++++++++++++ .../service/models/UpdateVertexType.java | 178 +++++++++++++++ .../src/main/resources/openapi.yaml | 205 +++++++++++------- 12 files changed, 790 insertions(+), 239 deletions(-) delete mode 100644 interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootController.java delete mode 100644 interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootService.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateEdgeType.java create mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateVertexType.java diff --git a/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootController.java b/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootController.java deleted file mode 100644 index 3e49250b8509..000000000000 --- a/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootController.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.alibaba.graphscope.groot.service; - -import org.apache.tinkerpop.gremlin.driver.Result; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -import com.alibaba.graphscope.groot.sdk.schema.Vertex; - -import java.util.List; -import java.util.concurrent.ExecutionException; - -@RestController -@RequestMapping("/api/v1/graph") -public class GrootController { - - private final GrootService grootService; - - @Autowired - public GrootController(GrootService grootService) { - this.grootService = grootService; - } - - @PostMapping("/vertex") - public ResponseEntity addVertex(@RequestBody Vertex vertex) { - long id = grootService.addVertex(vertex); - return ResponseEntity.ok(id); - } - - @PostMapping("/query/gremlin") - public ResponseEntity> executeGremlinQuery(@RequestBody String query) throws ExecutionException, InterruptedException { - List results = grootService.executeGremlinQuery(query).get(); - return ResponseEntity.ok(results); - } -} diff --git a/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootService.java b/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootService.java deleted file mode 100644 index fa7082b47c44..000000000000 --- a/interactive_engine/groot-client/src/main/java/com/alibaba/graphscope/groot/service/GrootService.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright 2024 Alibaba Group Holding Limited. - * - *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of the License at - * - *

http://www.apache.org/licenses/LICENSE-2.0 - * - *

Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alibaba.graphscope.groot.service; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.alibaba.graphscope.groot.sdk.GrootClient; -import com.alibaba.graphscope.groot.sdk.schema.Vertex; - -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import org.apache.tinkerpop.gremlin.driver.Client; -import org.apache.tinkerpop.gremlin.driver.Result; -import org.apache.tinkerpop.gremlin.driver.ResultSet; - -@Service -public class GrootService { - private final GrootClient grootClient; - private final Client gremlinClient; - - @Autowired - public GrootService(GrootClient grootClient, Client gremlinClient) { - this.grootClient = grootClient; - this.gremlinClient = gremlinClient; - } - - public long addVertex(Vertex vertex) { - return grootClient.addVertex(vertex); - } - - public long addVertices(List vertices) { - return grootClient.addVertices(vertices); - } - - public CompletableFuture> executeGremlinQuery(String query) { - ResultSet resultSet = gremlinClient.submit(query); - return resultSet.all(); - } -} diff --git a/interactive_engine/groot-http/.openapi-generator-ignore b/interactive_engine/groot-http/.openapi-generator-ignore index d14fc080a342..3023a818ae75 100644 --- a/interactive_engine/groot-http/.openapi-generator-ignore +++ b/interactive_engine/groot-http/.openapi-generator-ignore @@ -25,4 +25,4 @@ pom.xml src/main/java/com/alibaba/graphscope/groot/service/impl src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java -src/main/java/com/alibaba/graphscope/groot/service/models/GsDataType.java \ No newline at end of file +src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java \ No newline at end of file diff --git a/interactive_engine/groot-http/.openapi-generator/FILES b/interactive_engine/groot-http/.openapi-generator/FILES index 504d5620329f..308db9fe8b32 100644 --- a/interactive_engine/groot-http/.openapi-generator/FILES +++ b/interactive_engine/groot-http/.openapi-generator/FILES @@ -20,6 +20,7 @@ src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.jav src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java +src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java @@ -30,7 +31,6 @@ src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java -src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java index 370b25579be4..95922473fa65 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java @@ -14,6 +14,7 @@ import com.alibaba.graphscope.groot.service.models.CreateProcedureResponse; import com.alibaba.graphscope.groot.service.models.CreateVertexType; import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; +import com.alibaba.graphscope.groot.service.models.DeleteVertexRequest; import com.alibaba.graphscope.groot.service.models.EdgeData; import com.alibaba.graphscope.groot.service.models.EdgeRequest; import com.alibaba.graphscope.groot.service.models.GetGraphResponse; @@ -22,7 +23,6 @@ import com.alibaba.graphscope.groot.service.models.GetProcedureResponse; import com.alibaba.graphscope.groot.service.models.JobResponse; import com.alibaba.graphscope.groot.service.models.JobStatus; -import com.alibaba.graphscope.groot.service.models.Property; import com.alibaba.graphscope.groot.service.models.SchemaMapping; import com.alibaba.graphscope.groot.service.models.ServiceStatus; import com.alibaba.graphscope.groot.service.models.StartServiceRequest; @@ -57,7 +57,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-25T20:15:37.362177+08:00[Asia/Shanghai]") @Validated @Tag(name = "GraphService/EdgeManagement", description = "EdgeManagement") public interface V1Api { @@ -462,7 +462,7 @@ default ResponseEntity createProcedure( * * @param graphId (required) * @param createVertexType (required) - * @return Successful created a vertex type (status code 200) + * @return Successfully created the vertex type (status code 200) * or (status code 400) * or (status code 500) */ @@ -471,7 +471,7 @@ default ResponseEntity createProcedure( description = "Create a vertex type", tags = { "AdminService/GraphManagement" }, responses = { - @ApiResponse(responseCode = "200", description = "Successful created a vertex type", content = { + @ApiResponse(responseCode = "200", description = "Successfully created the vertex type", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) }), @ApiResponse(responseCode = "400", description = ""), @@ -508,10 +508,7 @@ default ResponseEntity createVertexType( * Remove the edge from current graph. * * @param graphId (required) - * @param edgeLabel The label name of edge. (required) - * @param srcLabel The label name of src vertex. (required) - * @param dstLabel The label name of dst vertex. (required) - * @param deleteEdgeRequest The primary key values of the src and dst vertices. (required) + * @param deleteEdgeRequest The label and primary key values of the src and dst vertices, and the edge label. (required) * @return Successfully delete edge (status code 200) * or Invalid input edge (status code 400) * or Edge not exists or Graph not exits (status code 404) @@ -546,10 +543,7 @@ default ResponseEntity createVertexType( default ResponseEntity deleteEdge( @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @NotNull @Parameter(name = "edge_label", description = "The label name of edge.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "edge_label", required = true) String edgeLabel, - @NotNull @Parameter(name = "src_label", description = "The label name of src vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "src_label", required = true) String srcLabel, - @NotNull @Parameter(name = "dst_label", description = "The label name of dst vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "dst_label", required = true) String dstLabel, - @Parameter(name = "DeleteEdgeRequest", description = "The primary key values of the src and dst vertices.", required = true) @Valid @RequestBody DeleteEdgeRequest deleteEdgeRequest + @Parameter(name = "DeleteEdgeRequest", description = "The label and primary key values of the src and dst vertices, and the edge label.", required = true) @Valid @RequestBody DeleteEdgeRequest deleteEdgeRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -566,36 +560,38 @@ default ResponseEntity deleteEdge( /** - * DELETE /v1/graph/{graph_id}/schema/edge/{type_name} - * Delete edge type by name + * DELETE /v1/graph/{graph_id}/schema/edge + * Delete an edge type by name * * @param graphId (required) * @param typeName (required) * @param sourceVertexType (required) * @param destinationVertexType (required) - * @return Successful deleted the edge type (status code 200) + * @return Successfully deleted the edge type (status code 200) + * or (status code 400) * or (status code 500) */ @Operation( operationId = "deleteEdgeTypeByName", - description = "Delete edge type by name", + description = "Delete an edge type by name", tags = { "AdminService/GraphManagement" }, responses = { - @ApiResponse(responseCode = "200", description = "Successful deleted the edge type", content = { + @ApiResponse(responseCode = "200", description = "Successfully deleted the edge type", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) }), + @ApiResponse(responseCode = "400", description = ""), @ApiResponse(responseCode = "500", description = "") } ) @RequestMapping( method = RequestMethod.DELETE, - value = "/v1/graph/{graph_id}/schema/edge/{type_name}", + value = "/v1/graph/{graph_id}/schema/edge", produces = { "application/json" } ) default ResponseEntity deleteEdgeTypeByName( @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "type_name", description = "", required = true, in = ParameterIn.PATH) @PathVariable("type_name") String typeName, + @NotNull @Parameter(name = "type_name", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "type_name", required = true) String typeName, @NotNull @Parameter(name = "source_vertex_type", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "source_vertex_type", required = true) String sourceVertexType, @NotNull @Parameter(name = "destination_vertex_type", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "destination_vertex_type", required = true) String destinationVertexType ) { @@ -792,8 +788,7 @@ default ResponseEntity deleteSchema( * Remove the vertex from the specified graph. * * @param graphId (required) - * @param label The label name of querying vertex. (required) - * @param property The primary key values of the vertex to delete. (required) + * @param deleteVertexRequest The label and primary key values of the vertex to be deleted. (required) * @return Successfully delete vertex (status code 200) * or Invalid input vertex (status code 400) * or Vertex not exists or Graph not exits. (status code 404) @@ -828,8 +823,7 @@ default ResponseEntity deleteSchema( default ResponseEntity deleteVertex( @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @NotNull @Parameter(name = "label", description = "The label name of querying vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "label", required = true) String label, - @Parameter(name = "Property", description = "The primary key values of the vertex to delete.", required = true) @Valid @RequestBody List<@Valid Property> property + @Parameter(name = "DeleteVertexRequest", description = "The label and primary key values of the vertex to be deleted.", required = true) @Valid @RequestBody DeleteVertexRequest deleteVertexRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -846,34 +840,36 @@ default ResponseEntity deleteVertex( /** - * DELETE /v1/graph/{graph_id}/schema/vertex/{type_name} - * Delete vertex type by name + * DELETE /v1/graph/{graph_id}/schema/vertex + * Delete a vertex type by name * * @param graphId (required) * @param typeName (required) - * @return Successful deleted the vertex type (status code 200) + * @return Successfully deleted the vertex type (status code 200) + * or (status code 400) * or (status code 500) */ @Operation( operationId = "deleteVertexTypeByName", - description = "Delete vertex type by name", + description = "Delete a vertex type by name", tags = { "AdminService/GraphManagement" }, responses = { - @ApiResponse(responseCode = "200", description = "Successful deleted the vertex type", content = { + @ApiResponse(responseCode = "200", description = "Successfully deleted the vertex type", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) }), + @ApiResponse(responseCode = "400", description = ""), @ApiResponse(responseCode = "500", description = "") } ) @RequestMapping( method = RequestMethod.DELETE, - value = "/v1/graph/{graph_id}/schema/vertex/{type_name}", + value = "/v1/graph/{graph_id}/schema/vertex", produces = { "application/json" } ) default ResponseEntity deleteVertexTypeByName( @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "type_name", description = "", required = true, in = ParameterIn.PATH) @PathVariable("type_name") String typeName + @NotNull @Parameter(name = "type_name", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "type_name", required = true) String typeName ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -1691,6 +1687,53 @@ default ResponseEntity updateEdge( } + /** + * PUT /v1/graph/{graph_id}/schema/edge + * Update an edge type to add more properties + * + * @param graphId (required) + * @param createEdgeType (required) + * @return Successfully updated the edge type (status code 200) + * or (status code 400) + * or (status code 500) + */ + @Operation( + operationId = "updateEdgeType", + description = "Update an edge type to add more properties", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully updated the edge type", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = ""), + @ApiResponse(responseCode = "500", description = "") + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/v1/graph/{graph_id}/schema/edge", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity updateEdgeType( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "CreateEdgeType", description = "", required = true) @Valid @RequestBody CreateEdgeType createEdgeType + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /v1/graph/{graph_id}/procedure/{procedure_id} * Update procedure on a graph by id @@ -1804,6 +1847,53 @@ default ResponseEntity updateVertex( } + /** + * PUT /v1/graph/{graph_id}/schema/vertex + * Update a vertex type to add more properties + * + * @param graphId (required) + * @param createVertexType (required) + * @return Successfully updated the vertex type (status code 200) + * or (status code 400) + * or (status code 500) + */ + @Operation( + operationId = "updateVertexType", + description = "Update a vertex type to add more properties", + tags = { "AdminService/GraphManagement" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successfully updated the vertex type", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) + }), + @ApiResponse(responseCode = "400", description = ""), + @ApiResponse(responseCode = "500", description = "") + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/v1/graph/{graph_id}/schema/vertex", + produces = { "application/json" }, + consumes = { "application/json" } + ) + + default ResponseEntity updateVertexType( + @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, + @Parameter(name = "CreateVertexType", description = "", required = true) @Valid @RequestBody CreateVertexType createVertexType + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "\"Response string\""; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * POST /v1/file/upload * diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java index cd60d1c6220f..80f2325454e8 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java @@ -4,6 +4,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import org.openapitools.jackson.nullable.JsonNullable; @@ -108,8 +109,7 @@ public static GetVertexType convertToDtoVertexType(VertexLabel vertexLabel) { vertexType.setTypeName(vertexLabel.getLabel()); vertexType.setTypeId(vertexLabel.getId()); vertexType.setProperties(convertToDtoProperties(vertexLabel.getProperties())); - // TODO: groot does not differentiate primary key and non-primary key properties - // vertexType.setPrimaryKeys(xxx); + vertexType.setPrimaryKeys(vertexLabel.getProperties().stream().filter(p -> p.isPrimaryKey()).map(p -> p.getName()).collect(Collectors.toList())); return vertexType; } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java index 814bf4c524fb..c34a9188db23 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java @@ -4,21 +4,16 @@ import com.alibaba.graphscope.groot.service.models.CreateGraphSchemaRequest; import com.alibaba.graphscope.groot.service.models.CreateVertexType; import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; +import com.alibaba.graphscope.groot.service.models.DeleteVertexRequest; import com.alibaba.graphscope.groot.service.models.EdgeRequest; import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; -import com.alibaba.graphscope.groot.service.models.Property; import com.alibaba.graphscope.groot.service.models.VertexRequest; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; - import com.alibaba.graphscope.groot.service.api.ApiUtil; import com.alibaba.graphscope.groot.service.api.V1Api; import java.util.List; -import javax.validation.Valid; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -29,7 +24,6 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -44,7 +38,8 @@ public class GrootController implements V1Api { private final SchemaManagementService schemaManagementService; @Autowired - public GrootController(VertexManagementService vertexService, EdgeManagementService edgeService, SchemaManagementService schemaManagementService) { + public GrootController(VertexManagementService vertexService, EdgeManagementService edgeService, + SchemaManagementService schemaManagementService) { this.vertexManagementService = vertexService; this.edgeManagementService = edgeService; this.schemaManagementService = schemaManagementService; @@ -71,10 +66,10 @@ public ResponseEntity addVertex( @DeleteMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity deleteVertex( @PathVariable("graph_id") String graphId, - @RequestParam(value = "label", required = true) String label, - @RequestBody(required = true) List primaryKeyValues) { + @RequestBody(required = true) DeleteVertexRequest deleteVertexRequest) { try { - long si = vertexManagementService.deleteVertex(label, primaryKeyValues); + long si = vertexManagementService.deleteVertex(deleteVertexRequest.getLabel(), + deleteVertexRequest.getPrimaryKeyValues()); return ApiUtil.createSuccessResponse("Vertex deleted successfully", si); } catch (Exception e) { e.printStackTrace(); @@ -120,12 +115,10 @@ public ResponseEntity addEdge( @DeleteMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity deleteEdge( @PathVariable("graph_id") String graphId, - @RequestParam(value = "edge_label", required = true) String label, - @RequestParam(value = "src_label", required = true) String srcLabel, - @RequestParam(value = "dst_label", required = true) String dstLabel, @RequestBody(required = true) DeleteEdgeRequest deleteEdgeRequest) { try { - long si = edgeManagementService.deleteEdge(label, srcLabel, dstLabel, + long si = edgeManagementService.deleteEdge(deleteEdgeRequest.getEdgeLabel(), + deleteEdgeRequest.getSrcLabel(), deleteEdgeRequest.getDstLabel(), deleteEdgeRequest.getSrcPrimaryKeyValues(), deleteEdgeRequest.getDstPrimaryKeyValues()); return ApiUtil.createSuccessResponse("Edge deleted successfully", si); } catch (Exception e) { @@ -157,7 +150,6 @@ public ResponseEntity createVertexType( @PathVariable("graph_id") String graphId, @RequestBody @Validated CreateVertexType createVertexType) { try { - System.out.println("createVertexType: " + createVertexType); schemaManagementService.createVertexType(graphId, createVertexType); return ApiUtil.createSuccessResponse("Vertex type created successfully"); } catch (Exception e) { @@ -180,6 +172,20 @@ public ResponseEntity deleteVertexTypeByName( } } + @Override + @PutMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateVertexType( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated CreateVertexType updateVertexType) { + try { + schemaManagementService.updateVertexType(graphId, updateVertexType); + return ApiUtil.createSuccessResponse("Vertex type updated successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex type"); + } + } + @Override @PostMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity createEdgeType( @@ -210,6 +216,20 @@ public ResponseEntity deleteEdgeTypeByName( } } + @Override + @PutMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateEdgeType( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated CreateEdgeType updateEdgeType) { + try { + schemaManagementService.updateEdgeType(graphId, updateEdgeType); + return ApiUtil.createSuccessResponse("Edge type updated successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge type"); + } + } + @Override @PostMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity importSchema( @@ -223,7 +243,6 @@ public ResponseEntity importSchema( return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to import schema"); } } - @Override @GetMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE) @@ -251,6 +270,4 @@ public ResponseEntity deleteSchema( } } - - } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java index 42cb3bbc60c0..bdcd219635a0 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java @@ -34,49 +34,68 @@ public SchemaManagementService(GrootClient grootClient) { public void createVertexType(String graphId, CreateVertexType createVertexType) { VertexLabel vLabelBuilder = createVertexLabel(graphId, createVertexType); - System.out.println("vLabelBuilder: "); - System.out.println(vLabelBuilder); Schema.Builder schema = Schema.newBuilder(); schema.addVertexLabel(vLabelBuilder); - GraphDefPb res = grootClient.submitSchema(schema); - System.out.println("res: " + res); + grootClient.submitSchema(schema); } public void deleteVertexType(String graphId, String vertexType) { - VertexLabel.Builder vLabelBuilder = VertexLabel.newBuilder(); - vLabelBuilder.setLabel(vertexType); + VertexLabel.Builder vLabelBuilder = VertexLabel.newBuilder().setLabel(vertexType); Schema.Builder schema = Schema.newBuilder(); schema.dropVertexLabel(vLabelBuilder); grootClient.submitSchema(schema); } + public void updateVertexType(String graphId, CreateVertexType updateVertexType) { + VertexLabel vLabel = createVertexLabel(graphId, updateVertexType); + Schema.Builder schema = Schema.newBuilder(); + schema.addVertexLabelProperties(vLabel); + grootClient.submitSchema(schema); + } + public void createEdgeType(String graphId, CreateEdgeType createEdgeType) { - EdgeLabel eLabelBuilder = createEdgeLabel(graphId, createEdgeType); + EdgeLabel eLabel = createEdgeLabel(graphId, createEdgeType); Schema.Builder schema = Schema.newBuilder(); - schema.addEdgeLabel(eLabelBuilder); + schema.addEdgeLabel(eLabel); grootClient.submitSchema(schema); } public void deleteEdgeType(String graphId, String edgeType, String srcVertexType, String dstVertexType) { - EdgeLabel.Builder eLabelBuilder = EdgeLabel.newBuilder(); - eLabelBuilder.setLabel(edgeType); - eLabelBuilder.addRelation(srcVertexType, dstVertexType); + // Delete edge relation, if it is the only relation, then delete edge label + EdgeLabel.Builder eKindBuilder = EdgeLabel.newBuilder(); + eKindBuilder.setLabel(edgeType); + eKindBuilder.addRelation(srcVertexType, dstVertexType); Schema.Builder schema = Schema.newBuilder(); - schema.dropEdgeLabelOrKind(eLabelBuilder); + schema.dropEdgeLabelOrKind(eKindBuilder); + GraphDefPb grootGraphDefPb = grootClient.submitSchema(schema); + if (grootGraphDefPb.getEdgeKindsList().stream().noneMatch(edgeKind -> edgeKind.getEdgeLabel().equals(edgeType))) { + // no more edgeKind with the given edge label, so we can delete it. + EdgeLabel.Builder eLabelBuilder = EdgeLabel.newBuilder(); + eLabelBuilder.setLabel(edgeType); + Schema.Builder schema2 = Schema.newBuilder(); + schema2.dropEdgeLabelOrKind(eLabelBuilder); + grootClient.submitSchema(schema2); + } + } + + public void updateEdgeType(String graphId, CreateEdgeType updateEdgeType) { + EdgeLabel eLabel = createEdgeLabel(graphId, updateEdgeType); + Schema.Builder schema = Schema.newBuilder(); + schema.addEdgeLabelProperties(eLabel); grootClient.submitSchema(schema); } - public void importSchema(String graphId, CreateGraphSchemaRequest schema) { - Schema.Builder grootSchema = Schema.newBuilder(); - for (CreateVertexType vertexType : schema.getVertexTypes()) { - VertexLabel vLabelBuilder = createVertexLabel(graphId, vertexType); - grootSchema.addVertexLabel(vLabelBuilder); + public void importSchema(String graphId, CreateGraphSchemaRequest createSchema) { + Schema.Builder schema = Schema.newBuilder(); + for (CreateVertexType vertexType : createSchema.getVertexTypes()) { + VertexLabel vLabel = createVertexLabel(graphId, vertexType); + schema.addVertexLabel(vLabel); } - for (CreateEdgeType edgeType : schema.getEdgeTypes()) { - EdgeLabel eLabelBuilder = createEdgeLabel(graphId, edgeType); - grootSchema.addEdgeLabel(eLabelBuilder); + for (CreateEdgeType edgeType : createSchema.getEdgeTypes()) { + EdgeLabel eLabel = createEdgeLabel(graphId, edgeType); + schema.addEdgeLabel(eLabel); } - grootClient.submitSchema(grootSchema); + grootClient.submitSchema(schema); } public GetGraphSchemaResponse getSchema(String graphId) { @@ -92,21 +111,19 @@ public GetGraphSchemaResponse getSchema(String graphId) { } public void dropSchema(String graphId) { - // TODO: seems not working grootClient.dropSchema(); } private VertexLabel createVertexLabel(String graphId, CreateVertexType createVertexType) { VertexLabel.Builder vLabelBuilder = VertexLabel.newBuilder(); vLabelBuilder.setLabel(createVertexType.getTypeName()); - for (String pk : createVertexType.getPrimaryKeys()) { - // TODO: set datatype for primary key - Property.Builder property = Property.newBuilder().setName(pk).setDataType(DataTypePb.STRING).setPrimaryKey(); - vLabelBuilder.addProperty(property); - } + List primaryKeys = createVertexType.getPrimaryKeys(); for (CreatePropertyMeta prop : createVertexType.getProperties()) { DataTypePb dataType = DtoConverter.convertToDataTypePb(prop.getPropertyType()); Property.Builder property = Property.newBuilder().setName(prop.getPropertyName()).setDataType(dataType); + if (primaryKeys.contains(prop.getPropertyName())) { + property.setPrimaryKey(); + } vLabelBuilder.addProperty(property); } return vLabelBuilder.build(); diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java new file mode 100644 index 000000000000..24adc9414642 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java @@ -0,0 +1,122 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.Property; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * DeleteVertexRequest + */ + +@JsonTypeName("delete_vertex_request") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T10:36:33.439661+08:00[Asia/Shanghai]") +public class DeleteVertexRequest { + + private String label; + + @Valid + private List<@Valid Property> primaryKeyValues; + + public DeleteVertexRequest label(String label) { + this.label = label; + return this; + } + + /** + * The label name of the vertex to delete. + * @return label + */ + + @Schema(name = "label", description = "The label name of the vertex to delete.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("label") + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public DeleteVertexRequest primaryKeyValues(List<@Valid Property> primaryKeyValues) { + this.primaryKeyValues = primaryKeyValues; + return this; + } + + public DeleteVertexRequest addPrimaryKeyValuesItem(Property primaryKeyValuesItem) { + if (this.primaryKeyValues == null) { + this.primaryKeyValues = new ArrayList<>(); + } + this.primaryKeyValues.add(primaryKeyValuesItem); + return this; + } + + /** + * The primary key values for locating the vertex. + * @return primaryKeyValues + */ + @Valid + @Schema(name = "primary_key_values", description = "The primary key values for locating the vertex.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("primary_key_values") + public List<@Valid Property> getPrimaryKeyValues() { + return primaryKeyValues; + } + + public void setPrimaryKeyValues(List<@Valid Property> primaryKeyValues) { + this.primaryKeyValues = primaryKeyValues; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteVertexRequest deleteVertexRequest = (DeleteVertexRequest) o; + return Objects.equals(this.label, deleteVertexRequest.label) && + Objects.equals(this.primaryKeyValues, deleteVertexRequest.primaryKeyValues); + } + + @Override + public int hashCode() { + return Objects.hash(label, primaryKeyValues); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteVertexRequest {\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" primaryKeyValues: ").append(toIndentedString(primaryKeyValues)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateEdgeType.java new file mode 100644 index 000000000000..988f08db04cf --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateEdgeType.java @@ -0,0 +1,154 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; +import com.alibaba.graphscope.groot.service.models.CreatePropertyMeta; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * UpdateEdgeType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-24T17:33:47.196892+08:00[Asia/Shanghai]") +public class UpdateEdgeType { + + private String typeName; + + @Valid + private List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations; + + @Valid + private List<@Valid CreatePropertyMeta> propertiesToAdd; + + public UpdateEdgeType typeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get typeName + * @return typeName + */ + + @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_name") + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public UpdateEdgeType vertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { + this.vertexTypePairRelations = vertexTypePairRelations; + return this; + } + + public UpdateEdgeType addVertexTypePairRelationsItem(BaseEdgeTypeVertexTypePairRelationsInner vertexTypePairRelationsItem) { + if (this.vertexTypePairRelations == null) { + this.vertexTypePairRelations = new ArrayList<>(); + } + this.vertexTypePairRelations.add(vertexTypePairRelationsItem); + return this; + } + + /** + * Get vertexTypePairRelations + * @return vertexTypePairRelations + */ + @Valid + @Schema(name = "vertex_type_pair_relations", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("vertex_type_pair_relations") + public List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> getVertexTypePairRelations() { + return vertexTypePairRelations; + } + + public void setVertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { + this.vertexTypePairRelations = vertexTypePairRelations; + } + + public UpdateEdgeType propertiesToAdd(List<@Valid CreatePropertyMeta> propertiesToAdd) { + this.propertiesToAdd = propertiesToAdd; + return this; + } + + public UpdateEdgeType addPropertiesToAddItem(CreatePropertyMeta propertiesToAddItem) { + if (this.propertiesToAdd == null) { + this.propertiesToAdd = new ArrayList<>(); + } + this.propertiesToAdd.add(propertiesToAddItem); + return this; + } + + /** + * Get propertiesToAdd + * @return propertiesToAdd + */ + @Valid + @Schema(name = "properties_to_add", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("properties_to_add") + public List<@Valid CreatePropertyMeta> getPropertiesToAdd() { + return propertiesToAdd; + } + + public void setPropertiesToAdd(List<@Valid CreatePropertyMeta> propertiesToAdd) { + this.propertiesToAdd = propertiesToAdd; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEdgeType updateEdgeType = (UpdateEdgeType) o; + return Objects.equals(this.typeName, updateEdgeType.typeName) && + Objects.equals(this.vertexTypePairRelations, updateEdgeType.vertexTypePairRelations) && + Objects.equals(this.propertiesToAdd, updateEdgeType.propertiesToAdd); + } + + @Override + public int hashCode() { + return Objects.hash(typeName, vertexTypePairRelations, propertiesToAdd); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEdgeType {\n"); + sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); + sb.append(" vertexTypePairRelations: ").append(toIndentedString(vertexTypePairRelations)).append("\n"); + sb.append(" propertiesToAdd: ").append(toIndentedString(propertiesToAdd)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateVertexType.java new file mode 100644 index 000000000000..8afc40d1a566 --- /dev/null +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateVertexType.java @@ -0,0 +1,178 @@ +package com.alibaba.graphscope.groot.service.models; + +import java.net.URI; +import java.util.Objects; +import com.alibaba.graphscope.groot.service.models.BaseVertexTypeXCsrParams; +import com.alibaba.graphscope.groot.service.models.CreatePropertyMeta; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * UpdateVertexType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-24T17:33:47.196892+08:00[Asia/Shanghai]") +public class UpdateVertexType { + + private String typeName; + + @Valid + private List primaryKeys; + + private BaseVertexTypeXCsrParams xCsrParams; + + @Valid + private List<@Valid CreatePropertyMeta> propertiesToAdd; + + public UpdateVertexType typeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get typeName + * @return typeName + */ + + @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type_name") + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public UpdateVertexType primaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + return this; + } + + public UpdateVertexType addPrimaryKeysItem(String primaryKeysItem) { + if (this.primaryKeys == null) { + this.primaryKeys = new ArrayList<>(); + } + this.primaryKeys.add(primaryKeysItem); + return this; + } + + /** + * Get primaryKeys + * @return primaryKeys + */ + + @Schema(name = "primary_keys", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("primary_keys") + public List getPrimaryKeys() { + return primaryKeys; + } + + public void setPrimaryKeys(List primaryKeys) { + this.primaryKeys = primaryKeys; + } + + public UpdateVertexType xCsrParams(BaseVertexTypeXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + return this; + } + + /** + * Get xCsrParams + * @return xCsrParams + */ + @Valid + @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("x_csr_params") + public BaseVertexTypeXCsrParams getxCsrParams() { + return xCsrParams; + } + + public void setxCsrParams(BaseVertexTypeXCsrParams xCsrParams) { + this.xCsrParams = xCsrParams; + } + + public UpdateVertexType propertiesToAdd(List<@Valid CreatePropertyMeta> propertiesToAdd) { + this.propertiesToAdd = propertiesToAdd; + return this; + } + + public UpdateVertexType addPropertiesToAddItem(CreatePropertyMeta propertiesToAddItem) { + if (this.propertiesToAdd == null) { + this.propertiesToAdd = new ArrayList<>(); + } + this.propertiesToAdd.add(propertiesToAddItem); + return this; + } + + /** + * Get propertiesToAdd + * @return propertiesToAdd + */ + @Valid + @Schema(name = "properties_to_add", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("properties_to_add") + public List<@Valid CreatePropertyMeta> getPropertiesToAdd() { + return propertiesToAdd; + } + + public void setPropertiesToAdd(List<@Valid CreatePropertyMeta> propertiesToAdd) { + this.propertiesToAdd = propertiesToAdd; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateVertexType updateVertexType = (UpdateVertexType) o; + return Objects.equals(this.typeName, updateVertexType.typeName) && + Objects.equals(this.primaryKeys, updateVertexType.primaryKeys) && + Objects.equals(this.xCsrParams, updateVertexType.xCsrParams) && + Objects.equals(this.propertiesToAdd, updateVertexType.propertiesToAdd); + } + + @Override + public int hashCode() { + return Objects.hash(typeName, primaryKeys, xCsrParams, propertiesToAdd); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateVertexType {\n"); + sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); + sb.append(" primaryKeys: ").append(toIndentedString(primaryKeys)).append("\n"); + sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); + sb.append(" propertiesToAdd: ").append(toIndentedString(propertiesToAdd)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/interactive_engine/groot-http/src/main/resources/openapi.yaml b/interactive_engine/groot-http/src/main/resources/openapi.yaml index 91f368aa2576..7ec9a26854bd 100644 --- a/interactive_engine/groot-http/src/main/resources/openapi.yaml +++ b/interactive_engine/groot-http/src/main/resources/openapi.yaml @@ -256,9 +256,9 @@ paths: x-tags: - tag: AdminService/GraphManagement /v1/graph/{graph_id}/schema/vertex: - post: - description: Create a vertex type - operationId: createVertexType + delete: + description: Delete a vertex type by name + operationId: deleteVertexTypeByName parameters: - explode: false in: path @@ -267,33 +267,32 @@ paths: schema: type: string style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateVertexType' + - explode: true + in: query + name: type_name required: true + schema: + type: string + style: form responses: "200": content: application/json: schema: $ref: '#/components/schemas/APIResponse' - description: Successful created a vertex type + description: Successfully deleted the vertex type "400": $ref: '#/components/responses/400' "500": $ref: '#/components/responses/500' tags: - AdminService/GraphManagement - x-content-type: application/json x-accepts: application/json x-tags: - tag: AdminService/GraphManagement - /v1/graph/{graph_id}/schema/vertex/{type_name}: - delete: - description: Delete vertex type by name - operationId: deleteVertexTypeByName + post: + description: Create a vertex type + operationId: createVertexType parameters: - explode: false in: path @@ -302,31 +301,32 @@ paths: schema: type: string style: simple - - explode: false - in: path - name: type_name + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateVertexType' required: true - schema: - type: string - style: simple responses: "200": content: application/json: schema: $ref: '#/components/schemas/APIResponse' - description: Successful deleted the vertex type + description: Successfully created the vertex type + "400": + $ref: '#/components/responses/400' "500": $ref: '#/components/responses/500' tags: - AdminService/GraphManagement + x-content-type: application/json x-accepts: application/json x-tags: - tag: AdminService/GraphManagement - /v1/graph/{graph_id}/schema/edge: - post: - description: Create a edge type - operationId: createEdgeType + put: + description: Update a vertex type to add more properties + operationId: updateVertexType parameters: - explode: false in: path @@ -339,14 +339,15 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateEdgeType' + $ref: '#/components/schemas/CreateVertexType' + required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/APIResponse' - description: Successful created the edge type + description: Successfully updated the vertex type "400": $ref: '#/components/responses/400' "500": @@ -357,9 +358,9 @@ paths: x-accepts: application/json x-tags: - tag: AdminService/GraphManagement - /v1/graph/{graph_id}/schema/edge/{type_name}: + /v1/graph/{graph_id}/schema/edge: delete: - description: Delete edge type by name + description: Delete an edge type by name operationId: deleteEdgeTypeByName parameters: - explode: false @@ -369,13 +370,13 @@ paths: schema: type: string style: simple - - explode: false - in: path + - explode: true + in: query name: type_name required: true schema: type: string - style: simple + style: form - explode: true in: query name: source_vertex_type @@ -396,7 +397,9 @@ paths: application/json: schema: $ref: '#/components/schemas/APIResponse' - description: Successful deleted the edge type + description: Successfully deleted the edge type + "400": + $ref: '#/components/responses/400' "500": $ref: '#/components/responses/500' tags: @@ -404,6 +407,73 @@ paths: x-accepts: application/json x-tags: - tag: AdminService/GraphManagement + post: + description: Create a edge type + operationId: createEdgeType + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEdgeType' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful created the edge type + "400": + $ref: '#/components/responses/400' + "500": + $ref: '#/components/responses/500' + tags: + - AdminService/GraphManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement + put: + description: Update an edge type to add more properties + operationId: updateEdgeType + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEdgeType' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully updated the edge type + "400": + $ref: '#/components/responses/400' + "500": + $ref: '#/components/responses/500' + tags: + - AdminService/GraphManagement + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: AdminService/GraphManagement /v1/graph/{graph_id}/statistics: get: description: "Get the statics info of a graph, including number of vertices\ @@ -883,22 +953,12 @@ paths: schema: type: string style: simple - - description: The label name of querying vertex. - explode: true - in: query - name: label - required: true - schema: - type: string - style: form requestBody: content: application/json: schema: - items: - $ref: '#/components/schemas/Property' - type: array - description: The primary key values of the vertex to delete. + $ref: '#/components/schemas/delete_vertex_request' + description: The label and primary key values of the vertex to be deleted. required: true responses: "200": @@ -1163,39 +1223,13 @@ paths: schema: type: string style: simple - - description: The label name of edge. - example: created - explode: true - in: query - name: edge_label - required: true - schema: - type: string - style: form - - description: The label name of src vertex. - example: person - explode: true - in: query - name: src_label - required: true - schema: - type: string - style: form - - description: The label name of dst vertex. - example: software - explode: true - in: query - name: dst_label - required: true - schema: - type: string - style: form requestBody: content: application/json: schema: $ref: '#/components/schemas/delete_edge_request' - description: The primary key values of the src and dst vertices. + description: "The label and primary key values of the src and dst vertices,\ + \ and the edge label." required: true responses: "200": @@ -2961,13 +2995,38 @@ components: - edge_request - vertex_request type: object + delete_vertex_request: + properties: + label: + description: The label name of the vertex to delete. + type: string + primary_key_values: + description: The primary key values for locating the vertex. + items: + $ref: '#/components/schemas/Property' + type: array + type: object delete_edge_request: properties: + edge_label: + description: The label name of the edge. + example: created + type: string + src_label: + description: The label name of the source vertex. + example: person + type: string + dst_label: + description: The label name of the destination vertex. + example: software + type: string src_primary_key_values: + description: Primary key values for the source vertex. items: $ref: '#/components/schemas/Property' type: array dst_primary_key_values: + description: Primary key values for the destination vertex. items: $ref: '#/components/schemas/Property' type: array From fa14e536ed7015ec1c336eeaa9a04f3fe8baa9bd Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Tue, 7 Jan 2025 13:55:17 +0800 Subject: [PATCH 08/23] minor fix Committed-by: bingqing.lbq from Dev container --- interactive_engine/assembly/pom.xml | 5 ++ .../graphscope/groot/service/api/V1Api.java | 2 +- .../service/models/APIResponseWithCode.java | 2 +- .../groot/service/models/BaseEdgeType.java | 2 +- ...eEdgeTypeVertexTypePairRelationsInner.java | 2 +- ...ertexTypePairRelationsInnerXCsrParams.java | 2 +- .../service/models/BasePropertyMeta.java | 2 +- .../groot/service/models/BaseVertexType.java | 2 +- .../models/BaseVertexTypeXCsrParams.java | 2 +- .../groot/service/models/ColumnMapping.java | 2 +- .../groot/service/models/CreateEdgeType.java | 2 +- .../service/models/CreateGraphRequest.java | 2 +- .../service/models/CreateGraphResponse.java | 2 +- .../models/CreateGraphSchemaRequest.java | 2 +- .../models/CreateProcedureRequest.java | 2 +- .../models/CreateProcedureResponse.java | 2 +- .../service/models/CreatePropertyMeta.java | 2 +- .../service/models/CreateVertexType.java | 2 +- .../groot/service/models/DateType.java | 2 +- .../service/models/DeleteEdgeRequest.java | 86 +++++++++++++++++-- .../service/models/DeleteVertexRequest.java | 2 +- .../groot/service/models/EdgeData.java | 2 +- .../groot/service/models/EdgeMapping.java | 2 +- ...MappingDestinationVertexMappingsInner.java | 2 +- .../EdgeMappingSourceVertexMappingsInner.java | 2 +- ...appingSourceVertexMappingsInnerColumn.java | 2 +- .../models/EdgeMappingTypeTriplet.java | 2 +- .../groot/service/models/EdgeRequest.java | 2 +- .../groot/service/models/EdgeStatistics.java | 2 +- .../groot/service/models/FixedChar.java | 2 +- .../groot/service/models/FixedCharChar.java | 2 +- .../groot/service/models/GetEdgeType.java | 2 +- .../service/models/GetGraphResponse.java | 2 +- .../models/GetGraphSchemaResponse.java | 2 +- .../models/GetGraphStatisticsResponse.java | 2 +- .../service/models/GetProcedureResponse.java | 2 +- .../groot/service/models/GetPropertyMeta.java | 2 +- .../groot/service/models/GetVertexType.java | 2 +- .../groot/service/models/JobResponse.java | 2 +- .../groot/service/models/JobStatus.java | 2 +- .../groot/service/models/LongText.java | 2 +- .../groot/service/models/Parameter.java | 2 +- .../groot/service/models/PrimitiveType.java | 2 +- .../groot/service/models/Property.java | 2 +- .../groot/service/models/QueryRequest.java | 2 +- .../groot/service/models/SchemaMapping.java | 2 +- .../models/SchemaMappingLoadingConfig.java | 2 +- .../SchemaMappingLoadingConfigDataSource.java | 2 +- .../SchemaMappingLoadingConfigFormat.java | 2 +- .../SchemaMappingLoadingConfigXCsrParams.java | 2 +- .../groot/service/models/ServiceStatus.java | 2 +- .../service/models/StartServiceRequest.java | 2 +- .../service/models/StopServiceRequest.java | 2 +- .../service/models/StoredProcedureMeta.java | 2 +- .../groot/service/models/StringType.java | 2 +- .../service/models/StringTypeString.java | 2 +- .../groot/service/models/TemporalType.java | 2 +- .../service/models/TemporalTypeTemporal.java | 2 +- .../groot/service/models/TimeStampType.java | 2 +- .../groot/service/models/TypedValue.java | 2 +- .../models/UpdateProcedureRequest.java | 2 +- .../service/models/UploadFileResponse.java | 2 +- .../groot/service/models/VarChar.java | 2 +- .../groot/service/models/VarCharVarChar.java | 2 +- .../groot/service/models/VertexData.java | 2 +- .../service/models/VertexEdgeRequest.java | 2 +- .../groot/service/models/VertexMapping.java | 2 +- .../groot/service/models/VertexRequest.java | 2 +- .../service/models/VertexStatistics.java | 2 +- .../models/VertexTypePairStatistics.java | 2 +- 70 files changed, 152 insertions(+), 75 deletions(-) diff --git a/interactive_engine/assembly/pom.xml b/interactive_engine/assembly/pom.xml index 39b0aa02ea32..2ddf36a64810 100644 --- a/interactive_engine/assembly/pom.xml +++ b/interactive_engine/assembly/pom.xml @@ -64,6 +64,11 @@ groot-server ${project.version} + + com.alibaba.graphscope + groot-http + ${project.version} + com.alibaba.graphscope executor diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java index 95922473fa65..9bf6e0e6c851 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java @@ -57,7 +57,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-25T20:15:37.362177+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") @Validated @Tag(name = "GraphService/EdgeManagement", description = "EdgeManagement") public interface V1Api { diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java index 7ceca4ccbdcb..37a701378144 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java @@ -18,7 +18,7 @@ * APIResponseWithCode */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class APIResponseWithCode { private Integer code; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java index ce23cef205f5..0fc59b0bf8d2 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java @@ -22,7 +22,7 @@ * BaseEdgeType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class BaseEdgeType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java index 328c63034842..5e5603837442 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java @@ -22,7 +22,7 @@ */ @JsonTypeName("BaseEdgeType_vertex_type_pair_relations_inner") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class BaseEdgeTypeVertexTypePairRelationsInner { private String sourceVertex; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java index 76de7d7b5321..2ec4d7fc89c2 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java @@ -22,7 +22,7 @@ @Schema(name = "BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params", description = "Used for storage optimization") @JsonTypeName("BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams { /** diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java index 00ae9f0f9acb..28d5a30151a1 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java @@ -19,7 +19,7 @@ * BasePropertyMeta */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class BasePropertyMeta { private String propertyName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java index 3c951cabbcc9..f7ac6ae3cb71 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java @@ -22,7 +22,7 @@ * BaseVertexType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class BaseVertexType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java index 89087202a306..6f72e493eadd 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java @@ -21,7 +21,7 @@ @Schema(name = "BaseVertexType_x_csr_params", description = "Used for storage optimization") @JsonTypeName("BaseVertexType_x_csr_params") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class BaseVertexTypeXCsrParams { private Integer maxVertexNum; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java index 747f4b8de82b..463cff2c29bb 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java @@ -19,7 +19,7 @@ * ColumnMapping */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class ColumnMapping { private EdgeMappingSourceVertexMappingsInnerColumn column; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java index 2ba41342ab02..77e88a1919c5 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java @@ -23,7 +23,7 @@ * CreateEdgeType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class CreateEdgeType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java index 9f22d5c9f20a..81bb86b9d399 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java @@ -23,7 +23,7 @@ * CreateGraphRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class CreateGraphRequest { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java index 25d9a67259b0..1614db7a05c6 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java @@ -18,7 +18,7 @@ * CreateGraphResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class CreateGraphResponse { private String graphId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java index ab0a17087b69..09e0ebf6c161 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java @@ -23,7 +23,7 @@ * CreateGraphSchemaRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class CreateGraphSchemaRequest { @Valid diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java index 1cbd98137d55..f49c30aba6b7 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java @@ -19,7 +19,7 @@ * CreateProcedureRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class CreateProcedureRequest { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java index 712d2a70a572..b59f5901c83e 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java @@ -18,7 +18,7 @@ * CreateProcedureResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class CreateProcedureResponse { private String procedureId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java index 12f91fc60fe9..e3af28a6cae8 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java @@ -19,7 +19,7 @@ * CreatePropertyMeta */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class CreatePropertyMeta { private String propertyName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java index 8b98446d7a15..0a78284874bd 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java @@ -23,7 +23,7 @@ * CreateVertexType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class CreateVertexType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java index 54e8dd93ffda..a8c99188c1f1 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java @@ -19,7 +19,7 @@ * DateType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class DateType implements TemporalTypeTemporal { private String date32; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java index 15f114165443..c200c7b542e3 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java @@ -24,15 +24,81 @@ */ @JsonTypeName("delete_edge_request") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class DeleteEdgeRequest { + private String edgeLabel; + + private String srcLabel; + + private String dstLabel; + @Valid private List<@Valid Property> srcPrimaryKeyValues; @Valid private List<@Valid Property> dstPrimaryKeyValues; + public DeleteEdgeRequest edgeLabel(String edgeLabel) { + this.edgeLabel = edgeLabel; + return this; + } + + /** + * The label name of the edge. + * @return edgeLabel + */ + + @Schema(name = "edge_label", example = "created", description = "The label name of the edge.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("edge_label") + public String getEdgeLabel() { + return edgeLabel; + } + + public void setEdgeLabel(String edgeLabel) { + this.edgeLabel = edgeLabel; + } + + public DeleteEdgeRequest srcLabel(String srcLabel) { + this.srcLabel = srcLabel; + return this; + } + + /** + * The label name of the source vertex. + * @return srcLabel + */ + + @Schema(name = "src_label", example = "person", description = "The label name of the source vertex.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("src_label") + public String getSrcLabel() { + return srcLabel; + } + + public void setSrcLabel(String srcLabel) { + this.srcLabel = srcLabel; + } + + public DeleteEdgeRequest dstLabel(String dstLabel) { + this.dstLabel = dstLabel; + return this; + } + + /** + * The label name of the destination vertex. + * @return dstLabel + */ + + @Schema(name = "dst_label", example = "software", description = "The label name of the destination vertex.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dst_label") + public String getDstLabel() { + return dstLabel; + } + + public void setDstLabel(String dstLabel) { + this.dstLabel = dstLabel; + } + public DeleteEdgeRequest srcPrimaryKeyValues(List<@Valid Property> srcPrimaryKeyValues) { this.srcPrimaryKeyValues = srcPrimaryKeyValues; return this; @@ -47,11 +113,11 @@ public DeleteEdgeRequest addSrcPrimaryKeyValuesItem(Property srcPrimaryKeyValues } /** - * Get srcPrimaryKeyValues + * Primary key values for the source vertex. * @return srcPrimaryKeyValues */ @Valid - @Schema(name = "src_primary_key_values", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(name = "src_primary_key_values", description = "Primary key values for the source vertex.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("src_primary_key_values") public List<@Valid Property> getSrcPrimaryKeyValues() { return srcPrimaryKeyValues; @@ -75,11 +141,11 @@ public DeleteEdgeRequest addDstPrimaryKeyValuesItem(Property dstPrimaryKeyValues } /** - * Get dstPrimaryKeyValues + * Primary key values for the destination vertex. * @return dstPrimaryKeyValues */ @Valid - @Schema(name = "dst_primary_key_values", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(name = "dst_primary_key_values", description = "Primary key values for the destination vertex.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dst_primary_key_values") public List<@Valid Property> getDstPrimaryKeyValues() { return dstPrimaryKeyValues; @@ -98,19 +164,25 @@ public boolean equals(Object o) { return false; } DeleteEdgeRequest deleteEdgeRequest = (DeleteEdgeRequest) o; - return Objects.equals(this.srcPrimaryKeyValues, deleteEdgeRequest.srcPrimaryKeyValues) && + return Objects.equals(this.edgeLabel, deleteEdgeRequest.edgeLabel) && + Objects.equals(this.srcLabel, deleteEdgeRequest.srcLabel) && + Objects.equals(this.dstLabel, deleteEdgeRequest.dstLabel) && + Objects.equals(this.srcPrimaryKeyValues, deleteEdgeRequest.srcPrimaryKeyValues) && Objects.equals(this.dstPrimaryKeyValues, deleteEdgeRequest.dstPrimaryKeyValues); } @Override public int hashCode() { - return Objects.hash(srcPrimaryKeyValues, dstPrimaryKeyValues); + return Objects.hash(edgeLabel, srcLabel, dstLabel, srcPrimaryKeyValues, dstPrimaryKeyValues); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DeleteEdgeRequest {\n"); + sb.append(" edgeLabel: ").append(toIndentedString(edgeLabel)).append("\n"); + sb.append(" srcLabel: ").append(toIndentedString(srcLabel)).append("\n"); + sb.append(" dstLabel: ").append(toIndentedString(dstLabel)).append("\n"); sb.append(" srcPrimaryKeyValues: ").append(toIndentedString(srcPrimaryKeyValues)).append("\n"); sb.append(" dstPrimaryKeyValues: ").append(toIndentedString(dstPrimaryKeyValues)).append("\n"); sb.append("}"); diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java index 24adc9414642..fc2a09939c7b 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java @@ -24,7 +24,7 @@ */ @JsonTypeName("delete_vertex_request") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T10:36:33.439661+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class DeleteVertexRequest { private String label; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java index a1c2814d4c65..87731bc126bf 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java @@ -22,7 +22,7 @@ * EdgeData */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class EdgeData { private String srcLabel; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java index 1c33d1feb790..f5c0907988cc 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java @@ -25,7 +25,7 @@ * EdgeMapping */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class EdgeMapping { private EdgeMappingTypeTriplet typeTriplet; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java index 05949f1ceb03..3d9d5d47f5d2 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java @@ -22,7 +22,7 @@ @Schema(name = "EdgeMapping_destination_vertex_mappings_inner", description = "Mapping column to the primary key of destination vertex") @JsonTypeName("EdgeMapping_destination_vertex_mappings_inner") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class EdgeMappingDestinationVertexMappingsInner { private EdgeMappingSourceVertexMappingsInnerColumn column; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java index 68b0a68a3ade..ad91cb234a8b 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java @@ -22,7 +22,7 @@ @Schema(name = "EdgeMapping_source_vertex_mappings_inner", description = "Mapping column to the primary key of source vertex") @JsonTypeName("EdgeMapping_source_vertex_mappings_inner") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class EdgeMappingSourceVertexMappingsInner { private EdgeMappingSourceVertexMappingsInnerColumn column; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java index b1a416d8a41f..c04ff1cfa577 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java @@ -20,7 +20,7 @@ */ @JsonTypeName("EdgeMapping_source_vertex_mappings_inner_column") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class EdgeMappingSourceVertexMappingsInnerColumn { private Integer index; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java index 18fbf76a3f2f..d0c9b3a768a2 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java @@ -21,7 +21,7 @@ @Schema(name = "EdgeMapping_type_triplet", description = "source label -> [edge label] -> destination label") @JsonTypeName("EdgeMapping_type_triplet") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class EdgeMappingTypeTriplet { private String edge; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java index a4bbaf8ca7c5..f411a1174ed2 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java @@ -22,7 +22,7 @@ * EdgeRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class EdgeRequest { private String srcLabel; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java index 8eef9424e750..987e7d03c101 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java @@ -22,7 +22,7 @@ * EdgeStatistics */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class EdgeStatistics { private Integer typeId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java index f8379d6e70c5..766be43a4cda 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java @@ -20,7 +20,7 @@ * FixedChar */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class FixedChar implements StringTypeString { private FixedCharChar _char; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java index e62384c395b4..792a46f02364 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java @@ -20,7 +20,7 @@ */ @JsonTypeName("FixedChar_char") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class FixedCharChar { private Integer fixedLength; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java index fc789b16283d..5aa1f9e1f386 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java @@ -23,7 +23,7 @@ * GetEdgeType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class GetEdgeType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java index 738b80cb2c70..77d15d2655ed 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java @@ -25,7 +25,7 @@ * GetGraphResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class GetGraphResponse { private String version; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java index 050a64c05e99..bd045197d498 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java @@ -23,7 +23,7 @@ * GetGraphSchemaResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class GetGraphSchemaResponse { @Valid diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java index cde52546d827..eb579db9d91e 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java @@ -23,7 +23,7 @@ * GetGraphStatisticsResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class GetGraphStatisticsResponse { private Integer totalVertexCount; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java index 1cf8ac0d4adc..a2c159ea5161 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java @@ -25,7 +25,7 @@ * GetProcedureResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class GetProcedureResponse { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java index 0faae018f4b5..40e9843d59e4 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java @@ -19,7 +19,7 @@ * GetPropertyMeta */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class GetPropertyMeta { private String propertyName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java index aaadcdd8a635..1c900f530268 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java @@ -23,7 +23,7 @@ * GetVertexType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class GetVertexType { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java index 519942501203..7a83f8a16a30 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java @@ -18,7 +18,7 @@ * JobResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class JobResponse { private String jobId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java index e37ba93a2520..584d802289c8 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java @@ -21,7 +21,7 @@ * JobStatus */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class JobStatus { private String id; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java index 2a11a113d6f9..3147a5895d6c 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java @@ -19,7 +19,7 @@ * LongText */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class LongText implements StringTypeString { private JsonNullable longText = JsonNullable.undefined(); diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java index 322781ed94ca..0d056930d27c 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java @@ -19,7 +19,7 @@ * Parameter */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class Parameter { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java index f5d2e7bdc54a..9382d5f95314 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java @@ -19,7 +19,7 @@ * PrimitiveType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class PrimitiveType implements GSDataType { /** diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java index d23fe1731390..00e8bb1ee89a 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java @@ -18,7 +18,7 @@ * Property */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class Property { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java index b1622ce4b32f..5cf970c14df8 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java @@ -22,7 +22,7 @@ * QueryRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class QueryRequest { private String queryName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java index 41345c6e12bc..013dd6c39d41 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java @@ -24,7 +24,7 @@ * SchemaMapping */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class SchemaMapping { private SchemaMappingLoadingConfig loadingConfig; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java index 9c26004e9212..126703a218c3 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java @@ -24,7 +24,7 @@ */ @JsonTypeName("SchemaMapping_loading_config") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class SchemaMappingLoadingConfig { private SchemaMappingLoadingConfigXCsrParams xCsrParams; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java index 9cb445ffd320..c19c2d2a6051 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java @@ -21,7 +21,7 @@ */ @JsonTypeName("SchemaMapping_loading_config_data_source") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class SchemaMappingLoadingConfigDataSource { /** diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java index 70dec56d6c1a..68ae03a7318b 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java @@ -22,7 +22,7 @@ */ @JsonTypeName("SchemaMapping_loading_config_format") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class SchemaMappingLoadingConfigFormat { private String type; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java index 0e465cc47a5a..3774e6449955 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java @@ -21,7 +21,7 @@ @Schema(name = "SchemaMapping_loading_config_x_csr_params", description = "mutable_csr specific parameters") @JsonTypeName("SchemaMapping_loading_config_x_csr_params") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class SchemaMappingLoadingConfigXCsrParams { private Integer parallelism; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java index ccf453d337be..c6957c9f6328 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java @@ -19,7 +19,7 @@ * ServiceStatus */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class ServiceStatus { private Boolean statisticsEnabled; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java index 7444bfb5c793..ef7981c73a8a 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java @@ -18,7 +18,7 @@ * StartServiceRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class StartServiceRequest { private String graphId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java index 222792e218a4..96455c8dda55 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java @@ -21,7 +21,7 @@ * StopServiceRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class StopServiceRequest { private JsonNullable graphId = JsonNullable.undefined(); diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java index dad12d11adfb..aba1a0f8b49f 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java @@ -25,7 +25,7 @@ * StoredProcedureMeta */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class StoredProcedureMeta { private String name; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java index 6caf5ca4329b..17c7c6dfcdf4 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java @@ -20,7 +20,7 @@ * StringType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class StringType implements GSDataType { private StringTypeString string; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java index 58197d4a8d2a..08faa085145f 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java @@ -23,6 +23,6 @@ import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public interface StringTypeString { } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java index 0e4416a52a31..a762b8715fc5 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java @@ -20,7 +20,7 @@ * TemporalType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class TemporalType implements GSDataType { private TemporalTypeTemporal temporal; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java index 3e528e7b0b47..836059bb0565 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java @@ -20,6 +20,6 @@ import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public interface TemporalTypeTemporal { } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java index d37ef17965c7..977e13a8bdf1 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java @@ -19,7 +19,7 @@ * TimeStampType */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class TimeStampType implements TemporalTypeTemporal { private String timestamp; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java index eb2bc2c8d19e..ea5997ae8ac7 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java @@ -19,7 +19,7 @@ * TypedValue */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class TypedValue { private GSDataType type; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java index 80469e38bebd..7f0581e61a1d 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java @@ -18,7 +18,7 @@ * UpdateProcedureRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class UpdateProcedureRequest { private String description; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java index b8876d798274..b5e7f37b9ccc 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java @@ -20,7 +20,7 @@ * UploadFileResponse */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class UploadFileResponse { private String filePath; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java index 3c9623bcf08e..42aeeda4b787 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java @@ -20,7 +20,7 @@ * VarChar */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class VarChar implements StringTypeString { private VarCharVarChar varChar; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java index 009a5464911b..fb943fde433c 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java @@ -20,7 +20,7 @@ */ @JsonTypeName("VarChar_var_char") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class VarCharVarChar { private Integer maxLength; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java index 9abc38e346a4..70e57137add9 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java @@ -22,7 +22,7 @@ * VertexData */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class VertexData { private String label; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java index 2906116cee97..0621e2b23369 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java @@ -23,7 +23,7 @@ * VertexEdgeRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class VertexEdgeRequest { @Valid diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java index c53de657fd0d..cc926d25db81 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java @@ -22,7 +22,7 @@ * VertexMapping */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class VertexMapping { private String typeName; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java index 7c72c4f6c8f2..8c6612cb328e 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java @@ -22,7 +22,7 @@ * VertexRequest */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class VertexRequest { private String label; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java index 1774caf82dd1..009e89804ed7 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java @@ -18,7 +18,7 @@ * VertexStatistics */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class VertexStatistics { private Integer typeId; diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java index 0b6e78f33d09..d1e7b1e59502 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java @@ -18,7 +18,7 @@ * VertexTypePairStatistics */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-23T19:19:20.896381+08:00[Asia/Shanghai]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") public class VertexTypePairStatistics { private String sourceVertex; From bd76cd34259efa33c73b113d67d0c51494f55f33 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Tue, 7 Jan 2025 17:08:04 +0800 Subject: [PATCH 09/23] fix pom in groot-http Committed-by: bingqing.lbq from Dev container --- interactive_engine/groot-http/pom.xml | 38 ++++++++++++++++++--------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/interactive_engine/groot-http/pom.xml b/interactive_engine/groot-http/pom.xml index 417c59d70191..cb9eb1b3fd4f 100644 --- a/interactive_engine/groot-http/pom.xml +++ b/interactive_engine/groot-http/pom.xml @@ -3,8 +3,8 @@ interactive-parent com.alibaba.graphscope ${revision} - ../pom.xml - + ../pom.xml + 4.0.0 groot-http jar @@ -17,15 +17,6 @@ 1.6.14 5.3.1 - - src/main/java - - - org.springframework.boot - spring-boot-maven-plugin - - - org.springframework.boot @@ -35,7 +26,7 @@ org.springframework.data spring-data-commons - + org.springdoc springdoc-openapi-ui @@ -74,9 +65,32 @@ spring-boot-starter-test test + + org.springframework.boot + spring-boot-starter + com.alibaba.graphscope groot-client + + src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + com.alibaba.graphscope.groot.OpenApiGeneratorApplication + + + + From 704bbd9266365eb905b0d1ddf324641962c98959 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Tue, 7 Jan 2025 17:55:17 +0800 Subject: [PATCH 10/23] start up groot-http in k8s Committed-by: bingqing.lbq from Dev container --- charts/graphscope-store/templates/configmap.yaml | 4 ++++ flex/interactive/sdk/generate_sdk.sh | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/graphscope-store/templates/configmap.yaml b/charts/graphscope-store/templates/configmap.yaml index c690d3f33809..54cb1b1359ae 100644 --- a/charts/graphscope-store/templates/configmap.yaml +++ b/charts/graphscope-store/templates/configmap.yaml @@ -171,6 +171,10 @@ data: # export MALLOC_CONF=prof:true,lg_prof_interval:29,lg_prof_sample:19,prof_prefix=/tmp export RUST_BACKTRACE=1 + if [ "$ROLE" = "frontend" ]; then + echo "Starting groot-http Spring Boot service..." + java -jar ${GRAPHSCOPE_HOME}/groot/lib/groot-http-0.0.1-SNAPSHOT.jar > /var/log/graphscope/groot-http.log 2>&1 & + fi ${GRAPHSCOPE_HOME}/groot/bin/store_ctl.sh start ${ROLE} # || sleep infinity portal_setup.sh: |- #!/bin/bash diff --git a/flex/interactive/sdk/generate_sdk.sh b/flex/interactive/sdk/generate_sdk.sh index 425a19bbfb59..fd45191d5cd0 100755 --- a/flex/interactive/sdk/generate_sdk.sh +++ b/flex/interactive/sdk/generate_sdk.sh @@ -83,7 +83,6 @@ function do_gen_python() { function do_gen_spring() { echo "Generating Spring API" - # TODO: make output path to groot-client path OUTPUT_PATH="${CUR_DIR}/../../../interactive_engine/groot-http" GROOT_PACKAGE_NAME="com.alibaba.graphscope.groot" GROOT_ARTIFACT_ID="groot-http" From 996fa08db6cf140ecd063fa5e141539f3af8e165 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Tue, 7 Jan 2025 19:19:56 +0800 Subject: [PATCH 11/23] generate spring codes in compilation Committed-by: bingqing.lbq from Dev container --- .../groot-http/.openapi-generator-ignore | 1 + interactive_engine/groot-http/pom.xml | 23 ++ interactive_engine/groot-http/pre-generate.sh | 19 + .../groot/service/api/V1ApiController.java | 350 ++++++++++++++---- .../groot/service/impl/GrootController.java | 273 -------------- 5 files changed, 316 insertions(+), 350 deletions(-) create mode 100755 interactive_engine/groot-http/pre-generate.sh delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java diff --git a/interactive_engine/groot-http/.openapi-generator-ignore b/interactive_engine/groot-http/.openapi-generator-ignore index 3023a818ae75..07aaa9885626 100644 --- a/interactive_engine/groot-http/.openapi-generator-ignore +++ b/interactive_engine/groot-http/.openapi-generator-ignore @@ -25,4 +25,5 @@ pom.xml src/main/java/com/alibaba/graphscope/groot/service/impl src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java +src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java \ No newline at end of file diff --git a/interactive_engine/groot-http/pom.xml b/interactive_engine/groot-http/pom.xml index cb9eb1b3fd4f..b2e34ae53386 100644 --- a/interactive_engine/groot-http/pom.xml +++ b/interactive_engine/groot-http/pom.xml @@ -77,6 +77,29 @@ src/main/java + + + org.codehaus.mojo + exec-maven-plugin + 3.0.0 + + + generate-sources + generate-sources + + exec + + + /bin/bash + + ${project.basedir}/pre-generate.sh + + + + + + + org.springframework.boot spring-boot-maven-plugin diff --git a/interactive_engine/groot-http/pre-generate.sh b/interactive_engine/groot-http/pre-generate.sh new file mode 100755 index 000000000000..25543c14e761 --- /dev/null +++ b/interactive_engine/groot-http/pre-generate.sh @@ -0,0 +1,19 @@ +#!/bin/bash +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" +SDK_SCRIPT_PATH="${SCRIPT_DIR}/../../flex/interactive/sdk/generate_sdk.sh" +LANGUAGE="spring" + +if [ ! -f "$SDK_SCRIPT_PATH" ]; then + echo "Error: SDK generation script not found at $SDK_SCRIPT_PATH" + exit 1 +fi + +echo "Generating Spring files using OpenAPI Generator..." +bash "$SDK_SCRIPT_PATH" -g "$LANGUAGE" + +if [ $? -ne 0 ]; then + echo "Failed to generate Spring files" + exit 1 +else + echo "Successfully generated Spring files" +fi \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java index f7c10b086c59..831114981651 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java @@ -1,77 +1,273 @@ -// package com.alibaba.graphscope.groot.service.api; - -// import com.alibaba.graphscope.groot.service.models.APIResponseWithCode; -// import com.alibaba.graphscope.groot.service.models.CreateGraphRequest; -// import com.alibaba.graphscope.groot.service.models.CreateGraphResponse; -// import com.alibaba.graphscope.groot.service.models.CreateProcedureRequest; -// import com.alibaba.graphscope.groot.service.models.CreateProcedureResponse; -// import com.alibaba.graphscope.groot.service.models.EdgeData; -// import com.alibaba.graphscope.groot.service.models.EdgeRequest; -// import com.alibaba.graphscope.groot.service.models.GetGraphResponse; -// import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; -// import com.alibaba.graphscope.groot.service.models.GetGraphStatisticsResponse; -// import com.alibaba.graphscope.groot.service.models.GetProcedureResponse; -// import com.alibaba.graphscope.groot.service.models.JobResponse; -// import com.alibaba.graphscope.groot.service.models.JobStatus; -// import com.alibaba.graphscope.groot.service.models.SchemaMapping; -// import com.alibaba.graphscope.groot.service.models.ServiceStatus; -// import com.alibaba.graphscope.groot.service.models.StartServiceRequest; -// import com.alibaba.graphscope.groot.service.models.StopServiceRequest; -// import com.alibaba.graphscope.groot.service.models.UpdateProcedureRequest; -// import com.alibaba.graphscope.groot.service.models.UploadFileResponse; -// import com.alibaba.graphscope.groot.service.models.VertexData; -// import com.alibaba.graphscope.groot.service.models.VertexEdgeRequest; -// import com.alibaba.graphscope.groot.service.models.VertexRequest; - - -// import org.springframework.beans.factory.annotation.Autowired; -// import org.springframework.http.HttpStatus; -// import org.springframework.http.MediaType; -// import org.springframework.http.ResponseEntity; -// import org.springframework.stereotype.Controller; -// import org.springframework.web.bind.annotation.PathVariable; -// import org.springframework.web.bind.annotation.RequestBody; -// import org.springframework.web.bind.annotation.RequestHeader; -// import org.springframework.web.bind.annotation.RequestMapping; -// import org.springframework.web.bind.annotation.CookieValue; -// import org.springframework.web.bind.annotation.RequestParam; -// import org.springframework.web.bind.annotation.RequestPart; -// import org.springframework.web.multipart.MultipartFile; -// import org.springframework.web.context.request.NativeWebRequest; - -// import javax.validation.constraints.*; -// import javax.validation.Valid; - -// import java.util.List; -// import java.util.Map; -// import java.util.Optional; -// import javax.annotation.Generated; - -// @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-17T16:29:16.306086+08:00[Asia/Shanghai]") -// @Controller -// @RequestMapping("${openapi.graphScopeInteractiveAPIV03.base-path:/GRAPHSCOPE/InteractiveAPI/1.0.0}") -// public class V1ApiController implements V1Api { - -// private final NativeWebRequest request; - -// @Autowired -// public V1ApiController(NativeWebRequest request) { -// this.request = request; -// } - -// @Override -// public Optional getRequest() { -// return Optional.ofNullable(request); -// } - -// @Override -// @RequestMapping(value = "/v1/graph/{graph_id}/adhoc_query", -// produces = { "text/plain", "application/json" }, -// consumes = { "text/plain" }) -// public ResponseEntity runAdhoc( -// @PathVariable("graph_id") String graphId, -// @RequestBody(required = false) byte[] body) { -// System.out.println("test 1111111111111111111111 runAdhoc"); -// return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); -// } -// } +package com.alibaba.graphscope.groot.service.api; + +import com.alibaba.graphscope.groot.service.impl.EdgeManagementService; +import com.alibaba.graphscope.groot.service.impl.SchemaManagementService; +import com.alibaba.graphscope.groot.service.impl.VertexManagementService; +import com.alibaba.graphscope.groot.service.models.CreateEdgeType; +import com.alibaba.graphscope.groot.service.models.CreateGraphSchemaRequest; +import com.alibaba.graphscope.groot.service.models.CreateVertexType; +import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; +import com.alibaba.graphscope.groot.service.models.DeleteVertexRequest; +import com.alibaba.graphscope.groot.service.models.EdgeRequest; +import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; +import com.alibaba.graphscope.groot.service.models.VertexRequest; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("${openapi.graphScopeInteractiveAPIV03.base-path:/v1/graph}") +public class V1ApiController implements V1Api { + + private final VertexManagementService vertexManagementService; + private final EdgeManagementService edgeManagementService; + private final SchemaManagementService schemaManagementService; + + @Autowired + public V1ApiController(VertexManagementService vertexService, EdgeManagementService edgeService, + SchemaManagementService schemaManagementService) { + this.vertexManagementService = vertexService; + this.edgeManagementService = edgeService; + this.schemaManagementService = schemaManagementService; + } + + @Override + @PostMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity addVertex( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated List vertexRequests) { + try { + if (vertexRequests.isEmpty()) { + return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Vertex request must not be empty"); + } + long si = vertexManagementService.addVertices(vertexRequests); + return ApiUtil.createSuccessResponse("Vertex added successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertex"); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteVertex( + @PathVariable("graph_id") String graphId, + @RequestBody(required = true) DeleteVertexRequest deleteVertexRequest) { + try { + long si = vertexManagementService.deleteVertex(deleteVertexRequest.getLabel(), + deleteVertexRequest.getPrimaryKeyValues()); + return ApiUtil.createSuccessResponse("Vertex deleted successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex"); + } + } + + @Override + @PutMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateVertex( + @PathVariable("graph_id") String graphId, + @RequestBody(required = false) VertexRequest vertexRequest) { + try { + if (vertexRequest == null) { + return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Request body must not be null"); + } + long si = vertexManagementService.updateVertex(vertexRequest); + return ApiUtil.createSuccessResponse("Vertex updated successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex"); + } + } + + @Override + @PostMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity addEdge( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated List edgeRequests) { + try { + if (edgeRequests.isEmpty()) { + return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Edge request must not be empty"); + } + long si = edgeManagementService.addEdges(edgeRequests); + return ApiUtil.createSuccessResponse("Edge added successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add edge"); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteEdge( + @PathVariable("graph_id") String graphId, + @RequestBody(required = true) DeleteEdgeRequest deleteEdgeRequest) { + try { + long si = edgeManagementService.deleteEdge(deleteEdgeRequest.getEdgeLabel(), + deleteEdgeRequest.getSrcLabel(), deleteEdgeRequest.getDstLabel(), + deleteEdgeRequest.getSrcPrimaryKeyValues(), deleteEdgeRequest.getDstPrimaryKeyValues()); + return ApiUtil.createSuccessResponse("Edge deleted successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge"); + } + } + + @Override + @PutMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateEdge( + @PathVariable("graph_id") String graphId, + @RequestBody(required = false) EdgeRequest edgeRequest) { + try { + if (edgeRequest == null) { + return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Request body must not be null"); + } + long si = edgeManagementService.updateEdge(edgeRequest); + return ApiUtil.createSuccessResponse("Edge updated successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge"); + } + } + + @Override + @PostMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity createVertexType( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated CreateVertexType createVertexType) { + try { + schemaManagementService.createVertexType(graphId, createVertexType); + return ApiUtil.createSuccessResponse("Vertex type created successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create vertex type"); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteVertexTypeByName( + @PathVariable("graph_id") String graphId, + @RequestParam(value = "type_name", required = true) String typeName) { + try { + schemaManagementService.deleteVertexType(graphId, typeName); + return ApiUtil.createSuccessResponse("Vertex type deleted successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex type"); + } + } + + @Override + @PutMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateVertexType( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated CreateVertexType updateVertexType) { + try { + schemaManagementService.updateVertexType(graphId, updateVertexType); + return ApiUtil.createSuccessResponse("Vertex type updated successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex type"); + } + } + + @Override + @PostMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity createEdgeType( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated CreateEdgeType createEdgeType) { + try { + schemaManagementService.createEdgeType(graphId, createEdgeType); + return ApiUtil.createSuccessResponse("Edge type created successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create edge type"); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteEdgeTypeByName( + @PathVariable("graph_id") String graphId, + @RequestParam(value = "type_name", required = true) String typeName, + @RequestParam(value = "source_vertex_type", required = true) String sourceVertexType, + @RequestParam(value = "destination_vertex_type", required = true) String destinationVertexType) { + try { + schemaManagementService.deleteEdgeType(graphId, typeName, sourceVertexType, destinationVertexType); + return ApiUtil.createSuccessResponse("Edge type deleted successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge type"); + } + } + + @Override + @PutMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateEdgeType( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated CreateEdgeType updateEdgeType) { + try { + schemaManagementService.updateEdgeType(graphId, updateEdgeType); + return ApiUtil.createSuccessResponse("Edge type updated successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge type"); + } + } + + @Override + @PostMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity importSchema( + @PathVariable("graph_id") String graphId, + @RequestBody @Validated CreateGraphSchemaRequest createGraphSchemaRequest) { + try { + schemaManagementService.importSchema(graphId, createGraphSchemaRequest); + return ApiUtil.createSuccessResponse("Schema imported successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to import schema"); + } + } + + @Override + @GetMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity getSchema( + @PathVariable("graph_id") String graphId) { + try { + GetGraphSchemaResponse response = schemaManagementService.getSchema(graphId); + return ResponseEntity.status(HttpStatus.OK).body(response); + } catch (Exception e) { + e.printStackTrace(); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteSchema( + @PathVariable("graph_id") String graphId) { + try { + schemaManagementService.dropSchema(graphId); + return ApiUtil.createSuccessResponse("Schema deleted successfully"); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete schema"); + } + } + +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java deleted file mode 100644 index c34a9188db23..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootController.java +++ /dev/null @@ -1,273 +0,0 @@ -package com.alibaba.graphscope.groot.service.impl; - -import com.alibaba.graphscope.groot.service.models.CreateEdgeType; -import com.alibaba.graphscope.groot.service.models.CreateGraphSchemaRequest; -import com.alibaba.graphscope.groot.service.models.CreateVertexType; -import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; -import com.alibaba.graphscope.groot.service.models.DeleteVertexRequest; -import com.alibaba.graphscope.groot.service.models.EdgeRequest; -import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; -import com.alibaba.graphscope.groot.service.models.VertexRequest; - -import com.alibaba.graphscope.groot.service.api.ApiUtil; -import com.alibaba.graphscope.groot.service.api.V1Api; - -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("${openapi.graphScopeInteractiveAPIV03.base-path:/v1/graph}") -public class GrootController implements V1Api { - - private final VertexManagementService vertexManagementService; - private final EdgeManagementService edgeManagementService; - private final SchemaManagementService schemaManagementService; - - @Autowired - public GrootController(VertexManagementService vertexService, EdgeManagementService edgeService, - SchemaManagementService schemaManagementService) { - this.vertexManagementService = vertexService; - this.edgeManagementService = edgeService; - this.schemaManagementService = schemaManagementService; - } - - @Override - @PostMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity addVertex( - @PathVariable("graph_id") String graphId, - @RequestBody @Validated List vertexRequests) { - try { - if (vertexRequests.isEmpty()) { - return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Vertex request must not be empty"); - } - long si = vertexManagementService.addVertices(vertexRequests); - return ApiUtil.createSuccessResponse("Vertex added successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertex"); - } - } - - @Override - @DeleteMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteVertex( - @PathVariable("graph_id") String graphId, - @RequestBody(required = true) DeleteVertexRequest deleteVertexRequest) { - try { - long si = vertexManagementService.deleteVertex(deleteVertexRequest.getLabel(), - deleteVertexRequest.getPrimaryKeyValues()); - return ApiUtil.createSuccessResponse("Vertex deleted successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex"); - } - } - - @Override - @PutMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity updateVertex( - @PathVariable("graph_id") String graphId, - @RequestBody(required = false) VertexRequest vertexRequest) { - try { - if (vertexRequest == null) { - return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Request body must not be null"); - } - long si = vertexManagementService.updateVertex(vertexRequest); - return ApiUtil.createSuccessResponse("Vertex updated successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex"); - } - } - - @Override - @PostMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity addEdge( - @PathVariable("graph_id") String graphId, - @RequestBody @Validated List edgeRequests) { - try { - if (edgeRequests.isEmpty()) { - return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Edge request must not be empty"); - } - long si = edgeManagementService.addEdges(edgeRequests); - return ApiUtil.createSuccessResponse("Edge added successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add edge"); - } - } - - @Override - @DeleteMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteEdge( - @PathVariable("graph_id") String graphId, - @RequestBody(required = true) DeleteEdgeRequest deleteEdgeRequest) { - try { - long si = edgeManagementService.deleteEdge(deleteEdgeRequest.getEdgeLabel(), - deleteEdgeRequest.getSrcLabel(), deleteEdgeRequest.getDstLabel(), - deleteEdgeRequest.getSrcPrimaryKeyValues(), deleteEdgeRequest.getDstPrimaryKeyValues()); - return ApiUtil.createSuccessResponse("Edge deleted successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge"); - } - } - - @Override - @PutMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity updateEdge( - @PathVariable("graph_id") String graphId, - @RequestBody(required = false) EdgeRequest edgeRequest) { - try { - if (edgeRequest == null) { - return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Request body must not be null"); - } - long si = edgeManagementService.updateEdge(edgeRequest); - return ApiUtil.createSuccessResponse("Edge updated successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge"); - } - } - - @Override - @PostMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity createVertexType( - @PathVariable("graph_id") String graphId, - @RequestBody @Validated CreateVertexType createVertexType) { - try { - schemaManagementService.createVertexType(graphId, createVertexType); - return ApiUtil.createSuccessResponse("Vertex type created successfully"); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create vertex type"); - } - } - - @Override - @DeleteMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteVertexTypeByName( - @PathVariable("graph_id") String graphId, - @RequestParam(value = "type_name", required = true) String typeName) { - try { - schemaManagementService.deleteVertexType(graphId, typeName); - return ApiUtil.createSuccessResponse("Vertex type deleted successfully"); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex type"); - } - } - - @Override - @PutMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity updateVertexType( - @PathVariable("graph_id") String graphId, - @RequestBody @Validated CreateVertexType updateVertexType) { - try { - schemaManagementService.updateVertexType(graphId, updateVertexType); - return ApiUtil.createSuccessResponse("Vertex type updated successfully"); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex type"); - } - } - - @Override - @PostMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity createEdgeType( - @PathVariable("graph_id") String graphId, - @RequestBody @Validated CreateEdgeType createEdgeType) { - try { - schemaManagementService.createEdgeType(graphId, createEdgeType); - return ApiUtil.createSuccessResponse("Edge type created successfully"); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create edge type"); - } - } - - @Override - @DeleteMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteEdgeTypeByName( - @PathVariable("graph_id") String graphId, - @RequestParam(value = "type_name", required = true) String typeName, - @RequestParam(value = "source_vertex_type", required = true) String sourceVertexType, - @RequestParam(value = "destination_vertex_type", required = true) String destinationVertexType) { - try { - schemaManagementService.deleteEdgeType(graphId, typeName, sourceVertexType, destinationVertexType); - return ApiUtil.createSuccessResponse("Edge type deleted successfully"); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge type"); - } - } - - @Override - @PutMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity updateEdgeType( - @PathVariable("graph_id") String graphId, - @RequestBody @Validated CreateEdgeType updateEdgeType) { - try { - schemaManagementService.updateEdgeType(graphId, updateEdgeType); - return ApiUtil.createSuccessResponse("Edge type updated successfully"); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge type"); - } - } - - @Override - @PostMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity importSchema( - @PathVariable("graph_id") String graphId, - @RequestBody @Validated CreateGraphSchemaRequest createGraphSchemaRequest) { - try { - schemaManagementService.importSchema(graphId, createGraphSchemaRequest); - return ApiUtil.createSuccessResponse("Schema imported successfully"); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to import schema"); - } - } - - @Override - @GetMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity getSchema( - @PathVariable("graph_id") String graphId) { - try { - GetGraphSchemaResponse response = schemaManagementService.getSchema(graphId); - return ResponseEntity.status(HttpStatus.OK).body(response); - } catch (Exception e) { - e.printStackTrace(); - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null); - } - } - - @Override - @DeleteMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteSchema( - @PathVariable("graph_id") String graphId) { - try { - schemaManagementService.dropSchema(graphId); - return ApiUtil.createSuccessResponse("Schema deleted successfully"); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete schema"); - } - } - -} From a55accce1912fff6edaf82cb89b1f1dd3333f475 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Tue, 7 Jan 2025 19:24:07 +0800 Subject: [PATCH 12/23] delete auto-generated files Committed-by: bingqing.lbq from Dev container --- .../service/models/APIResponseWithCode.java | 107 ---- .../groot/service/models/BaseEdgeType.java | 120 ----- ...eEdgeTypeVertexTypePairRelationsInner.java | 198 -------- ...ertexTypePairRelationsInnerXCsrParams.java | 196 ------- .../service/models/BasePropertyMeta.java | 108 ---- .../groot/service/models/BaseVertexType.java | 144 ------ .../models/BaseVertexTypeXCsrParams.java | 86 ---- .../groot/service/models/ColumnMapping.java | 108 ---- .../groot/service/models/CreateEdgeType.java | 154 ------ .../service/models/CreateGraphRequest.java | 169 ------- .../service/models/CreateGraphResponse.java | 83 --- .../models/CreateGraphSchemaRequest.java | 130 ----- .../models/CreateProcedureRequest.java | 204 -------- .../models/CreateProcedureResponse.java | 94 ---- .../service/models/CreatePropertyMeta.java | 108 ---- .../service/models/CreateVertexType.java | 178 ------- .../groot/service/models/DateType.java | 95 ---- .../service/models/DeleteEdgeRequest.java | 203 -------- .../service/models/DeleteVertexRequest.java | 122 ----- .../groot/service/models/EdgeData.java | 232 --------- .../groot/service/models/EdgeMapping.java | 222 -------- ...MappingDestinationVertexMappingsInner.java | 111 ---- .../EdgeMappingSourceVertexMappingsInner.java | 111 ---- ...appingSourceVertexMappingsInnerColumn.java | 109 ---- .../models/EdgeMappingTypeTriplet.java | 134 ----- .../groot/service/models/EdgeRequest.java | 249 --------- .../groot/service/models/EdgeStatistics.java | 144 ------ .../groot/service/models/FixedChar.java | 96 ---- .../groot/service/models/FixedCharChar.java | 96 ---- .../groot/service/models/GetEdgeType.java | 202 -------- .../service/models/GetGraphResponse.java | 348 ------------- .../models/GetGraphSchemaResponse.java | 130 ----- .../models/GetGraphStatisticsResponse.java | 190 ------- .../service/models/GetProcedureResponse.java | 477 ------------------ .../groot/service/models/GetPropertyMeta.java | 132 ----- .../groot/service/models/GetVertexType.java | 226 --------- .../groot/service/models/JobResponse.java | 83 --- .../groot/service/models/JobStatus.java | 280 ---------- .../groot/service/models/LongText.java | 95 ---- .../groot/service/models/Parameter.java | 120 ----- .../groot/service/models/PrimitiveType.java | 142 ------ .../groot/service/models/Property.java | 119 ----- .../groot/service/models/QueryRequest.java | 131 ----- .../groot/service/models/SchemaMapping.java | 155 ------ .../models/SchemaMappingLoadingConfig.java | 196 ------- .../SchemaMappingLoadingConfigDataSource.java | 145 ------ .../SchemaMappingLoadingConfigFormat.java | 120 ----- .../SchemaMappingLoadingConfigXCsrParams.java | 134 ----- .../groot/service/models/ServiceStatus.java | 228 --------- .../service/models/StartServiceRequest.java | 83 --- .../service/models/StopServiceRequest.java | 97 ---- .../service/models/StoredProcedureMeta.java | 381 -------------- .../groot/service/models/StringType.java | 96 ---- .../service/models/StringTypeString.java | 28 - .../groot/service/models/TemporalType.java | 96 ---- .../service/models/TemporalTypeTemporal.java | 25 - .../groot/service/models/TimeStampType.java | 95 ---- .../groot/service/models/TypedValue.java | 120 ----- .../groot/service/models/UpdateEdgeType.java | 154 ------ .../models/UpdateProcedureRequest.java | 83 --- .../service/models/UpdateVertexType.java | 178 ------- .../service/models/UploadFileResponse.java | 129 ----- .../groot/service/models/VarChar.java | 96 ---- .../groot/service/models/VarCharVarChar.java | 96 ---- .../groot/service/models/VertexData.java | 131 ----- .../service/models/VertexEdgeRequest.java | 142 ------ .../groot/service/models/VertexMapping.java | 153 ------ .../groot/service/models/VertexRequest.java | 166 ------ .../service/models/VertexStatistics.java | 131 ----- .../models/VertexTypePairStatistics.java | 144 ------ 70 files changed, 10388 deletions(-) delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateEdgeType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateVertexType.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java deleted file mode 100644 index 37a701378144..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * APIResponseWithCode - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class APIResponseWithCode { - - private Integer code; - - private String message; - - public APIResponseWithCode code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("code") - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public APIResponseWithCode message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("message") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - APIResponseWithCode apIResponseWithCode = (APIResponseWithCode) o; - return Objects.equals(this.code, apIResponseWithCode.code) && - Objects.equals(this.message, apIResponseWithCode.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class APIResponseWithCode {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java deleted file mode 100644 index 0fc59b0bf8d2..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BaseEdgeType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class BaseEdgeType { - - private String typeName; - - @Valid - private List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations; - - public BaseEdgeType typeName(String typeName) { - this.typeName = typeName; - return this; - } - - /** - * Get typeName - * @return typeName - */ - - @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_name") - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public BaseEdgeType vertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { - this.vertexTypePairRelations = vertexTypePairRelations; - return this; - } - - public BaseEdgeType addVertexTypePairRelationsItem(BaseEdgeTypeVertexTypePairRelationsInner vertexTypePairRelationsItem) { - if (this.vertexTypePairRelations == null) { - this.vertexTypePairRelations = new ArrayList<>(); - } - this.vertexTypePairRelations.add(vertexTypePairRelationsItem); - return this; - } - - /** - * Get vertexTypePairRelations - * @return vertexTypePairRelations - */ - @Valid - @Schema(name = "vertex_type_pair_relations", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("vertex_type_pair_relations") - public List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> getVertexTypePairRelations() { - return vertexTypePairRelations; - } - - public void setVertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { - this.vertexTypePairRelations = vertexTypePairRelations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BaseEdgeType baseEdgeType = (BaseEdgeType) o; - return Objects.equals(this.typeName, baseEdgeType.typeName) && - Objects.equals(this.vertexTypePairRelations, baseEdgeType.vertexTypePairRelations); - } - - @Override - public int hashCode() { - return Objects.hash(typeName, vertexTypePairRelations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseEdgeType {\n"); - sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); - sb.append(" vertexTypePairRelations: ").append(toIndentedString(vertexTypePairRelations)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java deleted file mode 100644 index 5e5603837442..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BaseEdgeTypeVertexTypePairRelationsInner - */ - -@JsonTypeName("BaseEdgeType_vertex_type_pair_relations_inner") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class BaseEdgeTypeVertexTypePairRelationsInner { - - private String sourceVertex; - - private String destinationVertex; - - /** - * Gets or Sets relation - */ - public enum RelationEnum { - MANY_TO_MANY("MANY_TO_MANY"), - - ONE_TO_MANY("ONE_TO_MANY"), - - MANY_TO_ONE("MANY_TO_ONE"), - - ONE_TO_ONE("ONE_TO_ONE"); - - private String value; - - RelationEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static RelationEnum fromValue(String value) { - for (RelationEnum b : RelationEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private RelationEnum relation; - - private BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams xCsrParams; - - public BaseEdgeTypeVertexTypePairRelationsInner sourceVertex(String sourceVertex) { - this.sourceVertex = sourceVertex; - return this; - } - - /** - * Get sourceVertex - * @return sourceVertex - */ - - @Schema(name = "source_vertex", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("source_vertex") - public String getSourceVertex() { - return sourceVertex; - } - - public void setSourceVertex(String sourceVertex) { - this.sourceVertex = sourceVertex; - } - - public BaseEdgeTypeVertexTypePairRelationsInner destinationVertex(String destinationVertex) { - this.destinationVertex = destinationVertex; - return this; - } - - /** - * Get destinationVertex - * @return destinationVertex - */ - - @Schema(name = "destination_vertex", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("destination_vertex") - public String getDestinationVertex() { - return destinationVertex; - } - - public void setDestinationVertex(String destinationVertex) { - this.destinationVertex = destinationVertex; - } - - public BaseEdgeTypeVertexTypePairRelationsInner relation(RelationEnum relation) { - this.relation = relation; - return this; - } - - /** - * Get relation - * @return relation - */ - - @Schema(name = "relation", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("relation") - public RelationEnum getRelation() { - return relation; - } - - public void setRelation(RelationEnum relation) { - this.relation = relation; - } - - public BaseEdgeTypeVertexTypePairRelationsInner xCsrParams(BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - return this; - } - - /** - * Get xCsrParams - * @return xCsrParams - */ - @Valid - @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("x_csr_params") - public BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams getxCsrParams() { - return xCsrParams; - } - - public void setxCsrParams(BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BaseEdgeTypeVertexTypePairRelationsInner baseEdgeTypeVertexTypePairRelationsInner = (BaseEdgeTypeVertexTypePairRelationsInner) o; - return Objects.equals(this.sourceVertex, baseEdgeTypeVertexTypePairRelationsInner.sourceVertex) && - Objects.equals(this.destinationVertex, baseEdgeTypeVertexTypePairRelationsInner.destinationVertex) && - Objects.equals(this.relation, baseEdgeTypeVertexTypePairRelationsInner.relation) && - Objects.equals(this.xCsrParams, baseEdgeTypeVertexTypePairRelationsInner.xCsrParams); - } - - @Override - public int hashCode() { - return Objects.hash(sourceVertex, destinationVertex, relation, xCsrParams); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseEdgeTypeVertexTypePairRelationsInner {\n"); - sb.append(" sourceVertex: ").append(toIndentedString(sourceVertex)).append("\n"); - sb.append(" destinationVertex: ").append(toIndentedString(destinationVertex)).append("\n"); - sb.append(" relation: ").append(toIndentedString(relation)).append("\n"); - sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java deleted file mode 100644 index 2ec4d7fc89c2..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java +++ /dev/null @@ -1,196 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Used for storage optimization - */ - -@Schema(name = "BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params", description = "Used for storage optimization") -@JsonTypeName("BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams { - - /** - * Gets or Sets edgeStorageStrategy - */ - public enum EdgeStorageStrategyEnum { - ONLY_IN("ONLY_IN"), - - ONLY_OUT("ONLY_OUT"), - - BOTH_OUT_IN("BOTH_OUT_IN"); - - private String value; - - EdgeStorageStrategyEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EdgeStorageStrategyEnum fromValue(String value) { - for (EdgeStorageStrategyEnum b : EdgeStorageStrategyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private EdgeStorageStrategyEnum edgeStorageStrategy; - - private Boolean sortOnCompaction; - - private String oeMutability; - - private String ieMutability; - - public BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams edgeStorageStrategy(EdgeStorageStrategyEnum edgeStorageStrategy) { - this.edgeStorageStrategy = edgeStorageStrategy; - return this; - } - - /** - * Get edgeStorageStrategy - * @return edgeStorageStrategy - */ - - @Schema(name = "edge_storage_strategy", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("edge_storage_strategy") - public EdgeStorageStrategyEnum getEdgeStorageStrategy() { - return edgeStorageStrategy; - } - - public void setEdgeStorageStrategy(EdgeStorageStrategyEnum edgeStorageStrategy) { - this.edgeStorageStrategy = edgeStorageStrategy; - } - - public BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams sortOnCompaction(Boolean sortOnCompaction) { - this.sortOnCompaction = sortOnCompaction; - return this; - } - - /** - * Get sortOnCompaction - * @return sortOnCompaction - */ - - @Schema(name = "sort_on_compaction", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("sort_on_compaction") - public Boolean getSortOnCompaction() { - return sortOnCompaction; - } - - public void setSortOnCompaction(Boolean sortOnCompaction) { - this.sortOnCompaction = sortOnCompaction; - } - - public BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams oeMutability(String oeMutability) { - this.oeMutability = oeMutability; - return this; - } - - /** - * Get oeMutability - * @return oeMutability - */ - - @Schema(name = "oe_mutability", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("oe_mutability") - public String getOeMutability() { - return oeMutability; - } - - public void setOeMutability(String oeMutability) { - this.oeMutability = oeMutability; - } - - public BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams ieMutability(String ieMutability) { - this.ieMutability = ieMutability; - return this; - } - - /** - * Get ieMutability - * @return ieMutability - */ - - @Schema(name = "ie_mutability", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("ie_mutability") - public String getIeMutability() { - return ieMutability; - } - - public void setIeMutability(String ieMutability) { - this.ieMutability = ieMutability; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams baseEdgeTypeVertexTypePairRelationsInnerXCsrParams = (BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams) o; - return Objects.equals(this.edgeStorageStrategy, baseEdgeTypeVertexTypePairRelationsInnerXCsrParams.edgeStorageStrategy) && - Objects.equals(this.sortOnCompaction, baseEdgeTypeVertexTypePairRelationsInnerXCsrParams.sortOnCompaction) && - Objects.equals(this.oeMutability, baseEdgeTypeVertexTypePairRelationsInnerXCsrParams.oeMutability) && - Objects.equals(this.ieMutability, baseEdgeTypeVertexTypePairRelationsInnerXCsrParams.ieMutability); - } - - @Override - public int hashCode() { - return Objects.hash(edgeStorageStrategy, sortOnCompaction, oeMutability, ieMutability); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams {\n"); - sb.append(" edgeStorageStrategy: ").append(toIndentedString(edgeStorageStrategy)).append("\n"); - sb.append(" sortOnCompaction: ").append(toIndentedString(sortOnCompaction)).append("\n"); - sb.append(" oeMutability: ").append(toIndentedString(oeMutability)).append("\n"); - sb.append(" ieMutability: ").append(toIndentedString(ieMutability)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java deleted file mode 100644 index 28d5a30151a1..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.GSDataType; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BasePropertyMeta - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class BasePropertyMeta { - - private String propertyName; - - private GSDataType propertyType; - - public BasePropertyMeta propertyName(String propertyName) { - this.propertyName = propertyName; - return this; - } - - /** - * Get propertyName - * @return propertyName - */ - - @Schema(name = "property_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("property_name") - public String getPropertyName() { - return propertyName; - } - - public void setPropertyName(String propertyName) { - this.propertyName = propertyName; - } - - public BasePropertyMeta propertyType(GSDataType propertyType) { - this.propertyType = propertyType; - return this; - } - - /** - * Get propertyType - * @return propertyType - */ - @Valid - @Schema(name = "property_type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("property_type") - public GSDataType getPropertyType() { - return propertyType; - } - - public void setPropertyType(GSDataType propertyType) { - this.propertyType = propertyType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BasePropertyMeta basePropertyMeta = (BasePropertyMeta) o; - return Objects.equals(this.propertyName, basePropertyMeta.propertyName) && - Objects.equals(this.propertyType, basePropertyMeta.propertyType); - } - - @Override - public int hashCode() { - return Objects.hash(propertyName, propertyType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BasePropertyMeta {\n"); - sb.append(" propertyName: ").append(toIndentedString(propertyName)).append("\n"); - sb.append(" propertyType: ").append(toIndentedString(propertyType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java deleted file mode 100644 index f7ac6ae3cb71..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.BaseVertexTypeXCsrParams; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BaseVertexType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class BaseVertexType { - - private String typeName; - - @Valid - private List primaryKeys; - - private BaseVertexTypeXCsrParams xCsrParams; - - public BaseVertexType typeName(String typeName) { - this.typeName = typeName; - return this; - } - - /** - * Get typeName - * @return typeName - */ - - @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_name") - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public BaseVertexType primaryKeys(List primaryKeys) { - this.primaryKeys = primaryKeys; - return this; - } - - public BaseVertexType addPrimaryKeysItem(String primaryKeysItem) { - if (this.primaryKeys == null) { - this.primaryKeys = new ArrayList<>(); - } - this.primaryKeys.add(primaryKeysItem); - return this; - } - - /** - * Get primaryKeys - * @return primaryKeys - */ - - @Schema(name = "primary_keys", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("primary_keys") - public List getPrimaryKeys() { - return primaryKeys; - } - - public void setPrimaryKeys(List primaryKeys) { - this.primaryKeys = primaryKeys; - } - - public BaseVertexType xCsrParams(BaseVertexTypeXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - return this; - } - - /** - * Get xCsrParams - * @return xCsrParams - */ - @Valid - @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("x_csr_params") - public BaseVertexTypeXCsrParams getxCsrParams() { - return xCsrParams; - } - - public void setxCsrParams(BaseVertexTypeXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BaseVertexType baseVertexType = (BaseVertexType) o; - return Objects.equals(this.typeName, baseVertexType.typeName) && - Objects.equals(this.primaryKeys, baseVertexType.primaryKeys) && - Objects.equals(this.xCsrParams, baseVertexType.xCsrParams); - } - - @Override - public int hashCode() { - return Objects.hash(typeName, primaryKeys, xCsrParams); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseVertexType {\n"); - sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); - sb.append(" primaryKeys: ").append(toIndentedString(primaryKeys)).append("\n"); - sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java deleted file mode 100644 index 6f72e493eadd..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Used for storage optimization - */ - -@Schema(name = "BaseVertexType_x_csr_params", description = "Used for storage optimization") -@JsonTypeName("BaseVertexType_x_csr_params") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class BaseVertexTypeXCsrParams { - - private Integer maxVertexNum; - - public BaseVertexTypeXCsrParams maxVertexNum(Integer maxVertexNum) { - this.maxVertexNum = maxVertexNum; - return this; - } - - /** - * Get maxVertexNum - * @return maxVertexNum - */ - - @Schema(name = "max_vertex_num", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("max_vertex_num") - public Integer getMaxVertexNum() { - return maxVertexNum; - } - - public void setMaxVertexNum(Integer maxVertexNum) { - this.maxVertexNum = maxVertexNum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BaseVertexTypeXCsrParams baseVertexTypeXCsrParams = (BaseVertexTypeXCsrParams) o; - return Objects.equals(this.maxVertexNum, baseVertexTypeXCsrParams.maxVertexNum); - } - - @Override - public int hashCode() { - return Objects.hash(maxVertexNum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BaseVertexTypeXCsrParams {\n"); - sb.append(" maxVertexNum: ").append(toIndentedString(maxVertexNum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java deleted file mode 100644 index 463cff2c29bb..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.EdgeMappingSourceVertexMappingsInnerColumn; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ColumnMapping - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class ColumnMapping { - - private EdgeMappingSourceVertexMappingsInnerColumn column; - - private String property; - - public ColumnMapping column(EdgeMappingSourceVertexMappingsInnerColumn column) { - this.column = column; - return this; - } - - /** - * Get column - * @return column - */ - @Valid - @Schema(name = "column", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("column") - public EdgeMappingSourceVertexMappingsInnerColumn getColumn() { - return column; - } - - public void setColumn(EdgeMappingSourceVertexMappingsInnerColumn column) { - this.column = column; - } - - public ColumnMapping property(String property) { - this.property = property; - return this; - } - - /** - * must align with the schema - * @return property - */ - - @Schema(name = "property", description = "must align with the schema", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("property") - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ColumnMapping columnMapping = (ColumnMapping) o; - return Objects.equals(this.column, columnMapping.column) && - Objects.equals(this.property, columnMapping.property); - } - - @Override - public int hashCode() { - return Objects.hash(column, property); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ColumnMapping {\n"); - sb.append(" column: ").append(toIndentedString(column)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java deleted file mode 100644 index 77e88a1919c5..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; -import com.alibaba.graphscope.groot.service.models.CreatePropertyMeta; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CreateEdgeType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class CreateEdgeType { - - private String typeName; - - @Valid - private List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations; - - @Valid - private List<@Valid CreatePropertyMeta> properties; - - public CreateEdgeType typeName(String typeName) { - this.typeName = typeName; - return this; - } - - /** - * Get typeName - * @return typeName - */ - - @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_name") - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public CreateEdgeType vertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { - this.vertexTypePairRelations = vertexTypePairRelations; - return this; - } - - public CreateEdgeType addVertexTypePairRelationsItem(BaseEdgeTypeVertexTypePairRelationsInner vertexTypePairRelationsItem) { - if (this.vertexTypePairRelations == null) { - this.vertexTypePairRelations = new ArrayList<>(); - } - this.vertexTypePairRelations.add(vertexTypePairRelationsItem); - return this; - } - - /** - * Get vertexTypePairRelations - * @return vertexTypePairRelations - */ - @Valid - @Schema(name = "vertex_type_pair_relations", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("vertex_type_pair_relations") - public List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> getVertexTypePairRelations() { - return vertexTypePairRelations; - } - - public void setVertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { - this.vertexTypePairRelations = vertexTypePairRelations; - } - - public CreateEdgeType properties(List<@Valid CreatePropertyMeta> properties) { - this.properties = properties; - return this; - } - - public CreateEdgeType addPropertiesItem(CreatePropertyMeta propertiesItem) { - if (this.properties == null) { - this.properties = new ArrayList<>(); - } - this.properties.add(propertiesItem); - return this; - } - - /** - * Get properties - * @return properties - */ - @Valid - @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("properties") - public List<@Valid CreatePropertyMeta> getProperties() { - return properties; - } - - public void setProperties(List<@Valid CreatePropertyMeta> properties) { - this.properties = properties; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateEdgeType createEdgeType = (CreateEdgeType) o; - return Objects.equals(this.typeName, createEdgeType.typeName) && - Objects.equals(this.vertexTypePairRelations, createEdgeType.vertexTypePairRelations) && - Objects.equals(this.properties, createEdgeType.properties); - } - - @Override - public int hashCode() { - return Objects.hash(typeName, vertexTypePairRelations, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEdgeType {\n"); - sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); - sb.append(" vertexTypePairRelations: ").append(toIndentedString(vertexTypePairRelations)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java deleted file mode 100644 index 81bb86b9d399..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.CreateGraphSchemaRequest; -import com.alibaba.graphscope.groot.service.models.CreateProcedureRequest; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CreateGraphRequest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class CreateGraphRequest { - - private String name; - - private String description; - - @Valid - private List<@Valid CreateProcedureRequest> storedProcedures; - - private CreateGraphSchemaRequest schema; - - public CreateGraphRequest name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", example = "modern_graph", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public CreateGraphRequest description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - - @Schema(name = "description", example = "A default description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("description") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public CreateGraphRequest storedProcedures(List<@Valid CreateProcedureRequest> storedProcedures) { - this.storedProcedures = storedProcedures; - return this; - } - - public CreateGraphRequest addStoredProceduresItem(CreateProcedureRequest storedProceduresItem) { - if (this.storedProcedures == null) { - this.storedProcedures = new ArrayList<>(); - } - this.storedProcedures.add(storedProceduresItem); - return this; - } - - /** - * Get storedProcedures - * @return storedProcedures - */ - @Valid - @Schema(name = "stored_procedures", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("stored_procedures") - public List<@Valid CreateProcedureRequest> getStoredProcedures() { - return storedProcedures; - } - - public void setStoredProcedures(List<@Valid CreateProcedureRequest> storedProcedures) { - this.storedProcedures = storedProcedures; - } - - public CreateGraphRequest schema(CreateGraphSchemaRequest schema) { - this.schema = schema; - return this; - } - - /** - * Get schema - * @return schema - */ - @Valid - @Schema(name = "schema", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("schema") - public CreateGraphSchemaRequest getSchema() { - return schema; - } - - public void setSchema(CreateGraphSchemaRequest schema) { - this.schema = schema; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateGraphRequest createGraphRequest = (CreateGraphRequest) o; - return Objects.equals(this.name, createGraphRequest.name) && - Objects.equals(this.description, createGraphRequest.description) && - Objects.equals(this.storedProcedures, createGraphRequest.storedProcedures) && - Objects.equals(this.schema, createGraphRequest.schema); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, storedProcedures, schema); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateGraphRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" storedProcedures: ").append(toIndentedString(storedProcedures)).append("\n"); - sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java deleted file mode 100644 index 1614db7a05c6..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CreateGraphResponse - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class CreateGraphResponse { - - private String graphId; - - public CreateGraphResponse graphId(String graphId) { - this.graphId = graphId; - return this; - } - - /** - * Get graphId - * @return graphId - */ - - @Schema(name = "graph_id", example = "1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("graph_id") - public String getGraphId() { - return graphId; - } - - public void setGraphId(String graphId) { - this.graphId = graphId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateGraphResponse createGraphResponse = (CreateGraphResponse) o; - return Objects.equals(this.graphId, createGraphResponse.graphId); - } - - @Override - public int hashCode() { - return Objects.hash(graphId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateGraphResponse {\n"); - sb.append(" graphId: ").append(toIndentedString(graphId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java deleted file mode 100644 index 09e0ebf6c161..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.CreateEdgeType; -import com.alibaba.graphscope.groot.service.models.CreateVertexType; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CreateGraphSchemaRequest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class CreateGraphSchemaRequest { - - @Valid - private List<@Valid CreateVertexType> vertexTypes; - - @Valid - private List<@Valid CreateEdgeType> edgeTypes; - - public CreateGraphSchemaRequest vertexTypes(List<@Valid CreateVertexType> vertexTypes) { - this.vertexTypes = vertexTypes; - return this; - } - - public CreateGraphSchemaRequest addVertexTypesItem(CreateVertexType vertexTypesItem) { - if (this.vertexTypes == null) { - this.vertexTypes = new ArrayList<>(); - } - this.vertexTypes.add(vertexTypesItem); - return this; - } - - /** - * Get vertexTypes - * @return vertexTypes - */ - @Valid - @Schema(name = "vertex_types", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("vertex_types") - public List<@Valid CreateVertexType> getVertexTypes() { - return vertexTypes; - } - - public void setVertexTypes(List<@Valid CreateVertexType> vertexTypes) { - this.vertexTypes = vertexTypes; - } - - public CreateGraphSchemaRequest edgeTypes(List<@Valid CreateEdgeType> edgeTypes) { - this.edgeTypes = edgeTypes; - return this; - } - - public CreateGraphSchemaRequest addEdgeTypesItem(CreateEdgeType edgeTypesItem) { - if (this.edgeTypes == null) { - this.edgeTypes = new ArrayList<>(); - } - this.edgeTypes.add(edgeTypesItem); - return this; - } - - /** - * Get edgeTypes - * @return edgeTypes - */ - @Valid - @Schema(name = "edge_types", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("edge_types") - public List<@Valid CreateEdgeType> getEdgeTypes() { - return edgeTypes; - } - - public void setEdgeTypes(List<@Valid CreateEdgeType> edgeTypes) { - this.edgeTypes = edgeTypes; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateGraphSchemaRequest createGraphSchemaRequest = (CreateGraphSchemaRequest) o; - return Objects.equals(this.vertexTypes, createGraphSchemaRequest.vertexTypes) && - Objects.equals(this.edgeTypes, createGraphSchemaRequest.edgeTypes); - } - - @Override - public int hashCode() { - return Objects.hash(vertexTypes, edgeTypes); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateGraphSchemaRequest {\n"); - sb.append(" vertexTypes: ").append(toIndentedString(vertexTypes)).append("\n"); - sb.append(" edgeTypes: ").append(toIndentedString(edgeTypes)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java deleted file mode 100644 index f49c30aba6b7..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java +++ /dev/null @@ -1,204 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CreateProcedureRequest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class CreateProcedureRequest { - - private String name; - - private String description; - - /** - * Gets or Sets type - */ - public enum TypeEnum { - CPP("cpp"), - - CYPHER("cypher"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private TypeEnum type; - - private String query; - - public CreateProcedureRequest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public CreateProcedureRequest(String name, TypeEnum type, String query) { - this.name = name; - this.type = type; - this.query = query; - } - - public CreateProcedureRequest name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", example = "query1", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public CreateProcedureRequest description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - - @Schema(name = "description", example = "A sample stored procedure", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("description") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public CreateProcedureRequest type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @NotNull - @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("type") - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public CreateProcedureRequest query(String query) { - this.query = query; - return this; - } - - /** - * Get query - * @return query - */ - @NotNull - @Schema(name = "query", example = "MATCH(a) return COUNT(a);", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("query") - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateProcedureRequest createProcedureRequest = (CreateProcedureRequest) o; - return Objects.equals(this.name, createProcedureRequest.name) && - Objects.equals(this.description, createProcedureRequest.description) && - Objects.equals(this.type, createProcedureRequest.type) && - Objects.equals(this.query, createProcedureRequest.query); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, type, query); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateProcedureRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java deleted file mode 100644 index b59f5901c83e..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CreateProcedureResponse - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class CreateProcedureResponse { - - private String procedureId; - - public CreateProcedureResponse() { - super(); - } - - /** - * Constructor with only required parameters - */ - public CreateProcedureResponse(String procedureId) { - this.procedureId = procedureId; - } - - public CreateProcedureResponse procedureId(String procedureId) { - this.procedureId = procedureId; - return this; - } - - /** - * Get procedureId - * @return procedureId - */ - @NotNull - @Schema(name = "procedure_id", example = "proc1", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("procedure_id") - public String getProcedureId() { - return procedureId; - } - - public void setProcedureId(String procedureId) { - this.procedureId = procedureId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateProcedureResponse createProcedureResponse = (CreateProcedureResponse) o; - return Objects.equals(this.procedureId, createProcedureResponse.procedureId); - } - - @Override - public int hashCode() { - return Objects.hash(procedureId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateProcedureResponse {\n"); - sb.append(" procedureId: ").append(toIndentedString(procedureId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java deleted file mode 100644 index e3af28a6cae8..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.GSDataType; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CreatePropertyMeta - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class CreatePropertyMeta { - - private String propertyName; - - private GSDataType propertyType; - - public CreatePropertyMeta propertyName(String propertyName) { - this.propertyName = propertyName; - return this; - } - - /** - * Get propertyName - * @return propertyName - */ - - @Schema(name = "property_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("property_name") - public String getPropertyName() { - return propertyName; - } - - public void setPropertyName(String propertyName) { - this.propertyName = propertyName; - } - - public CreatePropertyMeta propertyType(GSDataType propertyType) { - this.propertyType = propertyType; - return this; - } - - /** - * Get propertyType - * @return propertyType - */ - @Valid - @Schema(name = "property_type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("property_type") - public GSDataType getPropertyType() { - return propertyType; - } - - public void setPropertyType(GSDataType propertyType) { - this.propertyType = propertyType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreatePropertyMeta createPropertyMeta = (CreatePropertyMeta) o; - return Objects.equals(this.propertyName, createPropertyMeta.propertyName) && - Objects.equals(this.propertyType, createPropertyMeta.propertyType); - } - - @Override - public int hashCode() { - return Objects.hash(propertyName, propertyType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreatePropertyMeta {\n"); - sb.append(" propertyName: ").append(toIndentedString(propertyName)).append("\n"); - sb.append(" propertyType: ").append(toIndentedString(propertyType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java deleted file mode 100644 index 0a78284874bd..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.BaseVertexTypeXCsrParams; -import com.alibaba.graphscope.groot.service.models.CreatePropertyMeta; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CreateVertexType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class CreateVertexType { - - private String typeName; - - @Valid - private List primaryKeys; - - private BaseVertexTypeXCsrParams xCsrParams; - - @Valid - private List<@Valid CreatePropertyMeta> properties; - - public CreateVertexType typeName(String typeName) { - this.typeName = typeName; - return this; - } - - /** - * Get typeName - * @return typeName - */ - - @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_name") - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public CreateVertexType primaryKeys(List primaryKeys) { - this.primaryKeys = primaryKeys; - return this; - } - - public CreateVertexType addPrimaryKeysItem(String primaryKeysItem) { - if (this.primaryKeys == null) { - this.primaryKeys = new ArrayList<>(); - } - this.primaryKeys.add(primaryKeysItem); - return this; - } - - /** - * Get primaryKeys - * @return primaryKeys - */ - - @Schema(name = "primary_keys", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("primary_keys") - public List getPrimaryKeys() { - return primaryKeys; - } - - public void setPrimaryKeys(List primaryKeys) { - this.primaryKeys = primaryKeys; - } - - public CreateVertexType xCsrParams(BaseVertexTypeXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - return this; - } - - /** - * Get xCsrParams - * @return xCsrParams - */ - @Valid - @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("x_csr_params") - public BaseVertexTypeXCsrParams getxCsrParams() { - return xCsrParams; - } - - public void setxCsrParams(BaseVertexTypeXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - } - - public CreateVertexType properties(List<@Valid CreatePropertyMeta> properties) { - this.properties = properties; - return this; - } - - public CreateVertexType addPropertiesItem(CreatePropertyMeta propertiesItem) { - if (this.properties == null) { - this.properties = new ArrayList<>(); - } - this.properties.add(propertiesItem); - return this; - } - - /** - * Get properties - * @return properties - */ - @Valid - @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("properties") - public List<@Valid CreatePropertyMeta> getProperties() { - return properties; - } - - public void setProperties(List<@Valid CreatePropertyMeta> properties) { - this.properties = properties; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateVertexType createVertexType = (CreateVertexType) o; - return Objects.equals(this.typeName, createVertexType.typeName) && - Objects.equals(this.primaryKeys, createVertexType.primaryKeys) && - Objects.equals(this.xCsrParams, createVertexType.xCsrParams) && - Objects.equals(this.properties, createVertexType.properties); - } - - @Override - public int hashCode() { - return Objects.hash(typeName, primaryKeys, xCsrParams, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateVertexType {\n"); - sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); - sb.append(" primaryKeys: ").append(toIndentedString(primaryKeys)).append("\n"); - sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java deleted file mode 100644 index a8c99188c1f1..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DateType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class DateType implements TemporalTypeTemporal { - - private String date32; - - public DateType() { - super(); - } - - /** - * Constructor with only required parameters - */ - public DateType(String date32) { - this.date32 = date32; - } - - public DateType date32(String date32) { - this.date32 = date32; - return this; - } - - /** - * Get date32 - * @return date32 - */ - @NotNull - @Schema(name = "date32", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("date32") - public String getDate32() { - return date32; - } - - public void setDate32(String date32) { - this.date32 = date32; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DateType dateType = (DateType) o; - return Objects.equals(this.date32, dateType.date32); - } - - @Override - public int hashCode() { - return Objects.hash(date32); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DateType {\n"); - sb.append(" date32: ").append(toIndentedString(date32)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java deleted file mode 100644 index c200c7b542e3..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java +++ /dev/null @@ -1,203 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.Property; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DeleteEdgeRequest - */ - -@JsonTypeName("delete_edge_request") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class DeleteEdgeRequest { - - private String edgeLabel; - - private String srcLabel; - - private String dstLabel; - - @Valid - private List<@Valid Property> srcPrimaryKeyValues; - - @Valid - private List<@Valid Property> dstPrimaryKeyValues; - - public DeleteEdgeRequest edgeLabel(String edgeLabel) { - this.edgeLabel = edgeLabel; - return this; - } - - /** - * The label name of the edge. - * @return edgeLabel - */ - - @Schema(name = "edge_label", example = "created", description = "The label name of the edge.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("edge_label") - public String getEdgeLabel() { - return edgeLabel; - } - - public void setEdgeLabel(String edgeLabel) { - this.edgeLabel = edgeLabel; - } - - public DeleteEdgeRequest srcLabel(String srcLabel) { - this.srcLabel = srcLabel; - return this; - } - - /** - * The label name of the source vertex. - * @return srcLabel - */ - - @Schema(name = "src_label", example = "person", description = "The label name of the source vertex.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("src_label") - public String getSrcLabel() { - return srcLabel; - } - - public void setSrcLabel(String srcLabel) { - this.srcLabel = srcLabel; - } - - public DeleteEdgeRequest dstLabel(String dstLabel) { - this.dstLabel = dstLabel; - return this; - } - - /** - * The label name of the destination vertex. - * @return dstLabel - */ - - @Schema(name = "dst_label", example = "software", description = "The label name of the destination vertex.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("dst_label") - public String getDstLabel() { - return dstLabel; - } - - public void setDstLabel(String dstLabel) { - this.dstLabel = dstLabel; - } - - public DeleteEdgeRequest srcPrimaryKeyValues(List<@Valid Property> srcPrimaryKeyValues) { - this.srcPrimaryKeyValues = srcPrimaryKeyValues; - return this; - } - - public DeleteEdgeRequest addSrcPrimaryKeyValuesItem(Property srcPrimaryKeyValuesItem) { - if (this.srcPrimaryKeyValues == null) { - this.srcPrimaryKeyValues = new ArrayList<>(); - } - this.srcPrimaryKeyValues.add(srcPrimaryKeyValuesItem); - return this; - } - - /** - * Primary key values for the source vertex. - * @return srcPrimaryKeyValues - */ - @Valid - @Schema(name = "src_primary_key_values", description = "Primary key values for the source vertex.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("src_primary_key_values") - public List<@Valid Property> getSrcPrimaryKeyValues() { - return srcPrimaryKeyValues; - } - - public void setSrcPrimaryKeyValues(List<@Valid Property> srcPrimaryKeyValues) { - this.srcPrimaryKeyValues = srcPrimaryKeyValues; - } - - public DeleteEdgeRequest dstPrimaryKeyValues(List<@Valid Property> dstPrimaryKeyValues) { - this.dstPrimaryKeyValues = dstPrimaryKeyValues; - return this; - } - - public DeleteEdgeRequest addDstPrimaryKeyValuesItem(Property dstPrimaryKeyValuesItem) { - if (this.dstPrimaryKeyValues == null) { - this.dstPrimaryKeyValues = new ArrayList<>(); - } - this.dstPrimaryKeyValues.add(dstPrimaryKeyValuesItem); - return this; - } - - /** - * Primary key values for the destination vertex. - * @return dstPrimaryKeyValues - */ - @Valid - @Schema(name = "dst_primary_key_values", description = "Primary key values for the destination vertex.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("dst_primary_key_values") - public List<@Valid Property> getDstPrimaryKeyValues() { - return dstPrimaryKeyValues; - } - - public void setDstPrimaryKeyValues(List<@Valid Property> dstPrimaryKeyValues) { - this.dstPrimaryKeyValues = dstPrimaryKeyValues; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteEdgeRequest deleteEdgeRequest = (DeleteEdgeRequest) o; - return Objects.equals(this.edgeLabel, deleteEdgeRequest.edgeLabel) && - Objects.equals(this.srcLabel, deleteEdgeRequest.srcLabel) && - Objects.equals(this.dstLabel, deleteEdgeRequest.dstLabel) && - Objects.equals(this.srcPrimaryKeyValues, deleteEdgeRequest.srcPrimaryKeyValues) && - Objects.equals(this.dstPrimaryKeyValues, deleteEdgeRequest.dstPrimaryKeyValues); - } - - @Override - public int hashCode() { - return Objects.hash(edgeLabel, srcLabel, dstLabel, srcPrimaryKeyValues, dstPrimaryKeyValues); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteEdgeRequest {\n"); - sb.append(" edgeLabel: ").append(toIndentedString(edgeLabel)).append("\n"); - sb.append(" srcLabel: ").append(toIndentedString(srcLabel)).append("\n"); - sb.append(" dstLabel: ").append(toIndentedString(dstLabel)).append("\n"); - sb.append(" srcPrimaryKeyValues: ").append(toIndentedString(srcPrimaryKeyValues)).append("\n"); - sb.append(" dstPrimaryKeyValues: ").append(toIndentedString(dstPrimaryKeyValues)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java deleted file mode 100644 index fc2a09939c7b..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.Property; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DeleteVertexRequest - */ - -@JsonTypeName("delete_vertex_request") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class DeleteVertexRequest { - - private String label; - - @Valid - private List<@Valid Property> primaryKeyValues; - - public DeleteVertexRequest label(String label) { - this.label = label; - return this; - } - - /** - * The label name of the vertex to delete. - * @return label - */ - - @Schema(name = "label", description = "The label name of the vertex to delete.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("label") - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public DeleteVertexRequest primaryKeyValues(List<@Valid Property> primaryKeyValues) { - this.primaryKeyValues = primaryKeyValues; - return this; - } - - public DeleteVertexRequest addPrimaryKeyValuesItem(Property primaryKeyValuesItem) { - if (this.primaryKeyValues == null) { - this.primaryKeyValues = new ArrayList<>(); - } - this.primaryKeyValues.add(primaryKeyValuesItem); - return this; - } - - /** - * The primary key values for locating the vertex. - * @return primaryKeyValues - */ - @Valid - @Schema(name = "primary_key_values", description = "The primary key values for locating the vertex.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("primary_key_values") - public List<@Valid Property> getPrimaryKeyValues() { - return primaryKeyValues; - } - - public void setPrimaryKeyValues(List<@Valid Property> primaryKeyValues) { - this.primaryKeyValues = primaryKeyValues; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteVertexRequest deleteVertexRequest = (DeleteVertexRequest) o; - return Objects.equals(this.label, deleteVertexRequest.label) && - Objects.equals(this.primaryKeyValues, deleteVertexRequest.primaryKeyValues); - } - - @Override - public int hashCode() { - return Objects.hash(label, primaryKeyValues); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteVertexRequest {\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append(" primaryKeyValues: ").append(toIndentedString(primaryKeyValues)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java deleted file mode 100644 index 87731bc126bf..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java +++ /dev/null @@ -1,232 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.Property; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EdgeData - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class EdgeData { - - private String srcLabel; - - private String dstLabel; - - private String edgeLabel; - - private JsonNullable srcPrimaryKeyValue = JsonNullable.undefined(); - - private JsonNullable dstPrimaryKeyValue = JsonNullable.undefined(); - - @Valid - private List<@Valid Property> properties = new ArrayList<>(); - - public EdgeData() { - super(); - } - - /** - * Constructor with only required parameters - */ - public EdgeData(String srcLabel, String dstLabel, String edgeLabel, Object srcPrimaryKeyValue, Object dstPrimaryKeyValue, List<@Valid Property> properties) { - this.srcLabel = srcLabel; - this.dstLabel = dstLabel; - this.edgeLabel = edgeLabel; - this.srcPrimaryKeyValue = JsonNullable.of(srcPrimaryKeyValue); - this.dstPrimaryKeyValue = JsonNullable.of(dstPrimaryKeyValue); - this.properties = properties; - } - - public EdgeData srcLabel(String srcLabel) { - this.srcLabel = srcLabel; - return this; - } - - /** - * Get srcLabel - * @return srcLabel - */ - @NotNull - @Schema(name = "src_label", example = "person", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("src_label") - public String getSrcLabel() { - return srcLabel; - } - - public void setSrcLabel(String srcLabel) { - this.srcLabel = srcLabel; - } - - public EdgeData dstLabel(String dstLabel) { - this.dstLabel = dstLabel; - return this; - } - - /** - * Get dstLabel - * @return dstLabel - */ - @NotNull - @Schema(name = "dst_label", example = "software", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("dst_label") - public String getDstLabel() { - return dstLabel; - } - - public void setDstLabel(String dstLabel) { - this.dstLabel = dstLabel; - } - - public EdgeData edgeLabel(String edgeLabel) { - this.edgeLabel = edgeLabel; - return this; - } - - /** - * Get edgeLabel - * @return edgeLabel - */ - @NotNull - @Schema(name = "edge_label", example = "created", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("edge_label") - public String getEdgeLabel() { - return edgeLabel; - } - - public void setEdgeLabel(String edgeLabel) { - this.edgeLabel = edgeLabel; - } - - public EdgeData srcPrimaryKeyValue(Object srcPrimaryKeyValue) { - this.srcPrimaryKeyValue = JsonNullable.of(srcPrimaryKeyValue); - return this; - } - - /** - * Get srcPrimaryKeyValue - * @return srcPrimaryKeyValue - */ - @NotNull - @Schema(name = "src_primary_key_value", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("src_primary_key_value") - public JsonNullable getSrcPrimaryKeyValue() { - return srcPrimaryKeyValue; - } - - public void setSrcPrimaryKeyValue(JsonNullable srcPrimaryKeyValue) { - this.srcPrimaryKeyValue = srcPrimaryKeyValue; - } - - public EdgeData dstPrimaryKeyValue(Object dstPrimaryKeyValue) { - this.dstPrimaryKeyValue = JsonNullable.of(dstPrimaryKeyValue); - return this; - } - - /** - * Get dstPrimaryKeyValue - * @return dstPrimaryKeyValue - */ - @NotNull - @Schema(name = "dst_primary_key_value", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("dst_primary_key_value") - public JsonNullable getDstPrimaryKeyValue() { - return dstPrimaryKeyValue; - } - - public void setDstPrimaryKeyValue(JsonNullable dstPrimaryKeyValue) { - this.dstPrimaryKeyValue = dstPrimaryKeyValue; - } - - public EdgeData properties(List<@Valid Property> properties) { - this.properties = properties; - return this; - } - - public EdgeData addPropertiesItem(Property propertiesItem) { - if (this.properties == null) { - this.properties = new ArrayList<>(); - } - this.properties.add(propertiesItem); - return this; - } - - /** - * Get properties - * @return properties - */ - @NotNull @Valid - @Schema(name = "properties", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("properties") - public List<@Valid Property> getProperties() { - return properties; - } - - public void setProperties(List<@Valid Property> properties) { - this.properties = properties; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EdgeData edgeData = (EdgeData) o; - return Objects.equals(this.srcLabel, edgeData.srcLabel) && - Objects.equals(this.dstLabel, edgeData.dstLabel) && - Objects.equals(this.edgeLabel, edgeData.edgeLabel) && - Objects.equals(this.srcPrimaryKeyValue, edgeData.srcPrimaryKeyValue) && - Objects.equals(this.dstPrimaryKeyValue, edgeData.dstPrimaryKeyValue) && - Objects.equals(this.properties, edgeData.properties); - } - - @Override - public int hashCode() { - return Objects.hash(srcLabel, dstLabel, edgeLabel, srcPrimaryKeyValue, dstPrimaryKeyValue, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeData {\n"); - sb.append(" srcLabel: ").append(toIndentedString(srcLabel)).append("\n"); - sb.append(" dstLabel: ").append(toIndentedString(dstLabel)).append("\n"); - sb.append(" edgeLabel: ").append(toIndentedString(edgeLabel)).append("\n"); - sb.append(" srcPrimaryKeyValue: ").append(toIndentedString(srcPrimaryKeyValue)).append("\n"); - sb.append(" dstPrimaryKeyValue: ").append(toIndentedString(dstPrimaryKeyValue)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java deleted file mode 100644 index f5c0907988cc..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.ColumnMapping; -import com.alibaba.graphscope.groot.service.models.EdgeMappingDestinationVertexMappingsInner; -import com.alibaba.graphscope.groot.service.models.EdgeMappingSourceVertexMappingsInner; -import com.alibaba.graphscope.groot.service.models.EdgeMappingTypeTriplet; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EdgeMapping - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class EdgeMapping { - - private EdgeMappingTypeTriplet typeTriplet; - - @Valid - private List inputs; - - @Valid - private List<@Valid EdgeMappingSourceVertexMappingsInner> sourceVertexMappings; - - @Valid - private List<@Valid EdgeMappingDestinationVertexMappingsInner> destinationVertexMappings; - - @Valid - private List<@Valid ColumnMapping> columnMappings; - - public EdgeMapping typeTriplet(EdgeMappingTypeTriplet typeTriplet) { - this.typeTriplet = typeTriplet; - return this; - } - - /** - * Get typeTriplet - * @return typeTriplet - */ - @Valid - @Schema(name = "type_triplet", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_triplet") - public EdgeMappingTypeTriplet getTypeTriplet() { - return typeTriplet; - } - - public void setTypeTriplet(EdgeMappingTypeTriplet typeTriplet) { - this.typeTriplet = typeTriplet; - } - - public EdgeMapping inputs(List inputs) { - this.inputs = inputs; - return this; - } - - public EdgeMapping addInputsItem(String inputsItem) { - if (this.inputs == null) { - this.inputs = new ArrayList<>(); - } - this.inputs.add(inputsItem); - return this; - } - - /** - * Get inputs - * @return inputs - */ - - @Schema(name = "inputs", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("inputs") - public List getInputs() { - return inputs; - } - - public void setInputs(List inputs) { - this.inputs = inputs; - } - - public EdgeMapping sourceVertexMappings(List<@Valid EdgeMappingSourceVertexMappingsInner> sourceVertexMappings) { - this.sourceVertexMappings = sourceVertexMappings; - return this; - } - - public EdgeMapping addSourceVertexMappingsItem(EdgeMappingSourceVertexMappingsInner sourceVertexMappingsItem) { - if (this.sourceVertexMappings == null) { - this.sourceVertexMappings = new ArrayList<>(); - } - this.sourceVertexMappings.add(sourceVertexMappingsItem); - return this; - } - - /** - * Get sourceVertexMappings - * @return sourceVertexMappings - */ - @Valid - @Schema(name = "source_vertex_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("source_vertex_mappings") - public List<@Valid EdgeMappingSourceVertexMappingsInner> getSourceVertexMappings() { - return sourceVertexMappings; - } - - public void setSourceVertexMappings(List<@Valid EdgeMappingSourceVertexMappingsInner> sourceVertexMappings) { - this.sourceVertexMappings = sourceVertexMappings; - } - - public EdgeMapping destinationVertexMappings(List<@Valid EdgeMappingDestinationVertexMappingsInner> destinationVertexMappings) { - this.destinationVertexMappings = destinationVertexMappings; - return this; - } - - public EdgeMapping addDestinationVertexMappingsItem(EdgeMappingDestinationVertexMappingsInner destinationVertexMappingsItem) { - if (this.destinationVertexMappings == null) { - this.destinationVertexMappings = new ArrayList<>(); - } - this.destinationVertexMappings.add(destinationVertexMappingsItem); - return this; - } - - /** - * Get destinationVertexMappings - * @return destinationVertexMappings - */ - @Valid - @Schema(name = "destination_vertex_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("destination_vertex_mappings") - public List<@Valid EdgeMappingDestinationVertexMappingsInner> getDestinationVertexMappings() { - return destinationVertexMappings; - } - - public void setDestinationVertexMappings(List<@Valid EdgeMappingDestinationVertexMappingsInner> destinationVertexMappings) { - this.destinationVertexMappings = destinationVertexMappings; - } - - public EdgeMapping columnMappings(List<@Valid ColumnMapping> columnMappings) { - this.columnMappings = columnMappings; - return this; - } - - public EdgeMapping addColumnMappingsItem(ColumnMapping columnMappingsItem) { - if (this.columnMappings == null) { - this.columnMappings = new ArrayList<>(); - } - this.columnMappings.add(columnMappingsItem); - return this; - } - - /** - * Get columnMappings - * @return columnMappings - */ - @Valid - @Schema(name = "column_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("column_mappings") - public List<@Valid ColumnMapping> getColumnMappings() { - return columnMappings; - } - - public void setColumnMappings(List<@Valid ColumnMapping> columnMappings) { - this.columnMappings = columnMappings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EdgeMapping edgeMapping = (EdgeMapping) o; - return Objects.equals(this.typeTriplet, edgeMapping.typeTriplet) && - Objects.equals(this.inputs, edgeMapping.inputs) && - Objects.equals(this.sourceVertexMappings, edgeMapping.sourceVertexMappings) && - Objects.equals(this.destinationVertexMappings, edgeMapping.destinationVertexMappings) && - Objects.equals(this.columnMappings, edgeMapping.columnMappings); - } - - @Override - public int hashCode() { - return Objects.hash(typeTriplet, inputs, sourceVertexMappings, destinationVertexMappings, columnMappings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeMapping {\n"); - sb.append(" typeTriplet: ").append(toIndentedString(typeTriplet)).append("\n"); - sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n"); - sb.append(" sourceVertexMappings: ").append(toIndentedString(sourceVertexMappings)).append("\n"); - sb.append(" destinationVertexMappings: ").append(toIndentedString(destinationVertexMappings)).append("\n"); - sb.append(" columnMappings: ").append(toIndentedString(columnMappings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java deleted file mode 100644 index 3d9d5d47f5d2..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.EdgeMappingSourceVertexMappingsInnerColumn; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Mapping column to the primary key of destination vertex - */ - -@Schema(name = "EdgeMapping_destination_vertex_mappings_inner", description = "Mapping column to the primary key of destination vertex") -@JsonTypeName("EdgeMapping_destination_vertex_mappings_inner") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class EdgeMappingDestinationVertexMappingsInner { - - private EdgeMappingSourceVertexMappingsInnerColumn column; - - private String property; - - public EdgeMappingDestinationVertexMappingsInner column(EdgeMappingSourceVertexMappingsInnerColumn column) { - this.column = column; - return this; - } - - /** - * Get column - * @return column - */ - @Valid - @Schema(name = "column", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("column") - public EdgeMappingSourceVertexMappingsInnerColumn getColumn() { - return column; - } - - public void setColumn(EdgeMappingSourceVertexMappingsInnerColumn column) { - this.column = column; - } - - public EdgeMappingDestinationVertexMappingsInner property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @Schema(name = "property", example = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("property") - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EdgeMappingDestinationVertexMappingsInner edgeMappingDestinationVertexMappingsInner = (EdgeMappingDestinationVertexMappingsInner) o; - return Objects.equals(this.column, edgeMappingDestinationVertexMappingsInner.column) && - Objects.equals(this.property, edgeMappingDestinationVertexMappingsInner.property); - } - - @Override - public int hashCode() { - return Objects.hash(column, property); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeMappingDestinationVertexMappingsInner {\n"); - sb.append(" column: ").append(toIndentedString(column)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java deleted file mode 100644 index ad91cb234a8b..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.EdgeMappingSourceVertexMappingsInnerColumn; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Mapping column to the primary key of source vertex - */ - -@Schema(name = "EdgeMapping_source_vertex_mappings_inner", description = "Mapping column to the primary key of source vertex") -@JsonTypeName("EdgeMapping_source_vertex_mappings_inner") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class EdgeMappingSourceVertexMappingsInner { - - private EdgeMappingSourceVertexMappingsInnerColumn column; - - private String property; - - public EdgeMappingSourceVertexMappingsInner column(EdgeMappingSourceVertexMappingsInnerColumn column) { - this.column = column; - return this; - } - - /** - * Get column - * @return column - */ - @Valid - @Schema(name = "column", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("column") - public EdgeMappingSourceVertexMappingsInnerColumn getColumn() { - return column; - } - - public void setColumn(EdgeMappingSourceVertexMappingsInnerColumn column) { - this.column = column; - } - - public EdgeMappingSourceVertexMappingsInner property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @Schema(name = "property", example = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("property") - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EdgeMappingSourceVertexMappingsInner edgeMappingSourceVertexMappingsInner = (EdgeMappingSourceVertexMappingsInner) o; - return Objects.equals(this.column, edgeMappingSourceVertexMappingsInner.column) && - Objects.equals(this.property, edgeMappingSourceVertexMappingsInner.property); - } - - @Override - public int hashCode() { - return Objects.hash(column, property); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeMappingSourceVertexMappingsInner {\n"); - sb.append(" column: ").append(toIndentedString(column)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java deleted file mode 100644 index c04ff1cfa577..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EdgeMappingSourceVertexMappingsInnerColumn - */ - -@JsonTypeName("EdgeMapping_source_vertex_mappings_inner_column") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class EdgeMappingSourceVertexMappingsInnerColumn { - - private Integer index; - - private String name; - - public EdgeMappingSourceVertexMappingsInnerColumn index(Integer index) { - this.index = index; - return this; - } - - /** - * Get index - * @return index - */ - - @Schema(name = "index", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("index") - public Integer getIndex() { - return index; - } - - public void setIndex(Integer index) { - this.index = index; - } - - public EdgeMappingSourceVertexMappingsInnerColumn name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EdgeMappingSourceVertexMappingsInnerColumn edgeMappingSourceVertexMappingsInnerColumn = (EdgeMappingSourceVertexMappingsInnerColumn) o; - return Objects.equals(this.index, edgeMappingSourceVertexMappingsInnerColumn.index) && - Objects.equals(this.name, edgeMappingSourceVertexMappingsInnerColumn.name); - } - - @Override - public int hashCode() { - return Objects.hash(index, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeMappingSourceVertexMappingsInnerColumn {\n"); - sb.append(" index: ").append(toIndentedString(index)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java deleted file mode 100644 index d0c9b3a768a2..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * source label -> [edge label] -> destination label - */ - -@Schema(name = "EdgeMapping_type_triplet", description = "source label -> [edge label] -> destination label") -@JsonTypeName("EdgeMapping_type_triplet") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class EdgeMappingTypeTriplet { - - private String edge; - - private String sourceVertex; - - private String destinationVertex; - - public EdgeMappingTypeTriplet edge(String edge) { - this.edge = edge; - return this; - } - - /** - * Get edge - * @return edge - */ - - @Schema(name = "edge", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("edge") - public String getEdge() { - return edge; - } - - public void setEdge(String edge) { - this.edge = edge; - } - - public EdgeMappingTypeTriplet sourceVertex(String sourceVertex) { - this.sourceVertex = sourceVertex; - return this; - } - - /** - * Get sourceVertex - * @return sourceVertex - */ - - @Schema(name = "source_vertex", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("source_vertex") - public String getSourceVertex() { - return sourceVertex; - } - - public void setSourceVertex(String sourceVertex) { - this.sourceVertex = sourceVertex; - } - - public EdgeMappingTypeTriplet destinationVertex(String destinationVertex) { - this.destinationVertex = destinationVertex; - return this; - } - - /** - * Get destinationVertex - * @return destinationVertex - */ - - @Schema(name = "destination_vertex", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("destination_vertex") - public String getDestinationVertex() { - return destinationVertex; - } - - public void setDestinationVertex(String destinationVertex) { - this.destinationVertex = destinationVertex; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EdgeMappingTypeTriplet edgeMappingTypeTriplet = (EdgeMappingTypeTriplet) o; - return Objects.equals(this.edge, edgeMappingTypeTriplet.edge) && - Objects.equals(this.sourceVertex, edgeMappingTypeTriplet.sourceVertex) && - Objects.equals(this.destinationVertex, edgeMappingTypeTriplet.destinationVertex); - } - - @Override - public int hashCode() { - return Objects.hash(edge, sourceVertex, destinationVertex); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeMappingTypeTriplet {\n"); - sb.append(" edge: ").append(toIndentedString(edge)).append("\n"); - sb.append(" sourceVertex: ").append(toIndentedString(sourceVertex)).append("\n"); - sb.append(" destinationVertex: ").append(toIndentedString(destinationVertex)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java deleted file mode 100644 index f411a1174ed2..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java +++ /dev/null @@ -1,249 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.Property; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EdgeRequest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class EdgeRequest { - - private String srcLabel; - - private String dstLabel; - - private String edgeLabel; - - @Valid - private List<@Valid Property> srcPrimaryKeyValues = new ArrayList<>(); - - @Valid - private List<@Valid Property> dstPrimaryKeyValues = new ArrayList<>(); - - @Valid - private List<@Valid Property> properties; - - public EdgeRequest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public EdgeRequest(String srcLabel, String dstLabel, String edgeLabel, List<@Valid Property> srcPrimaryKeyValues, List<@Valid Property> dstPrimaryKeyValues) { - this.srcLabel = srcLabel; - this.dstLabel = dstLabel; - this.edgeLabel = edgeLabel; - this.srcPrimaryKeyValues = srcPrimaryKeyValues; - this.dstPrimaryKeyValues = dstPrimaryKeyValues; - } - - public EdgeRequest srcLabel(String srcLabel) { - this.srcLabel = srcLabel; - return this; - } - - /** - * Get srcLabel - * @return srcLabel - */ - @NotNull - @Schema(name = "src_label", example = "person", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("src_label") - public String getSrcLabel() { - return srcLabel; - } - - public void setSrcLabel(String srcLabel) { - this.srcLabel = srcLabel; - } - - public EdgeRequest dstLabel(String dstLabel) { - this.dstLabel = dstLabel; - return this; - } - - /** - * Get dstLabel - * @return dstLabel - */ - @NotNull - @Schema(name = "dst_label", example = "software", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("dst_label") - public String getDstLabel() { - return dstLabel; - } - - public void setDstLabel(String dstLabel) { - this.dstLabel = dstLabel; - } - - public EdgeRequest edgeLabel(String edgeLabel) { - this.edgeLabel = edgeLabel; - return this; - } - - /** - * Get edgeLabel - * @return edgeLabel - */ - @NotNull - @Schema(name = "edge_label", example = "created", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("edge_label") - public String getEdgeLabel() { - return edgeLabel; - } - - public void setEdgeLabel(String edgeLabel) { - this.edgeLabel = edgeLabel; - } - - public EdgeRequest srcPrimaryKeyValues(List<@Valid Property> srcPrimaryKeyValues) { - this.srcPrimaryKeyValues = srcPrimaryKeyValues; - return this; - } - - public EdgeRequest addSrcPrimaryKeyValuesItem(Property srcPrimaryKeyValuesItem) { - if (this.srcPrimaryKeyValues == null) { - this.srcPrimaryKeyValues = new ArrayList<>(); - } - this.srcPrimaryKeyValues.add(srcPrimaryKeyValuesItem); - return this; - } - - /** - * Get srcPrimaryKeyValues - * @return srcPrimaryKeyValues - */ - @NotNull @Valid - @Schema(name = "src_primary_key_values", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("src_primary_key_values") - public List<@Valid Property> getSrcPrimaryKeyValues() { - return srcPrimaryKeyValues; - } - - public void setSrcPrimaryKeyValues(List<@Valid Property> srcPrimaryKeyValues) { - this.srcPrimaryKeyValues = srcPrimaryKeyValues; - } - - public EdgeRequest dstPrimaryKeyValues(List<@Valid Property> dstPrimaryKeyValues) { - this.dstPrimaryKeyValues = dstPrimaryKeyValues; - return this; - } - - public EdgeRequest addDstPrimaryKeyValuesItem(Property dstPrimaryKeyValuesItem) { - if (this.dstPrimaryKeyValues == null) { - this.dstPrimaryKeyValues = new ArrayList<>(); - } - this.dstPrimaryKeyValues.add(dstPrimaryKeyValuesItem); - return this; - } - - /** - * Get dstPrimaryKeyValues - * @return dstPrimaryKeyValues - */ - @NotNull @Valid - @Schema(name = "dst_primary_key_values", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("dst_primary_key_values") - public List<@Valid Property> getDstPrimaryKeyValues() { - return dstPrimaryKeyValues; - } - - public void setDstPrimaryKeyValues(List<@Valid Property> dstPrimaryKeyValues) { - this.dstPrimaryKeyValues = dstPrimaryKeyValues; - } - - public EdgeRequest properties(List<@Valid Property> properties) { - this.properties = properties; - return this; - } - - public EdgeRequest addPropertiesItem(Property propertiesItem) { - if (this.properties == null) { - this.properties = new ArrayList<>(); - } - this.properties.add(propertiesItem); - return this; - } - - /** - * Get properties - * @return properties - */ - @Valid - @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("properties") - public List<@Valid Property> getProperties() { - return properties; - } - - public void setProperties(List<@Valid Property> properties) { - this.properties = properties; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EdgeRequest edgeRequest = (EdgeRequest) o; - return Objects.equals(this.srcLabel, edgeRequest.srcLabel) && - Objects.equals(this.dstLabel, edgeRequest.dstLabel) && - Objects.equals(this.edgeLabel, edgeRequest.edgeLabel) && - Objects.equals(this.srcPrimaryKeyValues, edgeRequest.srcPrimaryKeyValues) && - Objects.equals(this.dstPrimaryKeyValues, edgeRequest.dstPrimaryKeyValues) && - Objects.equals(this.properties, edgeRequest.properties); - } - - @Override - public int hashCode() { - return Objects.hash(srcLabel, dstLabel, edgeLabel, srcPrimaryKeyValues, dstPrimaryKeyValues, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeRequest {\n"); - sb.append(" srcLabel: ").append(toIndentedString(srcLabel)).append("\n"); - sb.append(" dstLabel: ").append(toIndentedString(dstLabel)).append("\n"); - sb.append(" edgeLabel: ").append(toIndentedString(edgeLabel)).append("\n"); - sb.append(" srcPrimaryKeyValues: ").append(toIndentedString(srcPrimaryKeyValues)).append("\n"); - sb.append(" dstPrimaryKeyValues: ").append(toIndentedString(dstPrimaryKeyValues)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java deleted file mode 100644 index 987e7d03c101..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.VertexTypePairStatistics; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EdgeStatistics - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class EdgeStatistics { - - private Integer typeId; - - private String typeName; - - @Valid - private List<@Valid VertexTypePairStatistics> vertexTypePairStatistics; - - public EdgeStatistics typeId(Integer typeId) { - this.typeId = typeId; - return this; - } - - /** - * Get typeId - * @return typeId - */ - - @Schema(name = "type_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_id") - public Integer getTypeId() { - return typeId; - } - - public void setTypeId(Integer typeId) { - this.typeId = typeId; - } - - public EdgeStatistics typeName(String typeName) { - this.typeName = typeName; - return this; - } - - /** - * Get typeName - * @return typeName - */ - - @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_name") - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public EdgeStatistics vertexTypePairStatistics(List<@Valid VertexTypePairStatistics> vertexTypePairStatistics) { - this.vertexTypePairStatistics = vertexTypePairStatistics; - return this; - } - - public EdgeStatistics addVertexTypePairStatisticsItem(VertexTypePairStatistics vertexTypePairStatisticsItem) { - if (this.vertexTypePairStatistics == null) { - this.vertexTypePairStatistics = new ArrayList<>(); - } - this.vertexTypePairStatistics.add(vertexTypePairStatisticsItem); - return this; - } - - /** - * Get vertexTypePairStatistics - * @return vertexTypePairStatistics - */ - @Valid - @Schema(name = "vertex_type_pair_statistics", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("vertex_type_pair_statistics") - public List<@Valid VertexTypePairStatistics> getVertexTypePairStatistics() { - return vertexTypePairStatistics; - } - - public void setVertexTypePairStatistics(List<@Valid VertexTypePairStatistics> vertexTypePairStatistics) { - this.vertexTypePairStatistics = vertexTypePairStatistics; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EdgeStatistics edgeStatistics = (EdgeStatistics) o; - return Objects.equals(this.typeId, edgeStatistics.typeId) && - Objects.equals(this.typeName, edgeStatistics.typeName) && - Objects.equals(this.vertexTypePairStatistics, edgeStatistics.vertexTypePairStatistics); - } - - @Override - public int hashCode() { - return Objects.hash(typeId, typeName, vertexTypePairStatistics); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeStatistics {\n"); - sb.append(" typeId: ").append(toIndentedString(typeId)).append("\n"); - sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); - sb.append(" vertexTypePairStatistics: ").append(toIndentedString(vertexTypePairStatistics)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java deleted file mode 100644 index 766be43a4cda..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.FixedCharChar; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FixedChar - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class FixedChar implements StringTypeString { - - private FixedCharChar _char; - - public FixedChar() { - super(); - } - - /** - * Constructor with only required parameters - */ - public FixedChar(FixedCharChar _char) { - this._char = _char; - } - - public FixedChar _char(FixedCharChar _char) { - this._char = _char; - return this; - } - - /** - * Get _char - * @return _char - */ - @NotNull @Valid - @Schema(name = "char", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("char") - public FixedCharChar getChar() { - return _char; - } - - public void setChar(FixedCharChar _char) { - this._char = _char; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FixedChar fixedChar = (FixedChar) o; - return Objects.equals(this._char, fixedChar._char); - } - - @Override - public int hashCode() { - return Objects.hash(_char); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FixedChar {\n"); - sb.append(" _char: ").append(toIndentedString(_char)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java deleted file mode 100644 index 792a46f02364..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FixedCharChar - */ - -@JsonTypeName("FixedChar_char") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class FixedCharChar { - - private Integer fixedLength; - - public FixedCharChar() { - super(); - } - - /** - * Constructor with only required parameters - */ - public FixedCharChar(Integer fixedLength) { - this.fixedLength = fixedLength; - } - - public FixedCharChar fixedLength(Integer fixedLength) { - this.fixedLength = fixedLength; - return this; - } - - /** - * Get fixedLength - * @return fixedLength - */ - @NotNull - @Schema(name = "fixed_length", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("fixed_length") - public Integer getFixedLength() { - return fixedLength; - } - - public void setFixedLength(Integer fixedLength) { - this.fixedLength = fixedLength; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FixedCharChar fixedCharChar = (FixedCharChar) o; - return Objects.equals(this.fixedLength, fixedCharChar.fixedLength); - } - - @Override - public int hashCode() { - return Objects.hash(fixedLength); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FixedCharChar {\n"); - sb.append(" fixedLength: ").append(toIndentedString(fixedLength)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java deleted file mode 100644 index 5aa1f9e1f386..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java +++ /dev/null @@ -1,202 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; -import com.alibaba.graphscope.groot.service.models.GetPropertyMeta; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * GetEdgeType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class GetEdgeType { - - private String typeName; - - @Valid - private List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations; - - private Integer typeId; - - private String description; - - @Valid - private List<@Valid GetPropertyMeta> properties; - - public GetEdgeType typeName(String typeName) { - this.typeName = typeName; - return this; - } - - /** - * Get typeName - * @return typeName - */ - - @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_name") - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public GetEdgeType vertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { - this.vertexTypePairRelations = vertexTypePairRelations; - return this; - } - - public GetEdgeType addVertexTypePairRelationsItem(BaseEdgeTypeVertexTypePairRelationsInner vertexTypePairRelationsItem) { - if (this.vertexTypePairRelations == null) { - this.vertexTypePairRelations = new ArrayList<>(); - } - this.vertexTypePairRelations.add(vertexTypePairRelationsItem); - return this; - } - - /** - * Get vertexTypePairRelations - * @return vertexTypePairRelations - */ - @Valid - @Schema(name = "vertex_type_pair_relations", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("vertex_type_pair_relations") - public List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> getVertexTypePairRelations() { - return vertexTypePairRelations; - } - - public void setVertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { - this.vertexTypePairRelations = vertexTypePairRelations; - } - - public GetEdgeType typeId(Integer typeId) { - this.typeId = typeId; - return this; - } - - /** - * Get typeId - * @return typeId - */ - - @Schema(name = "type_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_id") - public Integer getTypeId() { - return typeId; - } - - public void setTypeId(Integer typeId) { - this.typeId = typeId; - } - - public GetEdgeType description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - - @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("description") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public GetEdgeType properties(List<@Valid GetPropertyMeta> properties) { - this.properties = properties; - return this; - } - - public GetEdgeType addPropertiesItem(GetPropertyMeta propertiesItem) { - if (this.properties == null) { - this.properties = new ArrayList<>(); - } - this.properties.add(propertiesItem); - return this; - } - - /** - * Get properties - * @return properties - */ - @Valid - @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("properties") - public List<@Valid GetPropertyMeta> getProperties() { - return properties; - } - - public void setProperties(List<@Valid GetPropertyMeta> properties) { - this.properties = properties; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetEdgeType getEdgeType = (GetEdgeType) o; - return Objects.equals(this.typeName, getEdgeType.typeName) && - Objects.equals(this.vertexTypePairRelations, getEdgeType.vertexTypePairRelations) && - Objects.equals(this.typeId, getEdgeType.typeId) && - Objects.equals(this.description, getEdgeType.description) && - Objects.equals(this.properties, getEdgeType.properties); - } - - @Override - public int hashCode() { - return Objects.hash(typeName, vertexTypePairRelations, typeId, description, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetEdgeType {\n"); - sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); - sb.append(" vertexTypePairRelations: ").append(toIndentedString(vertexTypePairRelations)).append("\n"); - sb.append(" typeId: ").append(toIndentedString(typeId)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java deleted file mode 100644 index 77d15d2655ed..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java +++ /dev/null @@ -1,348 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; -import com.alibaba.graphscope.groot.service.models.GetProcedureResponse; -import com.alibaba.graphscope.groot.service.models.SchemaMapping; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * GetGraphResponse - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class GetGraphResponse { - - private String version; - - private String id; - - private String name; - - private String description; - - /** - * Gets or Sets storeType - */ - public enum StoreTypeEnum { - MUTABLE_CSR("mutable_csr"); - - private String value; - - StoreTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StoreTypeEnum fromValue(String value) { - for (StoreTypeEnum b : StoreTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private StoreTypeEnum storeType; - - private Integer creationTime; - - private Integer dataUpdateTime; - - @Valid - private List<@Valid GetProcedureResponse> storedProcedures; - - private GetGraphSchemaResponse schema; - - private SchemaMapping dataImportConfig; - - public GetGraphResponse version(String version) { - this.version = version; - return this; - } - - /** - * Get version - * @return version - */ - - @Schema(name = "version", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("version") - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public GetGraphResponse id(String id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("id") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public GetGraphResponse name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public GetGraphResponse description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - - @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("description") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public GetGraphResponse storeType(StoreTypeEnum storeType) { - this.storeType = storeType; - return this; - } - - /** - * Get storeType - * @return storeType - */ - - @Schema(name = "store_type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("store_type") - public StoreTypeEnum getStoreType() { - return storeType; - } - - public void setStoreType(StoreTypeEnum storeType) { - this.storeType = storeType; - } - - public GetGraphResponse creationTime(Integer creationTime) { - this.creationTime = creationTime; - return this; - } - - /** - * Get creationTime - * @return creationTime - */ - - @Schema(name = "creation_time", example = "11223444", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("creation_time") - public Integer getCreationTime() { - return creationTime; - } - - public void setCreationTime(Integer creationTime) { - this.creationTime = creationTime; - } - - public GetGraphResponse dataUpdateTime(Integer dataUpdateTime) { - this.dataUpdateTime = dataUpdateTime; - return this; - } - - /** - * Get dataUpdateTime - * @return dataUpdateTime - */ - - @Schema(name = "data_update_time", example = "11123445", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("data_update_time") - public Integer getDataUpdateTime() { - return dataUpdateTime; - } - - public void setDataUpdateTime(Integer dataUpdateTime) { - this.dataUpdateTime = dataUpdateTime; - } - - public GetGraphResponse storedProcedures(List<@Valid GetProcedureResponse> storedProcedures) { - this.storedProcedures = storedProcedures; - return this; - } - - public GetGraphResponse addStoredProceduresItem(GetProcedureResponse storedProceduresItem) { - if (this.storedProcedures == null) { - this.storedProcedures = new ArrayList<>(); - } - this.storedProcedures.add(storedProceduresItem); - return this; - } - - /** - * Get storedProcedures - * @return storedProcedures - */ - @Valid - @Schema(name = "stored_procedures", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("stored_procedures") - public List<@Valid GetProcedureResponse> getStoredProcedures() { - return storedProcedures; - } - - public void setStoredProcedures(List<@Valid GetProcedureResponse> storedProcedures) { - this.storedProcedures = storedProcedures; - } - - public GetGraphResponse schema(GetGraphSchemaResponse schema) { - this.schema = schema; - return this; - } - - /** - * Get schema - * @return schema - */ - @Valid - @Schema(name = "schema", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("schema") - public GetGraphSchemaResponse getSchema() { - return schema; - } - - public void setSchema(GetGraphSchemaResponse schema) { - this.schema = schema; - } - - public GetGraphResponse dataImportConfig(SchemaMapping dataImportConfig) { - this.dataImportConfig = dataImportConfig; - return this; - } - - /** - * Get dataImportConfig - * @return dataImportConfig - */ - @Valid - @Schema(name = "data_import_config", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("data_import_config") - public SchemaMapping getDataImportConfig() { - return dataImportConfig; - } - - public void setDataImportConfig(SchemaMapping dataImportConfig) { - this.dataImportConfig = dataImportConfig; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetGraphResponse getGraphResponse = (GetGraphResponse) o; - return Objects.equals(this.version, getGraphResponse.version) && - Objects.equals(this.id, getGraphResponse.id) && - Objects.equals(this.name, getGraphResponse.name) && - Objects.equals(this.description, getGraphResponse.description) && - Objects.equals(this.storeType, getGraphResponse.storeType) && - Objects.equals(this.creationTime, getGraphResponse.creationTime) && - Objects.equals(this.dataUpdateTime, getGraphResponse.dataUpdateTime) && - Objects.equals(this.storedProcedures, getGraphResponse.storedProcedures) && - Objects.equals(this.schema, getGraphResponse.schema) && - Objects.equals(this.dataImportConfig, getGraphResponse.dataImportConfig); - } - - @Override - public int hashCode() { - return Objects.hash(version, id, name, description, storeType, creationTime, dataUpdateTime, storedProcedures, schema, dataImportConfig); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetGraphResponse {\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" storeType: ").append(toIndentedString(storeType)).append("\n"); - sb.append(" creationTime: ").append(toIndentedString(creationTime)).append("\n"); - sb.append(" dataUpdateTime: ").append(toIndentedString(dataUpdateTime)).append("\n"); - sb.append(" storedProcedures: ").append(toIndentedString(storedProcedures)).append("\n"); - sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); - sb.append(" dataImportConfig: ").append(toIndentedString(dataImportConfig)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java deleted file mode 100644 index bd045197d498..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.GetEdgeType; -import com.alibaba.graphscope.groot.service.models.GetVertexType; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * GetGraphSchemaResponse - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class GetGraphSchemaResponse { - - @Valid - private List<@Valid GetVertexType> vertexTypes; - - @Valid - private List<@Valid GetEdgeType> edgeTypes; - - public GetGraphSchemaResponse vertexTypes(List<@Valid GetVertexType> vertexTypes) { - this.vertexTypes = vertexTypes; - return this; - } - - public GetGraphSchemaResponse addVertexTypesItem(GetVertexType vertexTypesItem) { - if (this.vertexTypes == null) { - this.vertexTypes = new ArrayList<>(); - } - this.vertexTypes.add(vertexTypesItem); - return this; - } - - /** - * Get vertexTypes - * @return vertexTypes - */ - @Valid - @Schema(name = "vertex_types", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("vertex_types") - public List<@Valid GetVertexType> getVertexTypes() { - return vertexTypes; - } - - public void setVertexTypes(List<@Valid GetVertexType> vertexTypes) { - this.vertexTypes = vertexTypes; - } - - public GetGraphSchemaResponse edgeTypes(List<@Valid GetEdgeType> edgeTypes) { - this.edgeTypes = edgeTypes; - return this; - } - - public GetGraphSchemaResponse addEdgeTypesItem(GetEdgeType edgeTypesItem) { - if (this.edgeTypes == null) { - this.edgeTypes = new ArrayList<>(); - } - this.edgeTypes.add(edgeTypesItem); - return this; - } - - /** - * Get edgeTypes - * @return edgeTypes - */ - @Valid - @Schema(name = "edge_types", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("edge_types") - public List<@Valid GetEdgeType> getEdgeTypes() { - return edgeTypes; - } - - public void setEdgeTypes(List<@Valid GetEdgeType> edgeTypes) { - this.edgeTypes = edgeTypes; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetGraphSchemaResponse getGraphSchemaResponse = (GetGraphSchemaResponse) o; - return Objects.equals(this.vertexTypes, getGraphSchemaResponse.vertexTypes) && - Objects.equals(this.edgeTypes, getGraphSchemaResponse.edgeTypes); - } - - @Override - public int hashCode() { - return Objects.hash(vertexTypes, edgeTypes); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetGraphSchemaResponse {\n"); - sb.append(" vertexTypes: ").append(toIndentedString(vertexTypes)).append("\n"); - sb.append(" edgeTypes: ").append(toIndentedString(edgeTypes)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java deleted file mode 100644 index eb579db9d91e..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.EdgeStatistics; -import com.alibaba.graphscope.groot.service.models.VertexStatistics; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * GetGraphStatisticsResponse - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class GetGraphStatisticsResponse { - - private Integer totalVertexCount; - - private Integer totalEdgeCount; - - @Valid - private List<@Valid VertexStatistics> vertexTypeStatistics; - - @Valid - private List<@Valid EdgeStatistics> edgeTypeStatistics; - - public GetGraphStatisticsResponse() { - super(); - } - - /** - * Constructor with only required parameters - */ - public GetGraphStatisticsResponse(Integer totalVertexCount, Integer totalEdgeCount) { - this.totalVertexCount = totalVertexCount; - this.totalEdgeCount = totalEdgeCount; - } - - public GetGraphStatisticsResponse totalVertexCount(Integer totalVertexCount) { - this.totalVertexCount = totalVertexCount; - return this; - } - - /** - * Get totalVertexCount - * @return totalVertexCount - */ - @NotNull - @Schema(name = "total_vertex_count", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("total_vertex_count") - public Integer getTotalVertexCount() { - return totalVertexCount; - } - - public void setTotalVertexCount(Integer totalVertexCount) { - this.totalVertexCount = totalVertexCount; - } - - public GetGraphStatisticsResponse totalEdgeCount(Integer totalEdgeCount) { - this.totalEdgeCount = totalEdgeCount; - return this; - } - - /** - * Get totalEdgeCount - * @return totalEdgeCount - */ - @NotNull - @Schema(name = "total_edge_count", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("total_edge_count") - public Integer getTotalEdgeCount() { - return totalEdgeCount; - } - - public void setTotalEdgeCount(Integer totalEdgeCount) { - this.totalEdgeCount = totalEdgeCount; - } - - public GetGraphStatisticsResponse vertexTypeStatistics(List<@Valid VertexStatistics> vertexTypeStatistics) { - this.vertexTypeStatistics = vertexTypeStatistics; - return this; - } - - public GetGraphStatisticsResponse addVertexTypeStatisticsItem(VertexStatistics vertexTypeStatisticsItem) { - if (this.vertexTypeStatistics == null) { - this.vertexTypeStatistics = new ArrayList<>(); - } - this.vertexTypeStatistics.add(vertexTypeStatisticsItem); - return this; - } - - /** - * Get vertexTypeStatistics - * @return vertexTypeStatistics - */ - @Valid - @Schema(name = "vertex_type_statistics", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("vertex_type_statistics") - public List<@Valid VertexStatistics> getVertexTypeStatistics() { - return vertexTypeStatistics; - } - - public void setVertexTypeStatistics(List<@Valid VertexStatistics> vertexTypeStatistics) { - this.vertexTypeStatistics = vertexTypeStatistics; - } - - public GetGraphStatisticsResponse edgeTypeStatistics(List<@Valid EdgeStatistics> edgeTypeStatistics) { - this.edgeTypeStatistics = edgeTypeStatistics; - return this; - } - - public GetGraphStatisticsResponse addEdgeTypeStatisticsItem(EdgeStatistics edgeTypeStatisticsItem) { - if (this.edgeTypeStatistics == null) { - this.edgeTypeStatistics = new ArrayList<>(); - } - this.edgeTypeStatistics.add(edgeTypeStatisticsItem); - return this; - } - - /** - * Get edgeTypeStatistics - * @return edgeTypeStatistics - */ - @Valid - @Schema(name = "edge_type_statistics", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("edge_type_statistics") - public List<@Valid EdgeStatistics> getEdgeTypeStatistics() { - return edgeTypeStatistics; - } - - public void setEdgeTypeStatistics(List<@Valid EdgeStatistics> edgeTypeStatistics) { - this.edgeTypeStatistics = edgeTypeStatistics; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetGraphStatisticsResponse getGraphStatisticsResponse = (GetGraphStatisticsResponse) o; - return Objects.equals(this.totalVertexCount, getGraphStatisticsResponse.totalVertexCount) && - Objects.equals(this.totalEdgeCount, getGraphStatisticsResponse.totalEdgeCount) && - Objects.equals(this.vertexTypeStatistics, getGraphStatisticsResponse.vertexTypeStatistics) && - Objects.equals(this.edgeTypeStatistics, getGraphStatisticsResponse.edgeTypeStatistics); - } - - @Override - public int hashCode() { - return Objects.hash(totalVertexCount, totalEdgeCount, vertexTypeStatistics, edgeTypeStatistics); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetGraphStatisticsResponse {\n"); - sb.append(" totalVertexCount: ").append(toIndentedString(totalVertexCount)).append("\n"); - sb.append(" totalEdgeCount: ").append(toIndentedString(totalEdgeCount)).append("\n"); - sb.append(" vertexTypeStatistics: ").append(toIndentedString(vertexTypeStatistics)).append("\n"); - sb.append(" edgeTypeStatistics: ").append(toIndentedString(edgeTypeStatistics)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java deleted file mode 100644 index a2c159ea5161..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java +++ /dev/null @@ -1,477 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.Parameter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * GetProcedureResponse - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class GetProcedureResponse { - - private String name; - - private String description; - - /** - * Gets or Sets type - */ - public enum TypeEnum { - CPP("cpp"), - - CYPHER("cypher"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private TypeEnum type; - - private String query; - - private String id; - - private String library; - - @Valid - private List<@Valid Parameter> params; - - @Valid - private List<@Valid Parameter> returns; - - private Boolean enable; - - @Valid - private Map option = new HashMap<>(); - - private String boundGraph; - - private Boolean runnable; - - private Integer creationTime; - - private Integer updateTime; - - public GetProcedureResponse() { - super(); - } - - /** - * Constructor with only required parameters - */ - public GetProcedureResponse(String name, TypeEnum type, String query) { - this.name = name; - this.type = type; - this.query = query; - } - - public GetProcedureResponse name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", example = "query1", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public GetProcedureResponse description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - - @Schema(name = "description", example = "A sample stored procedure", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("description") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public GetProcedureResponse type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @NotNull - @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("type") - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public GetProcedureResponse query(String query) { - this.query = query; - return this; - } - - /** - * Get query - * @return query - */ - @NotNull - @Schema(name = "query", example = "MATCH(a) return COUNT(a);", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("query") - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public GetProcedureResponse id(String id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", example = "The unique identifier of procedure, currently is same with name.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("id") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public GetProcedureResponse library(String library) { - this.library = library; - return this; - } - - /** - * Get library - * @return library - */ - - @Schema(name = "library", example = "/path/to/library", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("library") - public String getLibrary() { - return library; - } - - public void setLibrary(String library) { - this.library = library; - } - - public GetProcedureResponse params(List<@Valid Parameter> params) { - this.params = params; - return this; - } - - public GetProcedureResponse addParamsItem(Parameter paramsItem) { - if (this.params == null) { - this.params = new ArrayList<>(); - } - this.params.add(paramsItem); - return this; - } - - /** - * Get params - * @return params - */ - @Valid - @Schema(name = "params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("params") - public List<@Valid Parameter> getParams() { - return params; - } - - public void setParams(List<@Valid Parameter> params) { - this.params = params; - } - - public GetProcedureResponse returns(List<@Valid Parameter> returns) { - this.returns = returns; - return this; - } - - public GetProcedureResponse addReturnsItem(Parameter returnsItem) { - if (this.returns == null) { - this.returns = new ArrayList<>(); - } - this.returns.add(returnsItem); - return this; - } - - /** - * Get returns - * @return returns - */ - @Valid - @Schema(name = "returns", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("returns") - public List<@Valid Parameter> getReturns() { - return returns; - } - - public void setReturns(List<@Valid Parameter> returns) { - this.returns = returns; - } - - public GetProcedureResponse enable(Boolean enable) { - this.enable = enable; - return this; - } - - /** - * Get enable - * @return enable - */ - - @Schema(name = "enable", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("enable") - public Boolean getEnable() { - return enable; - } - - public void setEnable(Boolean enable) { - this.enable = enable; - } - - public GetProcedureResponse option(Map option) { - this.option = option; - return this; - } - - public GetProcedureResponse putOptionItem(String key, Object optionItem) { - if (this.option == null) { - this.option = new HashMap<>(); - } - this.option.put(key, optionItem); - return this; - } - - /** - * Get option - * @return option - */ - - @Schema(name = "option", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("option") - public Map getOption() { - return option; - } - - public void setOption(Map option) { - this.option = option; - } - - public GetProcedureResponse boundGraph(String boundGraph) { - this.boundGraph = boundGraph; - return this; - } - - /** - * Get boundGraph - * @return boundGraph - */ - - @Schema(name = "bound_graph", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("bound_graph") - public String getBoundGraph() { - return boundGraph; - } - - public void setBoundGraph(String boundGraph) { - this.boundGraph = boundGraph; - } - - public GetProcedureResponse runnable(Boolean runnable) { - this.runnable = runnable; - return this; - } - - /** - * Get runnable - * @return runnable - */ - - @Schema(name = "runnable", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("runnable") - public Boolean getRunnable() { - return runnable; - } - - public void setRunnable(Boolean runnable) { - this.runnable = runnable; - } - - public GetProcedureResponse creationTime(Integer creationTime) { - this.creationTime = creationTime; - return this; - } - - /** - * Get creationTime - * @return creationTime - */ - - @Schema(name = "creation_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("creation_time") - public Integer getCreationTime() { - return creationTime; - } - - public void setCreationTime(Integer creationTime) { - this.creationTime = creationTime; - } - - public GetProcedureResponse updateTime(Integer updateTime) { - this.updateTime = updateTime; - return this; - } - - /** - * Get updateTime - * @return updateTime - */ - - @Schema(name = "update_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("update_time") - public Integer getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Integer updateTime) { - this.updateTime = updateTime; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetProcedureResponse getProcedureResponse = (GetProcedureResponse) o; - return Objects.equals(this.name, getProcedureResponse.name) && - Objects.equals(this.description, getProcedureResponse.description) && - Objects.equals(this.type, getProcedureResponse.type) && - Objects.equals(this.query, getProcedureResponse.query) && - Objects.equals(this.id, getProcedureResponse.id) && - Objects.equals(this.library, getProcedureResponse.library) && - Objects.equals(this.params, getProcedureResponse.params) && - Objects.equals(this.returns, getProcedureResponse.returns) && - Objects.equals(this.enable, getProcedureResponse.enable) && - Objects.equals(this.option, getProcedureResponse.option) && - Objects.equals(this.boundGraph, getProcedureResponse.boundGraph) && - Objects.equals(this.runnable, getProcedureResponse.runnable) && - Objects.equals(this.creationTime, getProcedureResponse.creationTime) && - Objects.equals(this.updateTime, getProcedureResponse.updateTime); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, type, query, id, library, params, returns, enable, option, boundGraph, runnable, creationTime, updateTime); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetProcedureResponse {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" library: ").append(toIndentedString(library)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append(" returns: ").append(toIndentedString(returns)).append("\n"); - sb.append(" enable: ").append(toIndentedString(enable)).append("\n"); - sb.append(" option: ").append(toIndentedString(option)).append("\n"); - sb.append(" boundGraph: ").append(toIndentedString(boundGraph)).append("\n"); - sb.append(" runnable: ").append(toIndentedString(runnable)).append("\n"); - sb.append(" creationTime: ").append(toIndentedString(creationTime)).append("\n"); - sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java deleted file mode 100644 index 40e9843d59e4..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.GSDataType; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * GetPropertyMeta - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class GetPropertyMeta { - - private String propertyName; - - private GSDataType propertyType; - - private Integer propertyId; - - public GetPropertyMeta propertyName(String propertyName) { - this.propertyName = propertyName; - return this; - } - - /** - * Get propertyName - * @return propertyName - */ - - @Schema(name = "property_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("property_name") - public String getPropertyName() { - return propertyName; - } - - public void setPropertyName(String propertyName) { - this.propertyName = propertyName; - } - - public GetPropertyMeta propertyType(GSDataType propertyType) { - this.propertyType = propertyType; - return this; - } - - /** - * Get propertyType - * @return propertyType - */ - @Valid - @Schema(name = "property_type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("property_type") - public GSDataType getPropertyType() { - return propertyType; - } - - public void setPropertyType(GSDataType propertyType) { - this.propertyType = propertyType; - } - - public GetPropertyMeta propertyId(Integer propertyId) { - this.propertyId = propertyId; - return this; - } - - /** - * Get propertyId - * @return propertyId - */ - - @Schema(name = "property_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("property_id") - public Integer getPropertyId() { - return propertyId; - } - - public void setPropertyId(Integer propertyId) { - this.propertyId = propertyId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetPropertyMeta getPropertyMeta = (GetPropertyMeta) o; - return Objects.equals(this.propertyName, getPropertyMeta.propertyName) && - Objects.equals(this.propertyType, getPropertyMeta.propertyType) && - Objects.equals(this.propertyId, getPropertyMeta.propertyId); - } - - @Override - public int hashCode() { - return Objects.hash(propertyName, propertyType, propertyId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetPropertyMeta {\n"); - sb.append(" propertyName: ").append(toIndentedString(propertyName)).append("\n"); - sb.append(" propertyType: ").append(toIndentedString(propertyType)).append("\n"); - sb.append(" propertyId: ").append(toIndentedString(propertyId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java deleted file mode 100644 index 1c900f530268..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java +++ /dev/null @@ -1,226 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.BaseVertexTypeXCsrParams; -import com.alibaba.graphscope.groot.service.models.GetPropertyMeta; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * GetVertexType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class GetVertexType { - - private String typeName; - - @Valid - private List primaryKeys; - - private BaseVertexTypeXCsrParams xCsrParams; - - private Integer typeId; - - @Valid - private List<@Valid GetPropertyMeta> properties; - - private String description; - - public GetVertexType typeName(String typeName) { - this.typeName = typeName; - return this; - } - - /** - * Get typeName - * @return typeName - */ - - @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_name") - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public GetVertexType primaryKeys(List primaryKeys) { - this.primaryKeys = primaryKeys; - return this; - } - - public GetVertexType addPrimaryKeysItem(String primaryKeysItem) { - if (this.primaryKeys == null) { - this.primaryKeys = new ArrayList<>(); - } - this.primaryKeys.add(primaryKeysItem); - return this; - } - - /** - * Get primaryKeys - * @return primaryKeys - */ - - @Schema(name = "primary_keys", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("primary_keys") - public List getPrimaryKeys() { - return primaryKeys; - } - - public void setPrimaryKeys(List primaryKeys) { - this.primaryKeys = primaryKeys; - } - - public GetVertexType xCsrParams(BaseVertexTypeXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - return this; - } - - /** - * Get xCsrParams - * @return xCsrParams - */ - @Valid - @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("x_csr_params") - public BaseVertexTypeXCsrParams getxCsrParams() { - return xCsrParams; - } - - public void setxCsrParams(BaseVertexTypeXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - } - - public GetVertexType typeId(Integer typeId) { - this.typeId = typeId; - return this; - } - - /** - * Get typeId - * @return typeId - */ - - @Schema(name = "type_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_id") - public Integer getTypeId() { - return typeId; - } - - public void setTypeId(Integer typeId) { - this.typeId = typeId; - } - - public GetVertexType properties(List<@Valid GetPropertyMeta> properties) { - this.properties = properties; - return this; - } - - public GetVertexType addPropertiesItem(GetPropertyMeta propertiesItem) { - if (this.properties == null) { - this.properties = new ArrayList<>(); - } - this.properties.add(propertiesItem); - return this; - } - - /** - * Get properties - * @return properties - */ - @Valid - @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("properties") - public List<@Valid GetPropertyMeta> getProperties() { - return properties; - } - - public void setProperties(List<@Valid GetPropertyMeta> properties) { - this.properties = properties; - } - - public GetVertexType description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - - @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("description") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetVertexType getVertexType = (GetVertexType) o; - return Objects.equals(this.typeName, getVertexType.typeName) && - Objects.equals(this.primaryKeys, getVertexType.primaryKeys) && - Objects.equals(this.xCsrParams, getVertexType.xCsrParams) && - Objects.equals(this.typeId, getVertexType.typeId) && - Objects.equals(this.properties, getVertexType.properties) && - Objects.equals(this.description, getVertexType.description); - } - - @Override - public int hashCode() { - return Objects.hash(typeName, primaryKeys, xCsrParams, typeId, properties, description); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetVertexType {\n"); - sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); - sb.append(" primaryKeys: ").append(toIndentedString(primaryKeys)).append("\n"); - sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); - sb.append(" typeId: ").append(toIndentedString(typeId)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java deleted file mode 100644 index 7a83f8a16a30..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * JobResponse - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class JobResponse { - - private String jobId; - - public JobResponse jobId(String jobId) { - this.jobId = jobId; - return this; - } - - /** - * Get jobId - * @return jobId - */ - - @Schema(name = "job_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("job_id") - public String getJobId() { - return jobId; - } - - public void setJobId(String jobId) { - this.jobId = jobId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JobResponse jobResponse = (JobResponse) o; - return Objects.equals(this.jobId, jobResponse.jobId); - } - - @Override - public int hashCode() { - return Objects.hash(jobId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class JobResponse {\n"); - sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java deleted file mode 100644 index 584d802289c8..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java +++ /dev/null @@ -1,280 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * JobStatus - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class JobStatus { - - private String id; - - private String type; - - /** - * Gets or Sets status - */ - public enum StatusEnum { - RUNNING("RUNNING"), - - SUCCESS("SUCCESS"), - - FAILED("FAILED"), - - CANCELLED("CANCELLED"), - - WAITING("WAITING"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private StatusEnum status; - - private Integer startTime; - - private Integer endTime; - - private String log; - - @Valid - private Map detail = new HashMap<>(); - - public JobStatus id(String id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("id") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public JobStatus type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public JobStatus status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - */ - - @Schema(name = "status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("status") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public JobStatus startTime(Integer startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get startTime - * @return startTime - */ - - @Schema(name = "start_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("start_time") - public Integer getStartTime() { - return startTime; - } - - public void setStartTime(Integer startTime) { - this.startTime = startTime; - } - - public JobStatus endTime(Integer endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get endTime - * @return endTime - */ - - @Schema(name = "end_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("end_time") - public Integer getEndTime() { - return endTime; - } - - public void setEndTime(Integer endTime) { - this.endTime = endTime; - } - - public JobStatus log(String log) { - this.log = log; - return this; - } - - /** - * URL or log string - * @return log - */ - - @Schema(name = "log", description = "URL or log string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("log") - public String getLog() { - return log; - } - - public void setLog(String log) { - this.log = log; - } - - public JobStatus detail(Map detail) { - this.detail = detail; - return this; - } - - public JobStatus putDetailItem(String key, Object detailItem) { - if (this.detail == null) { - this.detail = new HashMap<>(); - } - this.detail.put(key, detailItem); - return this; - } - - /** - * Get detail - * @return detail - */ - - @Schema(name = "detail", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("detail") - public Map getDetail() { - return detail; - } - - public void setDetail(Map detail) { - this.detail = detail; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JobStatus jobStatus = (JobStatus) o; - return Objects.equals(this.id, jobStatus.id) && - Objects.equals(this.type, jobStatus.type) && - Objects.equals(this.status, jobStatus.status) && - Objects.equals(this.startTime, jobStatus.startTime) && - Objects.equals(this.endTime, jobStatus.endTime) && - Objects.equals(this.log, jobStatus.log) && - Objects.equals(this.detail, jobStatus.detail); - } - - @Override - public int hashCode() { - return Objects.hash(id, type, status, startTime, endTime, log, detail); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class JobStatus {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); - sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); - sb.append(" log: ").append(toIndentedString(log)).append("\n"); - sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java deleted file mode 100644 index 3147a5895d6c..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * LongText - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class LongText implements StringTypeString { - - private JsonNullable longText = JsonNullable.undefined(); - - public LongText() { - super(); - } - - /** - * Constructor with only required parameters - */ - public LongText(String longText) { - this.longText = JsonNullable.of(longText); - } - - public LongText longText(String longText) { - this.longText = JsonNullable.of(longText); - return this; - } - - /** - * Get longText - * @return longText - */ - @NotNull - @Schema(name = "long_text", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("long_text") - public JsonNullable getLongText() { - return longText; - } - - public void setLongText(JsonNullable longText) { - this.longText = longText; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LongText longText = (LongText) o; - return Objects.equals(this.longText, longText.longText); - } - - @Override - public int hashCode() { - return Objects.hash(longText); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class LongText {\n"); - sb.append(" longText: ").append(toIndentedString(longText)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java deleted file mode 100644 index 0d056930d27c..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.GSDataType; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Parameter - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class Parameter { - - private String name; - - private GSDataType type; - - public Parameter() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Parameter(String name, GSDataType type) { - this.name = name; - this.type = type; - } - - public Parameter name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", example = "param1", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Parameter type(GSDataType type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @NotNull @Valid - @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("type") - public GSDataType getType() { - return type; - } - - public void setType(GSDataType type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Parameter parameter = (Parameter) o; - return Objects.equals(this.name, parameter.name) && - Objects.equals(this.type, parameter.type); - } - - @Override - public int hashCode() { - return Objects.hash(name, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Parameter {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java deleted file mode 100644 index 9382d5f95314..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * PrimitiveType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class PrimitiveType implements GSDataType { - - /** - * Gets or Sets primitiveType - */ - public enum PrimitiveTypeEnum { - SIGNED_INT32("DT_SIGNED_INT32"), - - UNSIGNED_INT32("DT_UNSIGNED_INT32"), - - SIGNED_INT64("DT_SIGNED_INT64"), - - UNSIGNED_INT64("DT_UNSIGNED_INT64"), - - BOOL("DT_BOOL"), - - FLOAT("DT_FLOAT"), - - DOUBLE("DT_DOUBLE"), - - STRING("DT_STRING"); - - private String value; - - PrimitiveTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static PrimitiveTypeEnum fromValue(String value) { - for (PrimitiveTypeEnum b : PrimitiveTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private PrimitiveTypeEnum primitiveType; - - public PrimitiveType() { - super(); - } - - /** - * Constructor with only required parameters - */ - public PrimitiveType(PrimitiveTypeEnum primitiveType) { - this.primitiveType = primitiveType; - } - - public PrimitiveType primitiveType(PrimitiveTypeEnum primitiveType) { - this.primitiveType = primitiveType; - return this; - } - - /** - * Get primitiveType - * @return primitiveType - */ - @NotNull - @Schema(name = "primitive_type", example = "DT_SIGNED_INT32", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("primitive_type") - public PrimitiveTypeEnum getPrimitiveType() { - return primitiveType; - } - - public void setPrimitiveType(PrimitiveTypeEnum primitiveType) { - this.primitiveType = primitiveType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PrimitiveType primitiveType = (PrimitiveType) o; - return Objects.equals(this.primitiveType, primitiveType.primitiveType); - } - - @Override - public int hashCode() { - return Objects.hash(primitiveType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PrimitiveType {\n"); - sb.append(" primitiveType: ").append(toIndentedString(primitiveType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java deleted file mode 100644 index 00e8bb1ee89a..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/Property.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Property - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class Property { - - private String name; - - private JsonNullable value = JsonNullable.undefined(); - - public Property() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Property(String name, Object value) { - this.name = name; - this.value = JsonNullable.of(value); - } - - public Property name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", example = "id", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Property value(Object value) { - this.value = JsonNullable.of(value); - return this; - } - - /** - * Get value - * @return value - */ - @NotNull - @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("value") - public JsonNullable getValue() { - return value; - } - - public void setValue(JsonNullable value) { - this.value = value; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Property property = (Property) o; - return Objects.equals(this.name, property.name) && - Objects.equals(this.value, property.value); - } - - @Override - public int hashCode() { - return Objects.hash(name, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Property {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java deleted file mode 100644 index 5cf970c14df8..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.TypedValue; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * QueryRequest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class QueryRequest { - - private String queryName; - - @Valid - private List<@Valid TypedValue> arguments; - - public QueryRequest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public QueryRequest(String queryName) { - this.queryName = queryName; - } - - public QueryRequest queryName(String queryName) { - this.queryName = queryName; - return this; - } - - /** - * Get queryName - * @return queryName - */ - @NotNull - @Schema(name = "query_name", example = "ic1", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("query_name") - public String getQueryName() { - return queryName; - } - - public void setQueryName(String queryName) { - this.queryName = queryName; - } - - public QueryRequest arguments(List<@Valid TypedValue> arguments) { - this.arguments = arguments; - return this; - } - - public QueryRequest addArgumentsItem(TypedValue argumentsItem) { - if (this.arguments == null) { - this.arguments = new ArrayList<>(); - } - this.arguments.add(argumentsItem); - return this; - } - - /** - * Get arguments - * @return arguments - */ - @Valid - @Schema(name = "arguments", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("arguments") - public List<@Valid TypedValue> getArguments() { - return arguments; - } - - public void setArguments(List<@Valid TypedValue> arguments) { - this.arguments = arguments; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QueryRequest queryRequest = (QueryRequest) o; - return Objects.equals(this.queryName, queryRequest.queryName) && - Objects.equals(this.arguments, queryRequest.arguments); - } - - @Override - public int hashCode() { - return Objects.hash(queryName, arguments); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QueryRequest {\n"); - sb.append(" queryName: ").append(toIndentedString(queryName)).append("\n"); - sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java deleted file mode 100644 index 013dd6c39d41..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.EdgeMapping; -import com.alibaba.graphscope.groot.service.models.SchemaMappingLoadingConfig; -import com.alibaba.graphscope.groot.service.models.VertexMapping; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SchemaMapping - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class SchemaMapping { - - private SchemaMappingLoadingConfig loadingConfig; - - @Valid - private List<@Valid VertexMapping> vertexMappings; - - @Valid - private List<@Valid EdgeMapping> edgeMappings; - - public SchemaMapping loadingConfig(SchemaMappingLoadingConfig loadingConfig) { - this.loadingConfig = loadingConfig; - return this; - } - - /** - * Get loadingConfig - * @return loadingConfig - */ - @Valid - @Schema(name = "loading_config", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("loading_config") - public SchemaMappingLoadingConfig getLoadingConfig() { - return loadingConfig; - } - - public void setLoadingConfig(SchemaMappingLoadingConfig loadingConfig) { - this.loadingConfig = loadingConfig; - } - - public SchemaMapping vertexMappings(List<@Valid VertexMapping> vertexMappings) { - this.vertexMappings = vertexMappings; - return this; - } - - public SchemaMapping addVertexMappingsItem(VertexMapping vertexMappingsItem) { - if (this.vertexMappings == null) { - this.vertexMappings = new ArrayList<>(); - } - this.vertexMappings.add(vertexMappingsItem); - return this; - } - - /** - * Get vertexMappings - * @return vertexMappings - */ - @Valid - @Schema(name = "vertex_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("vertex_mappings") - public List<@Valid VertexMapping> getVertexMappings() { - return vertexMappings; - } - - public void setVertexMappings(List<@Valid VertexMapping> vertexMappings) { - this.vertexMappings = vertexMappings; - } - - public SchemaMapping edgeMappings(List<@Valid EdgeMapping> edgeMappings) { - this.edgeMappings = edgeMappings; - return this; - } - - public SchemaMapping addEdgeMappingsItem(EdgeMapping edgeMappingsItem) { - if (this.edgeMappings == null) { - this.edgeMappings = new ArrayList<>(); - } - this.edgeMappings.add(edgeMappingsItem); - return this; - } - - /** - * Get edgeMappings - * @return edgeMappings - */ - @Valid - @Schema(name = "edge_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("edge_mappings") - public List<@Valid EdgeMapping> getEdgeMappings() { - return edgeMappings; - } - - public void setEdgeMappings(List<@Valid EdgeMapping> edgeMappings) { - this.edgeMappings = edgeMappings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SchemaMapping schemaMapping = (SchemaMapping) o; - return Objects.equals(this.loadingConfig, schemaMapping.loadingConfig) && - Objects.equals(this.vertexMappings, schemaMapping.vertexMappings) && - Objects.equals(this.edgeMappings, schemaMapping.edgeMappings); - } - - @Override - public int hashCode() { - return Objects.hash(loadingConfig, vertexMappings, edgeMappings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SchemaMapping {\n"); - sb.append(" loadingConfig: ").append(toIndentedString(loadingConfig)).append("\n"); - sb.append(" vertexMappings: ").append(toIndentedString(vertexMappings)).append("\n"); - sb.append(" edgeMappings: ").append(toIndentedString(edgeMappings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java deleted file mode 100644 index 126703a218c3..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java +++ /dev/null @@ -1,196 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.SchemaMappingLoadingConfigDataSource; -import com.alibaba.graphscope.groot.service.models.SchemaMappingLoadingConfigFormat; -import com.alibaba.graphscope.groot.service.models.SchemaMappingLoadingConfigXCsrParams; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SchemaMappingLoadingConfig - */ - -@JsonTypeName("SchemaMapping_loading_config") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class SchemaMappingLoadingConfig { - - private SchemaMappingLoadingConfigXCsrParams xCsrParams; - - private SchemaMappingLoadingConfigDataSource dataSource; - - /** - * Gets or Sets importOption - */ - public enum ImportOptionEnum { - INIT("init"), - - OVERWRITE("overwrite"); - - private String value; - - ImportOptionEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ImportOptionEnum fromValue(String value) { - for (ImportOptionEnum b : ImportOptionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private ImportOptionEnum importOption; - - private SchemaMappingLoadingConfigFormat format; - - public SchemaMappingLoadingConfig xCsrParams(SchemaMappingLoadingConfigXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - return this; - } - - /** - * Get xCsrParams - * @return xCsrParams - */ - @Valid - @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("x_csr_params") - public SchemaMappingLoadingConfigXCsrParams getxCsrParams() { - return xCsrParams; - } - - public void setxCsrParams(SchemaMappingLoadingConfigXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - } - - public SchemaMappingLoadingConfig dataSource(SchemaMappingLoadingConfigDataSource dataSource) { - this.dataSource = dataSource; - return this; - } - - /** - * Get dataSource - * @return dataSource - */ - @Valid - @Schema(name = "data_source", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("data_source") - public SchemaMappingLoadingConfigDataSource getDataSource() { - return dataSource; - } - - public void setDataSource(SchemaMappingLoadingConfigDataSource dataSource) { - this.dataSource = dataSource; - } - - public SchemaMappingLoadingConfig importOption(ImportOptionEnum importOption) { - this.importOption = importOption; - return this; - } - - /** - * Get importOption - * @return importOption - */ - - @Schema(name = "import_option", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("import_option") - public ImportOptionEnum getImportOption() { - return importOption; - } - - public void setImportOption(ImportOptionEnum importOption) { - this.importOption = importOption; - } - - public SchemaMappingLoadingConfig format(SchemaMappingLoadingConfigFormat format) { - this.format = format; - return this; - } - - /** - * Get format - * @return format - */ - @Valid - @Schema(name = "format", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("format") - public SchemaMappingLoadingConfigFormat getFormat() { - return format; - } - - public void setFormat(SchemaMappingLoadingConfigFormat format) { - this.format = format; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SchemaMappingLoadingConfig schemaMappingLoadingConfig = (SchemaMappingLoadingConfig) o; - return Objects.equals(this.xCsrParams, schemaMappingLoadingConfig.xCsrParams) && - Objects.equals(this.dataSource, schemaMappingLoadingConfig.dataSource) && - Objects.equals(this.importOption, schemaMappingLoadingConfig.importOption) && - Objects.equals(this.format, schemaMappingLoadingConfig.format); - } - - @Override - public int hashCode() { - return Objects.hash(xCsrParams, dataSource, importOption, format); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SchemaMappingLoadingConfig {\n"); - sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); - sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); - sb.append(" importOption: ").append(toIndentedString(importOption)).append("\n"); - sb.append(" format: ").append(toIndentedString(format)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java deleted file mode 100644 index c19c2d2a6051..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SchemaMappingLoadingConfigDataSource - */ - -@JsonTypeName("SchemaMapping_loading_config_data_source") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class SchemaMappingLoadingConfigDataSource { - - /** - * Gets or Sets scheme - */ - public enum SchemeEnum { - ODPS("odps"), - - FILE("file"); - - private String value; - - SchemeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SchemeEnum fromValue(String value) { - for (SchemeEnum b : SchemeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private SchemeEnum scheme; - - private String location; - - public SchemaMappingLoadingConfigDataSource scheme(SchemeEnum scheme) { - this.scheme = scheme; - return this; - } - - /** - * Get scheme - * @return scheme - */ - - @Schema(name = "scheme", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("scheme") - public SchemeEnum getScheme() { - return scheme; - } - - public void setScheme(SchemeEnum scheme) { - this.scheme = scheme; - } - - public SchemaMappingLoadingConfigDataSource location(String location) { - this.location = location; - return this; - } - - /** - * Get location - * @return location - */ - - @Schema(name = "location", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("location") - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SchemaMappingLoadingConfigDataSource schemaMappingLoadingConfigDataSource = (SchemaMappingLoadingConfigDataSource) o; - return Objects.equals(this.scheme, schemaMappingLoadingConfigDataSource.scheme) && - Objects.equals(this.location, schemaMappingLoadingConfigDataSource.location); - } - - @Override - public int hashCode() { - return Objects.hash(scheme, location); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SchemaMappingLoadingConfigDataSource {\n"); - sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); - sb.append(" location: ").append(toIndentedString(location)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java deleted file mode 100644 index 68ae03a7318b..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SchemaMappingLoadingConfigFormat - */ - -@JsonTypeName("SchemaMapping_loading_config_format") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class SchemaMappingLoadingConfigFormat { - - private String type; - - @Valid - private Map metadata = new HashMap<>(); - - public SchemaMappingLoadingConfigFormat type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public SchemaMappingLoadingConfigFormat metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public SchemaMappingLoadingConfigFormat putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); - } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Get metadata - * @return metadata - */ - - @Schema(name = "metadata", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("metadata") - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SchemaMappingLoadingConfigFormat schemaMappingLoadingConfigFormat = (SchemaMappingLoadingConfigFormat) o; - return Objects.equals(this.type, schemaMappingLoadingConfigFormat.type) && - Objects.equals(this.metadata, schemaMappingLoadingConfigFormat.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(type, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SchemaMappingLoadingConfigFormat {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java deleted file mode 100644 index 3774e6449955..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * mutable_csr specific parameters - */ - -@Schema(name = "SchemaMapping_loading_config_x_csr_params", description = "mutable_csr specific parameters") -@JsonTypeName("SchemaMapping_loading_config_x_csr_params") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class SchemaMappingLoadingConfigXCsrParams { - - private Integer parallelism; - - private Boolean buildCsrInMem; - - private Boolean useMmapVector; - - public SchemaMappingLoadingConfigXCsrParams parallelism(Integer parallelism) { - this.parallelism = parallelism; - return this; - } - - /** - * Get parallelism - * @return parallelism - */ - - @Schema(name = "parallelism", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("parallelism") - public Integer getParallelism() { - return parallelism; - } - - public void setParallelism(Integer parallelism) { - this.parallelism = parallelism; - } - - public SchemaMappingLoadingConfigXCsrParams buildCsrInMem(Boolean buildCsrInMem) { - this.buildCsrInMem = buildCsrInMem; - return this; - } - - /** - * Get buildCsrInMem - * @return buildCsrInMem - */ - - @Schema(name = "build_csr_in_mem", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("build_csr_in_mem") - public Boolean getBuildCsrInMem() { - return buildCsrInMem; - } - - public void setBuildCsrInMem(Boolean buildCsrInMem) { - this.buildCsrInMem = buildCsrInMem; - } - - public SchemaMappingLoadingConfigXCsrParams useMmapVector(Boolean useMmapVector) { - this.useMmapVector = useMmapVector; - return this; - } - - /** - * Get useMmapVector - * @return useMmapVector - */ - - @Schema(name = "use_mmap_vector", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("use_mmap_vector") - public Boolean getUseMmapVector() { - return useMmapVector; - } - - public void setUseMmapVector(Boolean useMmapVector) { - this.useMmapVector = useMmapVector; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SchemaMappingLoadingConfigXCsrParams schemaMappingLoadingConfigXCsrParams = (SchemaMappingLoadingConfigXCsrParams) o; - return Objects.equals(this.parallelism, schemaMappingLoadingConfigXCsrParams.parallelism) && - Objects.equals(this.buildCsrInMem, schemaMappingLoadingConfigXCsrParams.buildCsrInMem) && - Objects.equals(this.useMmapVector, schemaMappingLoadingConfigXCsrParams.useMmapVector); - } - - @Override - public int hashCode() { - return Objects.hash(parallelism, buildCsrInMem, useMmapVector); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SchemaMappingLoadingConfigXCsrParams {\n"); - sb.append(" parallelism: ").append(toIndentedString(parallelism)).append("\n"); - sb.append(" buildCsrInMem: ").append(toIndentedString(buildCsrInMem)).append("\n"); - sb.append(" useMmapVector: ").append(toIndentedString(useMmapVector)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java deleted file mode 100644 index c6957c9f6328..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java +++ /dev/null @@ -1,228 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.GetGraphResponse; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ServiceStatus - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class ServiceStatus { - - private Boolean statisticsEnabled; - - private String status; - - private GetGraphResponse graph; - - private Integer boltPort; - - private Integer hqpsPort; - - private Integer gremlinPort; - - private Integer startTime; - - public ServiceStatus statisticsEnabled(Boolean statisticsEnabled) { - this.statisticsEnabled = statisticsEnabled; - return this; - } - - /** - * Get statisticsEnabled - * @return statisticsEnabled - */ - - @Schema(name = "statistics_enabled", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("statistics_enabled") - public Boolean getStatisticsEnabled() { - return statisticsEnabled; - } - - public void setStatisticsEnabled(Boolean statisticsEnabled) { - this.statisticsEnabled = statisticsEnabled; - } - - public ServiceStatus status(String status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - */ - - @Schema(name = "status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("status") - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public ServiceStatus graph(GetGraphResponse graph) { - this.graph = graph; - return this; - } - - /** - * Get graph - * @return graph - */ - @Valid - @Schema(name = "graph", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("graph") - public GetGraphResponse getGraph() { - return graph; - } - - public void setGraph(GetGraphResponse graph) { - this.graph = graph; - } - - public ServiceStatus boltPort(Integer boltPort) { - this.boltPort = boltPort; - return this; - } - - /** - * Get boltPort - * @return boltPort - */ - - @Schema(name = "bolt_port", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("bolt_port") - public Integer getBoltPort() { - return boltPort; - } - - public void setBoltPort(Integer boltPort) { - this.boltPort = boltPort; - } - - public ServiceStatus hqpsPort(Integer hqpsPort) { - this.hqpsPort = hqpsPort; - return this; - } - - /** - * Get hqpsPort - * @return hqpsPort - */ - - @Schema(name = "hqps_port", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("hqps_port") - public Integer getHqpsPort() { - return hqpsPort; - } - - public void setHqpsPort(Integer hqpsPort) { - this.hqpsPort = hqpsPort; - } - - public ServiceStatus gremlinPort(Integer gremlinPort) { - this.gremlinPort = gremlinPort; - return this; - } - - /** - * Get gremlinPort - * @return gremlinPort - */ - - @Schema(name = "gremlin_port", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("gremlin_port") - public Integer getGremlinPort() { - return gremlinPort; - } - - public void setGremlinPort(Integer gremlinPort) { - this.gremlinPort = gremlinPort; - } - - public ServiceStatus startTime(Integer startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get startTime - * @return startTime - */ - - @Schema(name = "start_time", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("start_time") - public Integer getStartTime() { - return startTime; - } - - public void setStartTime(Integer startTime) { - this.startTime = startTime; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ServiceStatus serviceStatus = (ServiceStatus) o; - return Objects.equals(this.statisticsEnabled, serviceStatus.statisticsEnabled) && - Objects.equals(this.status, serviceStatus.status) && - Objects.equals(this.graph, serviceStatus.graph) && - Objects.equals(this.boltPort, serviceStatus.boltPort) && - Objects.equals(this.hqpsPort, serviceStatus.hqpsPort) && - Objects.equals(this.gremlinPort, serviceStatus.gremlinPort) && - Objects.equals(this.startTime, serviceStatus.startTime); - } - - @Override - public int hashCode() { - return Objects.hash(statisticsEnabled, status, graph, boltPort, hqpsPort, gremlinPort, startTime); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ServiceStatus {\n"); - sb.append(" statisticsEnabled: ").append(toIndentedString(statisticsEnabled)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" graph: ").append(toIndentedString(graph)).append("\n"); - sb.append(" boltPort: ").append(toIndentedString(boltPort)).append("\n"); - sb.append(" hqpsPort: ").append(toIndentedString(hqpsPort)).append("\n"); - sb.append(" gremlinPort: ").append(toIndentedString(gremlinPort)).append("\n"); - sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java deleted file mode 100644 index ef7981c73a8a..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * StartServiceRequest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class StartServiceRequest { - - private String graphId; - - public StartServiceRequest graphId(String graphId) { - this.graphId = graphId; - return this; - } - - /** - * Get graphId - * @return graphId - */ - - @Schema(name = "graph_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("graph_id") - public String getGraphId() { - return graphId; - } - - public void setGraphId(String graphId) { - this.graphId = graphId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StartServiceRequest startServiceRequest = (StartServiceRequest) o; - return Objects.equals(this.graphId, startServiceRequest.graphId); - } - - @Override - public int hashCode() { - return Objects.hash(graphId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StartServiceRequest {\n"); - sb.append(" graphId: ").append(toIndentedString(graphId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java deleted file mode 100644 index 96455c8dda55..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * StopServiceRequest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class StopServiceRequest { - - private JsonNullable graphId = JsonNullable.undefined(); - - public StopServiceRequest graphId(String graphId) { - this.graphId = JsonNullable.of(graphId); - return this; - } - - /** - * Get graphId - * @return graphId - */ - - @Schema(name = "graph_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("graph_id") - public JsonNullable getGraphId() { - return graphId; - } - - public void setGraphId(JsonNullable graphId) { - this.graphId = graphId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StopServiceRequest stopServiceRequest = (StopServiceRequest) o; - return equalsNullable(this.graphId, stopServiceRequest.graphId); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(hashCodeNullable(graphId)); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StopServiceRequest {\n"); - sb.append(" graphId: ").append(toIndentedString(graphId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java deleted file mode 100644 index aba1a0f8b49f..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java +++ /dev/null @@ -1,381 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.Parameter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * StoredProcedureMeta - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class StoredProcedureMeta { - - private String name; - - private String description; - - /** - * Gets or Sets type - */ - public enum TypeEnum { - CPP("cpp"), - - CYPHER("cypher"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private TypeEnum type; - - private String query; - - private String id; - - private String library; - - @Valid - private List<@Valid Parameter> params; - - @Valid - private List<@Valid Parameter> returns; - - private Boolean enable; - - @Valid - private Map option = new HashMap<>(); - - public StoredProcedureMeta() { - super(); - } - - /** - * Constructor with only required parameters - */ - public StoredProcedureMeta(String name, TypeEnum type, String query) { - this.name = name; - this.type = type; - this.query = query; - } - - public StoredProcedureMeta name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", example = "query1", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public StoredProcedureMeta description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - - @Schema(name = "description", example = "A sample stored procedure", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("description") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public StoredProcedureMeta type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @NotNull - @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("type") - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public StoredProcedureMeta query(String query) { - this.query = query; - return this; - } - - /** - * Get query - * @return query - */ - @NotNull - @Schema(name = "query", example = "MATCH(a) return COUNT(a);", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("query") - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public StoredProcedureMeta id(String id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", example = "The unique identifier of procedure, currently is same with name.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("id") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public StoredProcedureMeta library(String library) { - this.library = library; - return this; - } - - /** - * Get library - * @return library - */ - - @Schema(name = "library", example = "/path/to/library", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("library") - public String getLibrary() { - return library; - } - - public void setLibrary(String library) { - this.library = library; - } - - public StoredProcedureMeta params(List<@Valid Parameter> params) { - this.params = params; - return this; - } - - public StoredProcedureMeta addParamsItem(Parameter paramsItem) { - if (this.params == null) { - this.params = new ArrayList<>(); - } - this.params.add(paramsItem); - return this; - } - - /** - * Get params - * @return params - */ - @Valid - @Schema(name = "params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("params") - public List<@Valid Parameter> getParams() { - return params; - } - - public void setParams(List<@Valid Parameter> params) { - this.params = params; - } - - public StoredProcedureMeta returns(List<@Valid Parameter> returns) { - this.returns = returns; - return this; - } - - public StoredProcedureMeta addReturnsItem(Parameter returnsItem) { - if (this.returns == null) { - this.returns = new ArrayList<>(); - } - this.returns.add(returnsItem); - return this; - } - - /** - * Get returns - * @return returns - */ - @Valid - @Schema(name = "returns", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("returns") - public List<@Valid Parameter> getReturns() { - return returns; - } - - public void setReturns(List<@Valid Parameter> returns) { - this.returns = returns; - } - - public StoredProcedureMeta enable(Boolean enable) { - this.enable = enable; - return this; - } - - /** - * Get enable - * @return enable - */ - - @Schema(name = "enable", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("enable") - public Boolean getEnable() { - return enable; - } - - public void setEnable(Boolean enable) { - this.enable = enable; - } - - public StoredProcedureMeta option(Map option) { - this.option = option; - return this; - } - - public StoredProcedureMeta putOptionItem(String key, Object optionItem) { - if (this.option == null) { - this.option = new HashMap<>(); - } - this.option.put(key, optionItem); - return this; - } - - /** - * Get option - * @return option - */ - - @Schema(name = "option", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("option") - public Map getOption() { - return option; - } - - public void setOption(Map option) { - this.option = option; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredProcedureMeta storedProcedureMeta = (StoredProcedureMeta) o; - return Objects.equals(this.name, storedProcedureMeta.name) && - Objects.equals(this.description, storedProcedureMeta.description) && - Objects.equals(this.type, storedProcedureMeta.type) && - Objects.equals(this.query, storedProcedureMeta.query) && - Objects.equals(this.id, storedProcedureMeta.id) && - Objects.equals(this.library, storedProcedureMeta.library) && - Objects.equals(this.params, storedProcedureMeta.params) && - Objects.equals(this.returns, storedProcedureMeta.returns) && - Objects.equals(this.enable, storedProcedureMeta.enable) && - Objects.equals(this.option, storedProcedureMeta.option); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, type, query, id, library, params, returns, enable, option); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredProcedureMeta {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" library: ").append(toIndentedString(library)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append(" returns: ").append(toIndentedString(returns)).append("\n"); - sb.append(" enable: ").append(toIndentedString(enable)).append("\n"); - sb.append(" option: ").append(toIndentedString(option)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java deleted file mode 100644 index 17c7c6dfcdf4..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.StringTypeString; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * StringType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class StringType implements GSDataType { - - private StringTypeString string; - - public StringType() { - super(); - } - - /** - * Constructor with only required parameters - */ - public StringType(StringTypeString string) { - this.string = string; - } - - public StringType string(StringTypeString string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @NotNull @Valid - @Schema(name = "string", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("string") - public StringTypeString getString() { - return string; - } - - public void setString(StringTypeString string) { - this.string = string; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StringType stringType = (StringType) o; - return Objects.equals(this.string, stringType.string); - } - - @Override - public int hashCode() { - return Objects.hash(string); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringType {\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java deleted file mode 100644 index 08faa085145f..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.FixedChar; -import com.alibaba.graphscope.groot.service.models.FixedCharChar; -import com.alibaba.graphscope.groot.service.models.LongText; -import com.alibaba.graphscope.groot.service.models.VarChar; -import com.alibaba.graphscope.groot.service.models.VarCharVarChar; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public interface StringTypeString { -} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java deleted file mode 100644 index a762b8715fc5..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.TemporalTypeTemporal; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TemporalType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class TemporalType implements GSDataType { - - private TemporalTypeTemporal temporal; - - public TemporalType() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TemporalType(TemporalTypeTemporal temporal) { - this.temporal = temporal; - } - - public TemporalType temporal(TemporalTypeTemporal temporal) { - this.temporal = temporal; - return this; - } - - /** - * Get temporal - * @return temporal - */ - @NotNull @Valid - @Schema(name = "temporal", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("temporal") - public TemporalTypeTemporal getTemporal() { - return temporal; - } - - public void setTemporal(TemporalTypeTemporal temporal) { - this.temporal = temporal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemporalType temporalType = (TemporalType) o; - return Objects.equals(this.temporal, temporalType.temporal); - } - - @Override - public int hashCode() { - return Objects.hash(temporal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemporalType {\n"); - sb.append(" temporal: ").append(toIndentedString(temporal)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java deleted file mode 100644 index 836059bb0565..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.DateType; -import com.alibaba.graphscope.groot.service.models.TimeStampType; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public interface TemporalTypeTemporal { -} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java deleted file mode 100644 index 977e13a8bdf1..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TimeStampType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class TimeStampType implements TemporalTypeTemporal { - - private String timestamp; - - public TimeStampType() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TimeStampType(String timestamp) { - this.timestamp = timestamp; - } - - public TimeStampType timestamp(String timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Get timestamp - * @return timestamp - */ - @NotNull - @Schema(name = "timestamp", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("timestamp") - public String getTimestamp() { - return timestamp; - } - - public void setTimestamp(String timestamp) { - this.timestamp = timestamp; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TimeStampType timeStampType = (TimeStampType) o; - return Objects.equals(this.timestamp, timeStampType.timestamp); - } - - @Override - public int hashCode() { - return Objects.hash(timestamp); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TimeStampType {\n"); - sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java deleted file mode 100644 index ea5997ae8ac7..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.GSDataType; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypedValue - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class TypedValue { - - private GSDataType type; - - private JsonNullable value = JsonNullable.undefined(); - - public TypedValue() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypedValue(GSDataType type, Object value) { - this.type = type; - this.value = JsonNullable.of(value); - } - - public TypedValue type(GSDataType type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @NotNull @Valid - @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("type") - public GSDataType getType() { - return type; - } - - public void setType(GSDataType type) { - this.type = type; - } - - public TypedValue value(Object value) { - this.value = JsonNullable.of(value); - return this; - } - - /** - * Get value - * @return value - */ - @NotNull - @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("value") - public JsonNullable getValue() { - return value; - } - - public void setValue(JsonNullable value) { - this.value = value; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypedValue typedValue = (TypedValue) o; - return Objects.equals(this.type, typedValue.type) && - Objects.equals(this.value, typedValue.value); - } - - @Override - public int hashCode() { - return Objects.hash(type, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypedValue {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateEdgeType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateEdgeType.java deleted file mode 100644 index 988f08db04cf..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateEdgeType.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; -import com.alibaba.graphscope.groot.service.models.CreatePropertyMeta; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * UpdateEdgeType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-24T17:33:47.196892+08:00[Asia/Shanghai]") -public class UpdateEdgeType { - - private String typeName; - - @Valid - private List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations; - - @Valid - private List<@Valid CreatePropertyMeta> propertiesToAdd; - - public UpdateEdgeType typeName(String typeName) { - this.typeName = typeName; - return this; - } - - /** - * Get typeName - * @return typeName - */ - - @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_name") - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public UpdateEdgeType vertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { - this.vertexTypePairRelations = vertexTypePairRelations; - return this; - } - - public UpdateEdgeType addVertexTypePairRelationsItem(BaseEdgeTypeVertexTypePairRelationsInner vertexTypePairRelationsItem) { - if (this.vertexTypePairRelations == null) { - this.vertexTypePairRelations = new ArrayList<>(); - } - this.vertexTypePairRelations.add(vertexTypePairRelationsItem); - return this; - } - - /** - * Get vertexTypePairRelations - * @return vertexTypePairRelations - */ - @Valid - @Schema(name = "vertex_type_pair_relations", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("vertex_type_pair_relations") - public List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> getVertexTypePairRelations() { - return vertexTypePairRelations; - } - - public void setVertexTypePairRelations(List<@Valid BaseEdgeTypeVertexTypePairRelationsInner> vertexTypePairRelations) { - this.vertexTypePairRelations = vertexTypePairRelations; - } - - public UpdateEdgeType propertiesToAdd(List<@Valid CreatePropertyMeta> propertiesToAdd) { - this.propertiesToAdd = propertiesToAdd; - return this; - } - - public UpdateEdgeType addPropertiesToAddItem(CreatePropertyMeta propertiesToAddItem) { - if (this.propertiesToAdd == null) { - this.propertiesToAdd = new ArrayList<>(); - } - this.propertiesToAdd.add(propertiesToAddItem); - return this; - } - - /** - * Get propertiesToAdd - * @return propertiesToAdd - */ - @Valid - @Schema(name = "properties_to_add", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("properties_to_add") - public List<@Valid CreatePropertyMeta> getPropertiesToAdd() { - return propertiesToAdd; - } - - public void setPropertiesToAdd(List<@Valid CreatePropertyMeta> propertiesToAdd) { - this.propertiesToAdd = propertiesToAdd; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateEdgeType updateEdgeType = (UpdateEdgeType) o; - return Objects.equals(this.typeName, updateEdgeType.typeName) && - Objects.equals(this.vertexTypePairRelations, updateEdgeType.vertexTypePairRelations) && - Objects.equals(this.propertiesToAdd, updateEdgeType.propertiesToAdd); - } - - @Override - public int hashCode() { - return Objects.hash(typeName, vertexTypePairRelations, propertiesToAdd); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateEdgeType {\n"); - sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); - sb.append(" vertexTypePairRelations: ").append(toIndentedString(vertexTypePairRelations)).append("\n"); - sb.append(" propertiesToAdd: ").append(toIndentedString(propertiesToAdd)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java deleted file mode 100644 index 7f0581e61a1d..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * UpdateProcedureRequest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class UpdateProcedureRequest { - - private String description; - - public UpdateProcedureRequest description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - */ - - @Schema(name = "description", example = "A sample stored procedure", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("description") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateProcedureRequest updateProcedureRequest = (UpdateProcedureRequest) o; - return Objects.equals(this.description, updateProcedureRequest.description); - } - - @Override - public int hashCode() { - return Objects.hash(description); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateProcedureRequest {\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateVertexType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateVertexType.java deleted file mode 100644 index 8afc40d1a566..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UpdateVertexType.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.BaseVertexTypeXCsrParams; -import com.alibaba.graphscope.groot.service.models.CreatePropertyMeta; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * UpdateVertexType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-24T17:33:47.196892+08:00[Asia/Shanghai]") -public class UpdateVertexType { - - private String typeName; - - @Valid - private List primaryKeys; - - private BaseVertexTypeXCsrParams xCsrParams; - - @Valid - private List<@Valid CreatePropertyMeta> propertiesToAdd; - - public UpdateVertexType typeName(String typeName) { - this.typeName = typeName; - return this; - } - - /** - * Get typeName - * @return typeName - */ - - @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_name") - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public UpdateVertexType primaryKeys(List primaryKeys) { - this.primaryKeys = primaryKeys; - return this; - } - - public UpdateVertexType addPrimaryKeysItem(String primaryKeysItem) { - if (this.primaryKeys == null) { - this.primaryKeys = new ArrayList<>(); - } - this.primaryKeys.add(primaryKeysItem); - return this; - } - - /** - * Get primaryKeys - * @return primaryKeys - */ - - @Schema(name = "primary_keys", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("primary_keys") - public List getPrimaryKeys() { - return primaryKeys; - } - - public void setPrimaryKeys(List primaryKeys) { - this.primaryKeys = primaryKeys; - } - - public UpdateVertexType xCsrParams(BaseVertexTypeXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - return this; - } - - /** - * Get xCsrParams - * @return xCsrParams - */ - @Valid - @Schema(name = "x_csr_params", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("x_csr_params") - public BaseVertexTypeXCsrParams getxCsrParams() { - return xCsrParams; - } - - public void setxCsrParams(BaseVertexTypeXCsrParams xCsrParams) { - this.xCsrParams = xCsrParams; - } - - public UpdateVertexType propertiesToAdd(List<@Valid CreatePropertyMeta> propertiesToAdd) { - this.propertiesToAdd = propertiesToAdd; - return this; - } - - public UpdateVertexType addPropertiesToAddItem(CreatePropertyMeta propertiesToAddItem) { - if (this.propertiesToAdd == null) { - this.propertiesToAdd = new ArrayList<>(); - } - this.propertiesToAdd.add(propertiesToAddItem); - return this; - } - - /** - * Get propertiesToAdd - * @return propertiesToAdd - */ - @Valid - @Schema(name = "properties_to_add", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("properties_to_add") - public List<@Valid CreatePropertyMeta> getPropertiesToAdd() { - return propertiesToAdd; - } - - public void setPropertiesToAdd(List<@Valid CreatePropertyMeta> propertiesToAdd) { - this.propertiesToAdd = propertiesToAdd; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateVertexType updateVertexType = (UpdateVertexType) o; - return Objects.equals(this.typeName, updateVertexType.typeName) && - Objects.equals(this.primaryKeys, updateVertexType.primaryKeys) && - Objects.equals(this.xCsrParams, updateVertexType.xCsrParams) && - Objects.equals(this.propertiesToAdd, updateVertexType.propertiesToAdd); - } - - @Override - public int hashCode() { - return Objects.hash(typeName, primaryKeys, xCsrParams, propertiesToAdd); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateVertexType {\n"); - sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); - sb.append(" primaryKeys: ").append(toIndentedString(primaryKeys)).append("\n"); - sb.append(" xCsrParams: ").append(toIndentedString(xCsrParams)).append("\n"); - sb.append(" propertiesToAdd: ").append(toIndentedString(propertiesToAdd)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java deleted file mode 100644 index b5e7f37b9ccc..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * UploadFileResponse - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class UploadFileResponse { - - private String filePath; - - @Valid - private Map metadata = new HashMap<>(); - - public UploadFileResponse() { - super(); - } - - /** - * Constructor with only required parameters - */ - public UploadFileResponse(String filePath) { - this.filePath = filePath; - } - - public UploadFileResponse filePath(String filePath) { - this.filePath = filePath; - return this; - } - - /** - * Get filePath - * @return filePath - */ - @NotNull - @Schema(name = "file_path", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("file_path") - public String getFilePath() { - return filePath; - } - - public void setFilePath(String filePath) { - this.filePath = filePath; - } - - public UploadFileResponse metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public UploadFileResponse putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); - } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Get metadata - * @return metadata - */ - - @Schema(name = "metadata", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("metadata") - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UploadFileResponse uploadFileResponse = (UploadFileResponse) o; - return Objects.equals(this.filePath, uploadFileResponse.filePath) && - Objects.equals(this.metadata, uploadFileResponse.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(filePath, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UploadFileResponse {\n"); - sb.append(" filePath: ").append(toIndentedString(filePath)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java deleted file mode 100644 index 42aeeda4b787..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.VarCharVarChar; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * VarChar - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class VarChar implements StringTypeString { - - private VarCharVarChar varChar; - - public VarChar() { - super(); - } - - /** - * Constructor with only required parameters - */ - public VarChar(VarCharVarChar varChar) { - this.varChar = varChar; - } - - public VarChar varChar(VarCharVarChar varChar) { - this.varChar = varChar; - return this; - } - - /** - * Get varChar - * @return varChar - */ - @NotNull @Valid - @Schema(name = "var_char", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("var_char") - public VarCharVarChar getVarChar() { - return varChar; - } - - public void setVarChar(VarCharVarChar varChar) { - this.varChar = varChar; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - VarChar varChar = (VarChar) o; - return Objects.equals(this.varChar, varChar.varChar); - } - - @Override - public int hashCode() { - return Objects.hash(varChar); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VarChar {\n"); - sb.append(" varChar: ").append(toIndentedString(varChar)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java deleted file mode 100644 index fb943fde433c..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * VarCharVarChar - */ - -@JsonTypeName("VarChar_var_char") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class VarCharVarChar { - - private Integer maxLength; - - public VarCharVarChar() { - super(); - } - - /** - * Constructor with only required parameters - */ - public VarCharVarChar(Integer maxLength) { - this.maxLength = maxLength; - } - - public VarCharVarChar maxLength(Integer maxLength) { - this.maxLength = maxLength; - return this; - } - - /** - * Get maxLength - * @return maxLength - */ - @NotNull - @Schema(name = "max_length", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("max_length") - public Integer getMaxLength() { - return maxLength; - } - - public void setMaxLength(Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - VarCharVarChar varCharVarChar = (VarCharVarChar) o; - return Objects.equals(this.maxLength, varCharVarChar.maxLength); - } - - @Override - public int hashCode() { - return Objects.hash(maxLength); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VarCharVarChar {\n"); - sb.append(" maxLength: ").append(toIndentedString(maxLength)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java deleted file mode 100644 index 70e57137add9..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.Property; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * VertexData - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class VertexData { - - private String label; - - @Valid - private List<@Valid Property> values; - - public VertexData() { - super(); - } - - /** - * Constructor with only required parameters - */ - public VertexData(String label) { - this.label = label; - } - - public VertexData label(String label) { - this.label = label; - return this; - } - - /** - * Get label - * @return label - */ - @NotNull - @Schema(name = "label", example = "person", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("label") - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public VertexData values(List<@Valid Property> values) { - this.values = values; - return this; - } - - public VertexData addValuesItem(Property valuesItem) { - if (this.values == null) { - this.values = new ArrayList<>(); - } - this.values.add(valuesItem); - return this; - } - - /** - * Get values - * @return values - */ - @Valid - @Schema(name = "values", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("values") - public List<@Valid Property> getValues() { - return values; - } - - public void setValues(List<@Valid Property> values) { - this.values = values; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - VertexData vertexData = (VertexData) o; - return Objects.equals(this.label, vertexData.label) && - Objects.equals(this.values, vertexData.values); - } - - @Override - public int hashCode() { - return Objects.hash(label, values); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VertexData {\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append(" values: ").append(toIndentedString(values)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java deleted file mode 100644 index 0621e2b23369..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.EdgeRequest; -import com.alibaba.graphscope.groot.service.models.VertexRequest; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * VertexEdgeRequest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class VertexEdgeRequest { - - @Valid - private List<@Valid VertexRequest> vertexRequest = new ArrayList<>(); - - @Valid - private List<@Valid EdgeRequest> edgeRequest = new ArrayList<>(); - - public VertexEdgeRequest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public VertexEdgeRequest(List<@Valid VertexRequest> vertexRequest, List<@Valid EdgeRequest> edgeRequest) { - this.vertexRequest = vertexRequest; - this.edgeRequest = edgeRequest; - } - - public VertexEdgeRequest vertexRequest(List<@Valid VertexRequest> vertexRequest) { - this.vertexRequest = vertexRequest; - return this; - } - - public VertexEdgeRequest addVertexRequestItem(VertexRequest vertexRequestItem) { - if (this.vertexRequest == null) { - this.vertexRequest = new ArrayList<>(); - } - this.vertexRequest.add(vertexRequestItem); - return this; - } - - /** - * Get vertexRequest - * @return vertexRequest - */ - @NotNull @Valid - @Schema(name = "vertex_request", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("vertex_request") - public List<@Valid VertexRequest> getVertexRequest() { - return vertexRequest; - } - - public void setVertexRequest(List<@Valid VertexRequest> vertexRequest) { - this.vertexRequest = vertexRequest; - } - - public VertexEdgeRequest edgeRequest(List<@Valid EdgeRequest> edgeRequest) { - this.edgeRequest = edgeRequest; - return this; - } - - public VertexEdgeRequest addEdgeRequestItem(EdgeRequest edgeRequestItem) { - if (this.edgeRequest == null) { - this.edgeRequest = new ArrayList<>(); - } - this.edgeRequest.add(edgeRequestItem); - return this; - } - - /** - * Get edgeRequest - * @return edgeRequest - */ - @NotNull @Valid - @Schema(name = "edge_request", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("edge_request") - public List<@Valid EdgeRequest> getEdgeRequest() { - return edgeRequest; - } - - public void setEdgeRequest(List<@Valid EdgeRequest> edgeRequest) { - this.edgeRequest = edgeRequest; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - VertexEdgeRequest vertexEdgeRequest = (VertexEdgeRequest) o; - return Objects.equals(this.vertexRequest, vertexEdgeRequest.vertexRequest) && - Objects.equals(this.edgeRequest, vertexEdgeRequest.edgeRequest); - } - - @Override - public int hashCode() { - return Objects.hash(vertexRequest, edgeRequest); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VertexEdgeRequest {\n"); - sb.append(" vertexRequest: ").append(toIndentedString(vertexRequest)).append("\n"); - sb.append(" edgeRequest: ").append(toIndentedString(edgeRequest)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java deleted file mode 100644 index cc926d25db81..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.ColumnMapping; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * VertexMapping - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class VertexMapping { - - private String typeName; - - @Valid - private List inputs; - - @Valid - private List<@Valid ColumnMapping> columnMappings; - - public VertexMapping typeName(String typeName) { - this.typeName = typeName; - return this; - } - - /** - * Get typeName - * @return typeName - */ - - @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_name") - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public VertexMapping inputs(List inputs) { - this.inputs = inputs; - return this; - } - - public VertexMapping addInputsItem(String inputsItem) { - if (this.inputs == null) { - this.inputs = new ArrayList<>(); - } - this.inputs.add(inputsItem); - return this; - } - - /** - * Get inputs - * @return inputs - */ - - @Schema(name = "inputs", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("inputs") - public List getInputs() { - return inputs; - } - - public void setInputs(List inputs) { - this.inputs = inputs; - } - - public VertexMapping columnMappings(List<@Valid ColumnMapping> columnMappings) { - this.columnMappings = columnMappings; - return this; - } - - public VertexMapping addColumnMappingsItem(ColumnMapping columnMappingsItem) { - if (this.columnMappings == null) { - this.columnMappings = new ArrayList<>(); - } - this.columnMappings.add(columnMappingsItem); - return this; - } - - /** - * Get columnMappings - * @return columnMappings - */ - @Valid - @Schema(name = "column_mappings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("column_mappings") - public List<@Valid ColumnMapping> getColumnMappings() { - return columnMappings; - } - - public void setColumnMappings(List<@Valid ColumnMapping> columnMappings) { - this.columnMappings = columnMappings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - VertexMapping vertexMapping = (VertexMapping) o; - return Objects.equals(this.typeName, vertexMapping.typeName) && - Objects.equals(this.inputs, vertexMapping.inputs) && - Objects.equals(this.columnMappings, vertexMapping.columnMappings); - } - - @Override - public int hashCode() { - return Objects.hash(typeName, inputs, columnMappings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VertexMapping {\n"); - sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); - sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n"); - sb.append(" columnMappings: ").append(toIndentedString(columnMappings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java deleted file mode 100644 index 8c6612cb328e..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.Property; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * VertexRequest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class VertexRequest { - - private String label; - - @Valid - private List<@Valid Property> primaryKeyValues = new ArrayList<>(); - - @Valid - private List<@Valid Property> properties = new ArrayList<>(); - - public VertexRequest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public VertexRequest(String label, List<@Valid Property> primaryKeyValues, List<@Valid Property> properties) { - this.label = label; - this.primaryKeyValues = primaryKeyValues; - this.properties = properties; - } - - public VertexRequest label(String label) { - this.label = label; - return this; - } - - /** - * Get label - * @return label - */ - @NotNull - @Schema(name = "label", example = "person", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("label") - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public VertexRequest primaryKeyValues(List<@Valid Property> primaryKeyValues) { - this.primaryKeyValues = primaryKeyValues; - return this; - } - - public VertexRequest addPrimaryKeyValuesItem(Property primaryKeyValuesItem) { - if (this.primaryKeyValues == null) { - this.primaryKeyValues = new ArrayList<>(); - } - this.primaryKeyValues.add(primaryKeyValuesItem); - return this; - } - - /** - * Get primaryKeyValues - * @return primaryKeyValues - */ - @NotNull @Valid - @Schema(name = "primary_key_values", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("primary_key_values") - public List<@Valid Property> getPrimaryKeyValues() { - return primaryKeyValues; - } - - public void setPrimaryKeyValues(List<@Valid Property> primaryKeyValues) { - this.primaryKeyValues = primaryKeyValues; - } - - public VertexRequest properties(List<@Valid Property> properties) { - this.properties = properties; - return this; - } - - public VertexRequest addPropertiesItem(Property propertiesItem) { - if (this.properties == null) { - this.properties = new ArrayList<>(); - } - this.properties.add(propertiesItem); - return this; - } - - /** - * Get properties - * @return properties - */ - @NotNull @Valid - @Schema(name = "properties", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("properties") - public List<@Valid Property> getProperties() { - return properties; - } - - public void setProperties(List<@Valid Property> properties) { - this.properties = properties; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - VertexRequest vertexRequest = (VertexRequest) o; - return Objects.equals(this.label, vertexRequest.label) && - Objects.equals(this.primaryKeyValues, vertexRequest.primaryKeyValues) && - Objects.equals(this.properties, vertexRequest.properties); - } - - @Override - public int hashCode() { - return Objects.hash(label, primaryKeyValues, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VertexRequest {\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append(" primaryKeyValues: ").append(toIndentedString(primaryKeyValues)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java deleted file mode 100644 index 009e89804ed7..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * VertexStatistics - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class VertexStatistics { - - private Integer typeId; - - private String typeName; - - private Integer count; - - public VertexStatistics typeId(Integer typeId) { - this.typeId = typeId; - return this; - } - - /** - * Get typeId - * @return typeId - */ - - @Schema(name = "type_id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_id") - public Integer getTypeId() { - return typeId; - } - - public void setTypeId(Integer typeId) { - this.typeId = typeId; - } - - public VertexStatistics typeName(String typeName) { - this.typeName = typeName; - return this; - } - - /** - * Get typeName - * @return typeName - */ - - @Schema(name = "type_name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("type_name") - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public VertexStatistics count(Integer count) { - this.count = count; - return this; - } - - /** - * Get count - * @return count - */ - - @Schema(name = "count", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("count") - public Integer getCount() { - return count; - } - - public void setCount(Integer count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - VertexStatistics vertexStatistics = (VertexStatistics) o; - return Objects.equals(this.typeId, vertexStatistics.typeId) && - Objects.equals(this.typeName, vertexStatistics.typeName) && - Objects.equals(this.count, vertexStatistics.count); - } - - @Override - public int hashCode() { - return Objects.hash(typeId, typeName, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VertexStatistics {\n"); - sb.append(" typeId: ").append(toIndentedString(typeId)).append("\n"); - sb.append(" typeName: ").append(toIndentedString(typeName)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java deleted file mode 100644 index d1e7b1e59502..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * VertexTypePairStatistics - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -public class VertexTypePairStatistics { - - private String sourceVertex; - - private String destinationVertex; - - private Integer count; - - public VertexTypePairStatistics() { - super(); - } - - /** - * Constructor with only required parameters - */ - public VertexTypePairStatistics(String sourceVertex, String destinationVertex, Integer count) { - this.sourceVertex = sourceVertex; - this.destinationVertex = destinationVertex; - this.count = count; - } - - public VertexTypePairStatistics sourceVertex(String sourceVertex) { - this.sourceVertex = sourceVertex; - return this; - } - - /** - * Get sourceVertex - * @return sourceVertex - */ - @NotNull - @Schema(name = "source_vertex", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("source_vertex") - public String getSourceVertex() { - return sourceVertex; - } - - public void setSourceVertex(String sourceVertex) { - this.sourceVertex = sourceVertex; - } - - public VertexTypePairStatistics destinationVertex(String destinationVertex) { - this.destinationVertex = destinationVertex; - return this; - } - - /** - * Get destinationVertex - * @return destinationVertex - */ - @NotNull - @Schema(name = "destination_vertex", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("destination_vertex") - public String getDestinationVertex() { - return destinationVertex; - } - - public void setDestinationVertex(String destinationVertex) { - this.destinationVertex = destinationVertex; - } - - public VertexTypePairStatistics count(Integer count) { - this.count = count; - return this; - } - - /** - * Get count - * @return count - */ - @NotNull - @Schema(name = "count", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("count") - public Integer getCount() { - return count; - } - - public void setCount(Integer count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - VertexTypePairStatistics vertexTypePairStatistics = (VertexTypePairStatistics) o; - return Objects.equals(this.sourceVertex, vertexTypePairStatistics.sourceVertex) && - Objects.equals(this.destinationVertex, vertexTypePairStatistics.destinationVertex) && - Objects.equals(this.count, vertexTypePairStatistics.count); - } - - @Override - public int hashCode() { - return Objects.hash(sourceVertex, destinationVertex, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VertexTypePairStatistics {\n"); - sb.append(" sourceVertex: ").append(toIndentedString(sourceVertex)).append("\n"); - sb.append(" destinationVertex: ").append(toIndentedString(destinationVertex)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - From ed8f9eff8e74172238630d8ce5b4956a4ca43980 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Tue, 7 Jan 2025 19:53:04 +0800 Subject: [PATCH 13/23] minor refine Committed-by: bingqing.lbq from Dev container --- .gitignore | 2 + interactive_engine/groot-client/pom.xml | 14 - .../groot-http/.openapi-generator/FILES | 77 - .../groot-http/.openapi-generator/VERSION | 1 - .../groot/OpenApiGeneratorApplication.java | 30 - .../graphscope/groot/RFC3339DateFormat.java | 38 - .../graphscope/groot/service/api/V1Api.java | 1939 ---------- .../configuration/HomeController.java | 20 - .../configuration/SpringDocConfiguration.java | 36 - .../src/main/resources/application.properties | 3 - .../src/main/resources/openapi.yaml | 3221 ----------------- .../OpenApiGeneratorApplicationTests.java | 13 - 12 files changed, 2 insertions(+), 5392 deletions(-) delete mode 100644 interactive_engine/groot-http/.openapi-generator/FILES delete mode 100644 interactive_engine/groot-http/.openapi-generator/VERSION delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplication.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/RFC3339DateFormat.java delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java delete mode 100644 interactive_engine/groot-http/src/main/java/org/openapitools/configuration/HomeController.java delete mode 100644 interactive_engine/groot-http/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java delete mode 100644 interactive_engine/groot-http/src/main/resources/application.properties delete mode 100644 interactive_engine/groot-http/src/main/resources/openapi.yaml delete mode 100644 interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java diff --git a/.gitignore b/.gitignore index 64d448025de3..bf8773ee2638 100644 --- a/.gitignore +++ b/.gitignore @@ -157,6 +157,8 @@ flex/interactive/sdk/python/gs_interactive/rest.py !flex/interactive/sdk/python/gs_interactive/client/generated/__init__.py !flex/interactive/sdk/python/gs_interactive/models/long_text.py +interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ +interactive_engine/groot-http/.openapi-generator/ **/.cache/ diff --git a/interactive_engine/groot-client/pom.xml b/interactive_engine/groot-client/pom.xml index f7109f6e91de..6e98a5525928 100644 --- a/interactive_engine/groot-client/pom.xml +++ b/interactive_engine/groot-client/pom.xml @@ -42,20 +42,6 @@ javax.annotation javax.annotation-api - - org.springframework.boot - spring-boot-starter-web - - - org.apache.tinkerpop - tinkergraph-gremlin - ${tinkerpop.version} - - - org.apache.tinkerpop - gremlin-driver - ${tinkerpop.version} - junit junit diff --git a/interactive_engine/groot-http/.openapi-generator/FILES b/interactive_engine/groot-http/.openapi-generator/FILES deleted file mode 100644 index 308db9fe8b32..000000000000 --- a/interactive_engine/groot-http/.openapi-generator/FILES +++ /dev/null @@ -1,77 +0,0 @@ -README.md -src/main/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplication.java -src/main/java/com/alibaba/graphscope/groot/RFC3339DateFormat.java -src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java -src/main/java/com/alibaba/graphscope/groot/service/models/APIResponseWithCode.java -src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeType.java -src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInner.java -src/main/java/com/alibaba/graphscope/groot/service/models/BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.java -src/main/java/com/alibaba/graphscope/groot/service/models/BasePropertyMeta.java -src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexType.java -src/main/java/com/alibaba/graphscope/groot/service/models/BaseVertexTypeXCsrParams.java -src/main/java/com/alibaba/graphscope/groot/service/models/ColumnMapping.java -src/main/java/com/alibaba/graphscope/groot/service/models/CreateEdgeType.java -src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphResponse.java -src/main/java/com/alibaba/graphscope/groot/service/models/CreateGraphSchemaRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/CreateProcedureResponse.java -src/main/java/com/alibaba/graphscope/groot/service/models/CreatePropertyMeta.java -src/main/java/com/alibaba/graphscope/groot/service/models/CreateVertexType.java -src/main/java/com/alibaba/graphscope/groot/service/models/DateType.java -src/main/java/com/alibaba/graphscope/groot/service/models/DeleteEdgeRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/DeleteVertexRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/EdgeData.java -src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMapping.java -src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingDestinationVertexMappingsInner.java -src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInner.java -src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingSourceVertexMappingsInnerColumn.java -src/main/java/com/alibaba/graphscope/groot/service/models/EdgeMappingTypeTriplet.java -src/main/java/com/alibaba/graphscope/groot/service/models/EdgeRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/EdgeStatistics.java -src/main/java/com/alibaba/graphscope/groot/service/models/FixedChar.java -src/main/java/com/alibaba/graphscope/groot/service/models/FixedCharChar.java -src/main/java/com/alibaba/graphscope/groot/service/models/GetEdgeType.java -src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphResponse.java -src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphSchemaResponse.java -src/main/java/com/alibaba/graphscope/groot/service/models/GetGraphStatisticsResponse.java -src/main/java/com/alibaba/graphscope/groot/service/models/GetProcedureResponse.java -src/main/java/com/alibaba/graphscope/groot/service/models/GetPropertyMeta.java -src/main/java/com/alibaba/graphscope/groot/service/models/GetVertexType.java -src/main/java/com/alibaba/graphscope/groot/service/models/JobResponse.java -src/main/java/com/alibaba/graphscope/groot/service/models/JobStatus.java -src/main/java/com/alibaba/graphscope/groot/service/models/LongText.java -src/main/java/com/alibaba/graphscope/groot/service/models/Parameter.java -src/main/java/com/alibaba/graphscope/groot/service/models/PrimitiveType.java -src/main/java/com/alibaba/graphscope/groot/service/models/Property.java -src/main/java/com/alibaba/graphscope/groot/service/models/QueryRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMapping.java -src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfig.java -src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigDataSource.java -src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigFormat.java -src/main/java/com/alibaba/graphscope/groot/service/models/SchemaMappingLoadingConfigXCsrParams.java -src/main/java/com/alibaba/graphscope/groot/service/models/ServiceStatus.java -src/main/java/com/alibaba/graphscope/groot/service/models/StartServiceRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/StopServiceRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/StoredProcedureMeta.java -src/main/java/com/alibaba/graphscope/groot/service/models/StringType.java -src/main/java/com/alibaba/graphscope/groot/service/models/StringTypeString.java -src/main/java/com/alibaba/graphscope/groot/service/models/TemporalType.java -src/main/java/com/alibaba/graphscope/groot/service/models/TemporalTypeTemporal.java -src/main/java/com/alibaba/graphscope/groot/service/models/TimeStampType.java -src/main/java/com/alibaba/graphscope/groot/service/models/TypedValue.java -src/main/java/com/alibaba/graphscope/groot/service/models/UpdateProcedureRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/UploadFileResponse.java -src/main/java/com/alibaba/graphscope/groot/service/models/VarChar.java -src/main/java/com/alibaba/graphscope/groot/service/models/VarCharVarChar.java -src/main/java/com/alibaba/graphscope/groot/service/models/VertexData.java -src/main/java/com/alibaba/graphscope/groot/service/models/VertexEdgeRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/VertexMapping.java -src/main/java/com/alibaba/graphscope/groot/service/models/VertexRequest.java -src/main/java/com/alibaba/graphscope/groot/service/models/VertexStatistics.java -src/main/java/com/alibaba/graphscope/groot/service/models/VertexTypePairStatistics.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/SpringDocConfiguration.java -src/main/resources/application.properties -src/main/resources/openapi.yaml -src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java diff --git a/interactive_engine/groot-http/.openapi-generator/VERSION b/interactive_engine/groot-http/.openapi-generator/VERSION deleted file mode 100644 index 4b49d9bb63ee..000000000000 --- a/interactive_engine/groot-http/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.2.0 \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplication.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplication.java deleted file mode 100644 index f678ef62e3f7..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplication.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.alibaba.graphscope.groot; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.FilterType; -import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; - -@SpringBootApplication( - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -@ComponentScan( - basePackages = {"com.alibaba.graphscope.groot", "com.alibaba.graphscope.groot.service.api" , "org.openapitools.configuration"}, - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -public class OpenApiGeneratorApplication { - - public static void main(String[] args) { - SpringApplication.run(OpenApiGeneratorApplication.class, args); - } - - @Bean(name = "com.alibaba.graphscope.groot.OpenApiGeneratorApplication.jsonNullableModule") - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/RFC3339DateFormat.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/RFC3339DateFormat.java deleted file mode 100644 index 9b5648ee6260..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/RFC3339DateFormat.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.alibaba.graphscope.groot; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java deleted file mode 100644 index 9bf6e0e6c851..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java +++ /dev/null @@ -1,1939 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.2.0). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package com.alibaba.graphscope.groot.service.api; - -import com.alibaba.graphscope.groot.service.models.APIResponseWithCode; -import com.alibaba.graphscope.groot.service.models.CreateEdgeType; -import com.alibaba.graphscope.groot.service.models.CreateGraphRequest; -import com.alibaba.graphscope.groot.service.models.CreateGraphResponse; -import com.alibaba.graphscope.groot.service.models.CreateGraphSchemaRequest; -import com.alibaba.graphscope.groot.service.models.CreateProcedureRequest; -import com.alibaba.graphscope.groot.service.models.CreateProcedureResponse; -import com.alibaba.graphscope.groot.service.models.CreateVertexType; -import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; -import com.alibaba.graphscope.groot.service.models.DeleteVertexRequest; -import com.alibaba.graphscope.groot.service.models.EdgeData; -import com.alibaba.graphscope.groot.service.models.EdgeRequest; -import com.alibaba.graphscope.groot.service.models.GetGraphResponse; -import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; -import com.alibaba.graphscope.groot.service.models.GetGraphStatisticsResponse; -import com.alibaba.graphscope.groot.service.models.GetProcedureResponse; -import com.alibaba.graphscope.groot.service.models.JobResponse; -import com.alibaba.graphscope.groot.service.models.JobStatus; -import com.alibaba.graphscope.groot.service.models.SchemaMapping; -import com.alibaba.graphscope.groot.service.models.ServiceStatus; -import com.alibaba.graphscope.groot.service.models.StartServiceRequest; -import com.alibaba.graphscope.groot.service.models.StopServiceRequest; -import com.alibaba.graphscope.groot.service.models.UpdateProcedureRequest; -import com.alibaba.graphscope.groot.service.models.UploadFileResponse; -import com.alibaba.graphscope.groot.service.models.VertexData; -import com.alibaba.graphscope.groot.service.models.VertexRequest; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-01-07T12:01:45.705446+08:00[Asia/Shanghai]") -@Validated -@Tag(name = "GraphService/EdgeManagement", description = "EdgeManagement") -public interface V1Api { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /v1/graph/{graph_id}/edge : Add edge to the graph - * Add the edge to graph. - * - * @param graphId (required) - * @param edgeRequest (required) - * @return Successfully insert the edge (status code 200) - * or Invalid input edge (status code 400) - * or edge already exists (status code 409) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "addEdge", - summary = "Add edge to the graph", - description = "Add the edge to graph. ", - tags = { "GraphService/EdgeManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully insert the edge", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid input edge", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "409", description = "edge already exists", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "500", description = "Server internal error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph/{graph_id}/edge", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity addEdge( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "EdgeRequest", description = "", required = true) @Valid @RequestBody List<@Valid EdgeRequest> edgeRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/graph/{graph_id}/vertex : Add vertex to the graph - * Add the provided vertex to the specified graph. - * - * @param graphId (required) - * @param vertexRequest (required) - * @return Successfully created vertex (status code 200) - * or Invalid input vertex (status code 400) - * or Graph not found (status code 404) - * or Vertex already exists (status code 409) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "addVertex", - summary = "Add vertex to the graph", - description = "Add the provided vertex to the specified graph. ", - tags = { "GraphService/VertexManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully created vertex", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid input vertex", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "404", description = "Graph not found", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "409", description = "Vertex already exists", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "500", description = "Server internal error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph/{graph_id}/vertex", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity addVertex( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "VertexRequest", description = "", required = true) @Valid @RequestBody List<@Valid VertexRequest> vertexRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/graph/{graph_id}/query : run queries on graph - * After the procedure is created, user can use this API to run the procedure. - * - * @param graphId (required) - * @param body (optional) - * @return Successfully runned. (status code 200) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "callProc", - summary = "run queries on graph", - description = "After the procedure is created, user can use this API to run the procedure. ", - tags = { "QueryService" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully runned.", content = { - @Content(mediaType = "text/plain", schema = @Schema(implementation = byte[].class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = byte[].class)) - }), - @ApiResponse(responseCode = "500", description = "Server internal error", content = { - @Content(mediaType = "text/plain", schema = @Schema(implementation = APIResponseWithCode.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph/{graph_id}/query", - produces = { "text/plain", "application/json" }, - consumes = { "text/plain" } - ) - - default ResponseEntity callProc( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "body", description = "") @Valid @RequestBody(required = false) byte[] body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/graph/current/query : run queries on the running graph - * Submit a query to the running graph. - * - * @param body (optional) - * @return Successfully runned. Empty if failed? (status code 200) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "callProcCurrent", - summary = "run queries on the running graph", - description = "Submit a query to the running graph. ", - tags = { "QueryService" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully runned. Empty if failed?", content = { - @Content(mediaType = "text/plain", schema = @Schema(implementation = byte[].class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = byte[].class)) - }), - @ApiResponse(responseCode = "500", description = "Server internal error", content = { - @Content(mediaType = "text/plain", schema = @Schema(implementation = APIResponseWithCode.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph/current/query", - produces = { "text/plain", "application/json" }, - consumes = { "text/plain" } - ) - - default ResponseEntity callProcCurrent( - @Parameter(name = "body", description = "") @Valid @RequestBody(required = false) byte[] body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/graph/{graph_id}/dataloading - * Create a dataloading job - * - * @param graphId The id of graph to do bulk loading. (required) - * @param schemaMapping (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createDataloadingJob", - description = "Create a dataloading job", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = JobResponse.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph/{graph_id}/dataloading", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity createDataloadingJob( - @Parameter(name = "graph_id", description = "The id of graph to do bulk loading.", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "SchemaMapping", description = "", required = true) @Valid @RequestBody SchemaMapping schemaMapping - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"job_id\" : \"job_id\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/graph/{graph_id}/schema/edge - * Create a edge type - * - * @param graphId (required) - * @param createEdgeType (optional) - * @return Successful created the edge type (status code 200) - * or (status code 400) - * or (status code 500) - */ - @Operation( - operationId = "createEdgeType", - description = "Create a edge type", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successful created the edge type", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = ""), - @ApiResponse(responseCode = "500", description = "") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph/{graph_id}/schema/edge", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity createEdgeType( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "CreateEdgeType", description = "") @Valid @RequestBody(required = false) CreateEdgeType createEdgeType - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/graph - * Create a new graph - * - * @param createGraphRequest (required) - * @return successful operation (status code 200) - * or BadRequest (status code 400) - * or Internal error (status code 500) - */ - @Operation( - operationId = "createGraph", - description = "Create a new graph", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = CreateGraphResponse.class)) - }), - @ApiResponse(responseCode = "400", description = "BadRequest", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "500", description = "Internal error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity createGraph( - @Parameter(name = "CreateGraphRequest", description = "", required = true) @Valid @RequestBody CreateGraphRequest createGraphRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"graph_id\" : \"1\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/graph/{graph_id}/procedure - * Create a new procedure on a graph - * - * @param graphId (required) - * @param createProcedureRequest (required) - * @return successful operation (status code 200) - * or Bad request (status code 400) - * or not found (status code 404) - * or Internal Error (status code 500) - */ - @Operation( - operationId = "createProcedure", - description = "Create a new procedure on a graph", - tags = { "AdminService/ProcedureManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = CreateProcedureResponse.class)) - }), - @ApiResponse(responseCode = "400", description = "Bad request", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "404", description = "not found", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "500", description = "Internal Error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph/{graph_id}/procedure", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity createProcedure( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "CreateProcedureRequest", description = "", required = true) @Valid @RequestBody CreateProcedureRequest createProcedureRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"procedure_id\" : \"proc1\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/graph/{graph_id}/schema/vertex - * Create a vertex type - * - * @param graphId (required) - * @param createVertexType (required) - * @return Successfully created the vertex type (status code 200) - * or (status code 400) - * or (status code 500) - */ - @Operation( - operationId = "createVertexType", - description = "Create a vertex type", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully created the vertex type", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = ""), - @ApiResponse(responseCode = "500", description = "") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph/{graph_id}/schema/vertex", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity createVertexType( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "CreateVertexType", description = "", required = true) @Valid @RequestBody CreateVertexType createVertexType - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /v1/graph/{graph_id}/edge : Remove edge from the graph - * Remove the edge from current graph. - * - * @param graphId (required) - * @param deleteEdgeRequest The label and primary key values of the src and dst vertices, and the edge label. (required) - * @return Successfully delete edge (status code 200) - * or Invalid input edge (status code 400) - * or Edge not exists or Graph not exits (status code 404) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "deleteEdge", - summary = "Remove edge from the graph", - description = "Remove the edge from current graph. ", - tags = { "GraphService/EdgeManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully delete edge", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid input edge", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "404", description = "Edge not exists or Graph not exits", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "500", description = "Server internal error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/v1/graph/{graph_id}/edge", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity deleteEdge( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "DeleteEdgeRequest", description = "The label and primary key values of the src and dst vertices, and the edge label.", required = true) @Valid @RequestBody DeleteEdgeRequest deleteEdgeRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /v1/graph/{graph_id}/schema/edge - * Delete an edge type by name - * - * @param graphId (required) - * @param typeName (required) - * @param sourceVertexType (required) - * @param destinationVertexType (required) - * @return Successfully deleted the edge type (status code 200) - * or (status code 400) - * or (status code 500) - */ - @Operation( - operationId = "deleteEdgeTypeByName", - description = "Delete an edge type by name", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully deleted the edge type", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = ""), - @ApiResponse(responseCode = "500", description = "") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/v1/graph/{graph_id}/schema/edge", - produces = { "application/json" } - ) - - default ResponseEntity deleteEdgeTypeByName( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @NotNull @Parameter(name = "type_name", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "type_name", required = true) String typeName, - @NotNull @Parameter(name = "source_vertex_type", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "source_vertex_type", required = true) String sourceVertexType, - @NotNull @Parameter(name = "destination_vertex_type", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "destination_vertex_type", required = true) String destinationVertexType - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /v1/graph/{graph_id} - * Delete a graph by id - * - * @param graphId The id of graph to delete (required) - * @return Successful operation (status code 200) - * or Not Found (status code 404) - * or Internal Error (status code 500) - */ - @Operation( - operationId = "deleteGraph", - description = "Delete a graph by id", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "404", description = "Not Found", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "500", description = "Internal Error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/v1/graph/{graph_id}", - produces = { "application/json" } - ) - - default ResponseEntity deleteGraph( - @Parameter(name = "graph_id", description = "The id of graph to delete", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /v1/job/{job_id} - * - * @param jobId (required) - * @return Successful operation (status code 200) - */ - @Operation( - operationId = "deleteJobById", - tags = { "AdminService/JobManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/v1/job/{job_id}", - produces = { "application/json" } - ) - - default ResponseEntity deleteJobById( - @Parameter(name = "job_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("job_id") String jobId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /v1/graph/{graph_id}/procedure/{procedure_id} - * Delete a procedure on a graph by id - * - * @param graphId (required) - * @param procedureId (required) - * @return Successful operation (status code 200) - * or Not Found (status code 404) - */ - @Operation( - operationId = "deleteProcedure", - description = "Delete a procedure on a graph by id", - tags = { "AdminService/ProcedureManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "404", description = "Not Found", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/v1/graph/{graph_id}/procedure/{procedure_id}", - produces = { "application/json" } - ) - - default ResponseEntity deleteProcedure( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "procedure_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("procedure_id") String procedureId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /v1/graph/{graph_id}/schema - * Delete schema by graph id - * - * @param graphId The id of graph to delete (required) - * @return successful operation (status code 200) - * or (status code 500) - */ - @Operation( - operationId = "deleteSchema", - description = "Delete schema by graph id", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "500", description = "") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/v1/graph/{graph_id}/schema", - produces = { "application/json" } - ) - - default ResponseEntity deleteSchema( - @Parameter(name = "graph_id", description = "The id of graph to delete", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /v1/graph/{graph_id}/vertex : Remove vertex from the graph - * Remove the vertex from the specified graph. - * - * @param graphId (required) - * @param deleteVertexRequest The label and primary key values of the vertex to be deleted. (required) - * @return Successfully delete vertex (status code 200) - * or Invalid input vertex (status code 400) - * or Vertex not exists or Graph not exits. (status code 404) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "deleteVertex", - summary = "Remove vertex from the graph", - description = "Remove the vertex from the specified graph. ", - tags = { "GraphService/VertexManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully delete vertex", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid input vertex", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "404", description = "Vertex not exists or Graph not exits.", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "500", description = "Server internal error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/v1/graph/{graph_id}/vertex", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity deleteVertex( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "DeleteVertexRequest", description = "The label and primary key values of the vertex to be deleted.", required = true) @Valid @RequestBody DeleteVertexRequest deleteVertexRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /v1/graph/{graph_id}/schema/vertex - * Delete a vertex type by name - * - * @param graphId (required) - * @param typeName (required) - * @return Successfully deleted the vertex type (status code 200) - * or (status code 400) - * or (status code 500) - */ - @Operation( - operationId = "deleteVertexTypeByName", - description = "Delete a vertex type by name", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully deleted the vertex type", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = ""), - @ApiResponse(responseCode = "500", description = "") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/v1/graph/{graph_id}/schema/vertex", - produces = { "application/json" } - ) - - default ResponseEntity deleteVertexTypeByName( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @NotNull @Parameter(name = "type_name", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "type_name", required = true) String typeName - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /v1/graph/{graph_id}/edge : Get the edge's properties with src and dst vertex primary keys. - * Get the properties for the specified vertex. - * - * @param graphId (required) - * @param edgeLabel The label name of querying edge. (required) - * @param srcLabel The label name of src vertex. (required) - * @param srcPrimaryKeyValue The primary key value of src vertex. (required) - * @param dstLabel The label name of dst vertex. (required) - * @param dstPrimaryKeyValue The value of dst vertex's primary key (required) - * @return Found Edge (status code 200) - * or Bad input parameter (status code 400) - * or Edge not found or Graph not found (status code 404) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "getEdge", - summary = "Get the edge's properties with src and dst vertex primary keys.", - description = "Get the properties for the specified vertex. ", - tags = { "GraphService/EdgeManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Found Edge", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = EdgeData.class)) - }), - @ApiResponse(responseCode = "400", description = "Bad input parameter", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "404", description = "Edge not found or Graph not found", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "500", description = "Server internal error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/v1/graph/{graph_id}/edge", - produces = { "application/json" } - ) - - default ResponseEntity getEdge( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @NotNull @Parameter(name = "edge_label", description = "The label name of querying edge.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "edge_label", required = true) String edgeLabel, - @NotNull @Parameter(name = "src_label", description = "The label name of src vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "src_label", required = true) String srcLabel, - @NotNull @Parameter(name = "src_primary_key_value", description = "The primary key value of src vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "src_primary_key_value", required = true) Object srcPrimaryKeyValue, - @NotNull @Parameter(name = "dst_label", description = "The label name of dst vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "dst_label", required = true) String dstLabel, - @NotNull @Parameter(name = "dst_primary_key_value", description = "The value of dst vertex's primary key", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "dst_primary_key_value", required = true) Object dstPrimaryKeyValue - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"src_label\" : \"person\", \"src_primary_key_value\" : \"\", \"dst_label\" : \"software\", \"edge_label\" : \"created\", \"dst_primary_key_value\" : \"\", \"properties\" : [ { \"name\" : \"id\", \"value\" : \"\" }, { \"name\" : \"id\", \"value\" : \"\" } ] }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /v1/graph/{graph_id} - * Get a graph by name - * - * @param graphId The id of graph to get (required) - * @return Successful operation (status code 200) - * or Not found (status code 404) - */ - @Operation( - operationId = "getGraph", - description = "Get a graph by name", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = GetGraphResponse.class)) - }), - @ApiResponse(responseCode = "404", description = "Not found", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/v1/graph/{graph_id}", - produces = { "application/json" } - ) - - default ResponseEntity getGraph( - @Parameter(name = "graph_id", description = "The id of graph to get", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"creation_time\" : 11223444, \"schema\" : { \"vertex_types\" : [ null, null ], \"edge_types\" : [ null, null ] }, \"stored_procedures\" : [ null, null ], \"name\" : \"name\", \"description\" : \"description\", \"id\" : \"id\", \"store_type\" : \"mutable_csr\", \"data_import_config\" : { \"loading_config\" : { \"x_csr_params\" : { \"parallelism\" : 0, \"build_csr_in_mem\" : true, \"use_mmap_vector\" : true }, \"format\" : { \"metadata\" : { \"key\" : \"\" }, \"type\" : \"type\" }, \"import_option\" : \"init\", \"data_source\" : { \"scheme\" : \"odps\", \"location\" : \"location\" } }, \"edge_mappings\" : [ { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } }, { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } } ], \"vertex_mappings\" : [ { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] }, { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] } ] }, \"version\" : \"version\", \"data_update_time\" : 11123445 }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /v1/graph/{graph_id}/statistics - * Get the statics info of a graph, including number of vertices for each label, number of edges for each label. - * - * @param graphId The id of graph to get statistics (required) - * @return successful operation (status code 200) - * or Server Internal Error (status code 500) - * or Not Found (status code 404) - * or Service Unavailable (status code 503) - */ - @Operation( - operationId = "getGraphStatistic", - description = "Get the statics info of a graph, including number of vertices for each label, number of edges for each label.", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = GetGraphStatisticsResponse.class)) - }), - @ApiResponse(responseCode = "500", description = "Server Internal Error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "404", description = "Not Found", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "503", description = "Service Unavailable", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/v1/graph/{graph_id}/statistics", - produces = { "application/json" } - ) - - default ResponseEntity getGraphStatistic( - @Parameter(name = "graph_id", description = "The id of graph to get statistics", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"edge_type_statistics\" : [ { \"type_name\" : \"type_name\", \"type_id\" : 5, \"vertex_type_pair_statistics\" : [ { \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\", \"count\" : 2 }, { \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\", \"count\" : 2 } ] }, { \"type_name\" : \"type_name\", \"type_id\" : 5, \"vertex_type_pair_statistics\" : [ { \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\", \"count\" : 2 }, { \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\", \"count\" : 2 } ] } ], \"total_vertex_count\" : 0, \"vertex_type_statistics\" : [ { \"type_name\" : \"type_name\", \"type_id\" : 1, \"count\" : 5 }, { \"type_name\" : \"type_name\", \"type_id\" : 1, \"count\" : 5 } ], \"total_edge_count\" : 6 }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /v1/job/{job_id} - * - * @param jobId The id of the job, returned from POST /v1/graph/{graph_id}/dataloading (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "getJobById", - tags = { "AdminService/JobManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = JobStatus.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/v1/job/{job_id}", - produces = { "application/json" } - ) - - default ResponseEntity getJobById( - @Parameter(name = "job_id", description = "The id of the job, returned from POST /v1/graph/{graph_id}/dataloading", required = true, in = ParameterIn.PATH) @PathVariable("job_id") String jobId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"start_time\" : 0, \"log\" : \"log\", \"end_time\" : 6, \"id\" : \"id\", \"detail\" : { \"key\" : \"\" }, \"type\" : \"type\", \"status\" : \"RUNNING\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /v1/graph/{graph_id}/procedure/{procedure_id} - * Get a procedure by id - * - * @param graphId (required) - * @param procedureId (required) - * @return successful operation (status code 200) - * or Not found (status code 404) - */ - @Operation( - operationId = "getProcedure", - description = "Get a procedure by id", - tags = { "AdminService/ProcedureManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = GetProcedureResponse.class)) - }), - @ApiResponse(responseCode = "404", description = "Not found", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/v1/graph/{graph_id}/procedure/{procedure_id}", - produces = { "application/json" } - ) - - default ResponseEntity getProcedure( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "procedure_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("procedure_id") String procedureId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "null"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /v1/graph/{graph_id}/schema - * Get schema by graph id - * - * @param graphId The id of graph to get schema (required) - * @return successful operation (status code 200) - * or (status code 500) - */ - @Operation( - operationId = "getSchema", - description = "Get schema by graph id", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = GetGraphSchemaResponse.class)) - }), - @ApiResponse(responseCode = "500", description = "") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/v1/graph/{graph_id}/schema", - produces = { "application/json" } - ) - - default ResponseEntity getSchema( - @Parameter(name = "graph_id", description = "The id of graph to get schema", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"vertex_types\" : [ null, null ], \"edge_types\" : [ null, null ] }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /v1/service/status - * Get service status - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "getServiceStatus", - description = "Get service status", - tags = { "AdminService/ServiceManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ServiceStatus.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/v1/service/status", - produces = { "application/json" } - ) - - default ResponseEntity getServiceStatus( - - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"start_time\" : 5, \"statistics_enabled\" : true, \"bolt_port\" : 0, \"hqps_port\" : 6, \"gremlin_port\" : 1, \"graph\" : { \"creation_time\" : 11223444, \"schema\" : { \"vertex_types\" : [ null, null ], \"edge_types\" : [ null, null ] }, \"stored_procedures\" : [ null, null ], \"name\" : \"name\", \"description\" : \"description\", \"id\" : \"id\", \"store_type\" : \"mutable_csr\", \"data_import_config\" : { \"loading_config\" : { \"x_csr_params\" : { \"parallelism\" : 0, \"build_csr_in_mem\" : true, \"use_mmap_vector\" : true }, \"format\" : { \"metadata\" : { \"key\" : \"\" }, \"type\" : \"type\" }, \"import_option\" : \"init\", \"data_source\" : { \"scheme\" : \"odps\", \"location\" : \"location\" } }, \"edge_mappings\" : [ { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } }, { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } } ], \"vertex_mappings\" : [ { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] }, { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] } ] }, \"version\" : \"version\", \"data_update_time\" : 11123445 }, \"status\" : \"status\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /v1/graph/{graph_id}/vertex : Get the vertex's properties with vertex primary key. - * Get the properties for the specified vertex. example: ```http GET /endpoint?param1=value1&param2=value2 HTTP/1.1 Host: example.com ``` - * - * @param graphId The id of the graph (required) - * @param label The label name of querying vertex. (required) - * @param primaryKeyValue The primary key value of querying vertex. (required) - * @return Found vertex (status code 200) - * or Bad input parameter (status code 400) - * or Vertex not found or graph not found (status code 404) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "getVertex", - summary = "Get the vertex's properties with vertex primary key.", - description = "Get the properties for the specified vertex. example: ```http GET /endpoint?param1=value1¶m2=value2 HTTP/1.1 Host: example.com ``` ", - tags = { "GraphService/VertexManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Found vertex", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = VertexData.class)) - }), - @ApiResponse(responseCode = "400", description = "Bad input parameter"), - @ApiResponse(responseCode = "404", description = "Vertex not found or graph not found"), - @ApiResponse(responseCode = "500", description = "Server internal error") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/v1/graph/{graph_id}/vertex", - produces = { "application/json" } - ) - - default ResponseEntity getVertex( - @Parameter(name = "graph_id", description = "The id of the graph", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @NotNull @Parameter(name = "label", description = "The label name of querying vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "label", required = true) String label, - @NotNull @Parameter(name = "primary_key_value", description = "The primary key value of querying vertex.", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "primary_key_value", required = true) Object primaryKeyValue - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"values\" : [ { \"name\" : \"id\", \"value\" : \"\" }, { \"name\" : \"id\", \"value\" : \"\" } ], \"label\" : \"person\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/graph/{graph_id}/schema : Import graph schema - * - * @param graphId (required) - * @param createGraphSchemaRequest (required) - * @return Successful imported the graph schema (status code 200) - * or (status code 400) - * or (status code 500) - */ - @Operation( - operationId = "importSchema", - summary = "Import graph schema", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successful imported the graph schema", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = ""), - @ApiResponse(responseCode = "500", description = "") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph/{graph_id}/schema", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity importSchema( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "CreateGraphSchemaRequest", description = "", required = true) @Valid @RequestBody CreateGraphSchemaRequest createGraphSchemaRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /v1/graph - * List all graphs - * - * @return Successful operation (status code 200) - */ - @Operation( - operationId = "listGraphs", - description = "List all graphs", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successful operation", content = { - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = GetGraphResponse.class))) - }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/v1/graph", - produces = { "application/json" } - ) - - default ResponseEntity> listGraphs( - - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"creation_time\" : 11223444, \"schema\" : { \"vertex_types\" : [ null, null ], \"edge_types\" : [ null, null ] }, \"stored_procedures\" : [ null, null ], \"name\" : \"name\", \"description\" : \"description\", \"id\" : \"id\", \"store_type\" : \"mutable_csr\", \"data_import_config\" : { \"loading_config\" : { \"x_csr_params\" : { \"parallelism\" : 0, \"build_csr_in_mem\" : true, \"use_mmap_vector\" : true }, \"format\" : { \"metadata\" : { \"key\" : \"\" }, \"type\" : \"type\" }, \"import_option\" : \"init\", \"data_source\" : { \"scheme\" : \"odps\", \"location\" : \"location\" } }, \"edge_mappings\" : [ { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } }, { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } } ], \"vertex_mappings\" : [ { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] }, { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] } ] }, \"version\" : \"version\", \"data_update_time\" : 11123445 }, { \"creation_time\" : 11223444, \"schema\" : { \"vertex_types\" : [ null, null ], \"edge_types\" : [ null, null ] }, \"stored_procedures\" : [ null, null ], \"name\" : \"name\", \"description\" : \"description\", \"id\" : \"id\", \"store_type\" : \"mutable_csr\", \"data_import_config\" : { \"loading_config\" : { \"x_csr_params\" : { \"parallelism\" : 0, \"build_csr_in_mem\" : true, \"use_mmap_vector\" : true }, \"format\" : { \"metadata\" : { \"key\" : \"\" }, \"type\" : \"type\" }, \"import_option\" : \"init\", \"data_source\" : { \"scheme\" : \"odps\", \"location\" : \"location\" } }, \"edge_mappings\" : [ { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } }, { \"inputs\" : [ \"inputs\", \"inputs\" ], \"source_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"destination_vertex_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"id\" } ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ], \"type_triplet\" : { \"edge\" : \"edge\", \"source_vertex\" : \"source_vertex\", \"destination_vertex\" : \"destination_vertex\" } } ], \"vertex_mappings\" : [ { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] }, { \"type_name\" : \"type_name\", \"inputs\" : [ \"file:///path/to/person.csv\", \"file:///path/to/person.csv\" ], \"column_mappings\" : [ { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" }, { \"column\" : { \"name\" : \"name\", \"index\" : 6 }, \"property\" : \"property\" } ] } ] }, \"version\" : \"version\", \"data_update_time\" : 11123445 } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /v1/job - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "listJobs", - tags = { "AdminService/JobManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = JobStatus.class))) - }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/v1/job", - produces = { "application/json" } - ) - - default ResponseEntity> listJobs( - - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"start_time\" : 0, \"log\" : \"log\", \"end_time\" : 6, \"id\" : \"id\", \"detail\" : { \"key\" : \"\" }, \"type\" : \"type\", \"status\" : \"RUNNING\" }, { \"start_time\" : 0, \"log\" : \"log\", \"end_time\" : 6, \"id\" : \"id\", \"detail\" : { \"key\" : \"\" }, \"type\" : \"type\", \"status\" : \"RUNNING\" } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /v1/graph/{graph_id}/procedure - * List all procedures - * - * @param graphId (required) - * @return Successful operation (status code 200) - * or Not found (status code 404) - */ - @Operation( - operationId = "listProcedures", - description = "List all procedures", - tags = { "AdminService/ProcedureManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successful operation", content = { - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = GetProcedureResponse.class))) - }), - @ApiResponse(responseCode = "404", description = "Not found", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/v1/graph/{graph_id}/procedure", - produces = { "application/json" } - ) - - default ResponseEntity> listProcedures( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ null, null ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/service/restart - * Start current service - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "restartService", - description = "Start current service", - tags = { "AdminService/ServiceManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/service/restart", - produces = { "application/json" } - ) - - default ResponseEntity restartService( - - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/graph/{graph_id}/adhoc_query : Submit adhoc query to the Interactive Query Service. - * Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto - * - * @param graphId (required) - * @param body (optional) - * @return Successfully runned. (status code 200) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "runAdhoc", - summary = "Submit adhoc query to the Interactive Query Service.", - description = "Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto ", - tags = { "QueryService" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully runned.", content = { - @Content(mediaType = "text/plain", schema = @Schema(implementation = byte[].class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = byte[].class)) - }), - @ApiResponse(responseCode = "500", description = "Server internal error", content = { - @Content(mediaType = "text/plain", schema = @Schema(implementation = APIResponseWithCode.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph/{graph_id}/adhoc_query", - produces = { "text/plain", "application/json" }, - consumes = { "text/plain" } - ) - - default ResponseEntity runAdhoc( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "body", description = "") @Valid @RequestBody(required = false) byte[] body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/graph/current/adhoc_query : Submit adhoc query to the Interactive Query Service. - * Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto - * - * @param body (optional) - * @return Successfully runned. Empty if failed? (status code 200) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "runAdhocCurrent", - summary = "Submit adhoc query to the Interactive Query Service.", - description = "Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto ", - tags = { "QueryService" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully runned. Empty if failed?", content = { - @Content(mediaType = "text/plain", schema = @Schema(implementation = byte[].class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = byte[].class)) - }), - @ApiResponse(responseCode = "500", description = "Server internal error", content = { - @Content(mediaType = "text/plain", schema = @Schema(implementation = APIResponseWithCode.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/graph/current/adhoc_query", - produces = { "text/plain", "application/json" }, - consumes = { "text/plain" } - ) - - default ResponseEntity runAdhocCurrent( - @Parameter(name = "body", description = "") @Valid @RequestBody(required = false) byte[] body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/service/start - * Start service on a specified graph - * - * @param startServiceRequest Start service on a specified graph (optional) - * @return successful operation (status code 200) - * or Internal Error (status code 500) - */ - @Operation( - operationId = "startService", - description = "Start service on a specified graph", - tags = { "AdminService/ServiceManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "500", description = "Internal Error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/service/start", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity startService( - @Parameter(name = "StartServiceRequest", description = "Start service on a specified graph") @Valid @RequestBody(required = false) StartServiceRequest startServiceRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/service/stop - * Stop current service - * - * @param stopServiceRequest Stop service on a specified graph (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "stopService", - description = "Stop current service", - tags = { "AdminService/ServiceManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/service/stop", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity stopService( - @Parameter(name = "StopServiceRequest", description = "Stop service on a specified graph") @Valid @RequestBody(required = false) StopServiceRequest stopServiceRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /v1/graph/{graph_id}/edge : Update edge's property - * Update the edge on the running graph. - * - * @param graphId (required) - * @param edgeRequest (optional) - * @return Successfully update edge (status code 200) - * or Invalid input parameters (status code 400) - * or Edge not exists (status code 404) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "updateEdge", - summary = "Update edge's property", - description = "Update the edge on the running graph. ", - tags = { "GraphService/EdgeManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully update edge", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid input parameters", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "404", description = "Edge not exists", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "500", description = "Server internal error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/v1/graph/{graph_id}/edge", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity updateEdge( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "EdgeRequest", description = "") @Valid @RequestBody(required = false) EdgeRequest edgeRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /v1/graph/{graph_id}/schema/edge - * Update an edge type to add more properties - * - * @param graphId (required) - * @param createEdgeType (required) - * @return Successfully updated the edge type (status code 200) - * or (status code 400) - * or (status code 500) - */ - @Operation( - operationId = "updateEdgeType", - description = "Update an edge type to add more properties", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully updated the edge type", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = ""), - @ApiResponse(responseCode = "500", description = "") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/v1/graph/{graph_id}/schema/edge", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity updateEdgeType( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "CreateEdgeType", description = "", required = true) @Valid @RequestBody CreateEdgeType createEdgeType - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /v1/graph/{graph_id}/procedure/{procedure_id} - * Update procedure on a graph by id - * - * @param graphId (required) - * @param procedureId (required) - * @param updateProcedureRequest (optional) - * @return Successful operation (status code 200) - * or Bad request (status code 400) - * or Not Found (status code 404) - * or Internal error (status code 500) - */ - @Operation( - operationId = "updateProcedure", - description = "Update procedure on a graph by id", - tags = { "AdminService/ProcedureManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Bad request", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "404", description = "Not Found", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "500", description = "Internal error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/v1/graph/{graph_id}/procedure/{procedure_id}", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity updateProcedure( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "procedure_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("procedure_id") String procedureId, - @Parameter(name = "UpdateProcedureRequest", description = "") @Valid @RequestBody(required = false) UpdateProcedureRequest updateProcedureRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /v1/graph/{graph_id}/vertex : Update vertex's property - * Remove the vertex from the specified graph. - * - * @param graphId (required) - * @param vertexRequest (optional) - * @return Successfully update vertex (status code 200) - * or Invalid input parameters (status code 400) - * or Vertex not exists (status code 404) - * or Server internal error (status code 500) - */ - @Operation( - operationId = "updateVertex", - summary = "Update vertex's property", - description = "Remove the vertex from the specified graph. ", - tags = { "GraphService/VertexManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully update vertex", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid input parameters", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "404", description = "Vertex not exists", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }), - @ApiResponse(responseCode = "500", description = "Server internal error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/v1/graph/{graph_id}/vertex", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity updateVertex( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "VertexRequest", description = "") @Valid @RequestBody(required = false) VertexRequest vertexRequest - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /v1/graph/{graph_id}/schema/vertex - * Update a vertex type to add more properties - * - * @param graphId (required) - * @param createVertexType (required) - * @return Successfully updated the vertex type (status code 200) - * or (status code 400) - * or (status code 500) - */ - @Operation( - operationId = "updateVertexType", - description = "Update a vertex type to add more properties", - tags = { "AdminService/GraphManagement" }, - responses = { - @ApiResponse(responseCode = "200", description = "Successfully updated the vertex type", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = ""), - @ApiResponse(responseCode = "500", description = "") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/v1/graph/{graph_id}/schema/vertex", - produces = { "application/json" }, - consumes = { "application/json" } - ) - - default ResponseEntity updateVertexType( - @Parameter(name = "graph_id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("graph_id") String graphId, - @Parameter(name = "CreateVertexType", description = "", required = true) @Valid @RequestBody CreateVertexType createVertexType - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "\"Response string\""; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /v1/file/upload - * - * @param filestorage (optional) - * @return successful operation (status code 200) - * or Server Internal Error (status code 500) - */ - @Operation( - operationId = "uploadFile", - tags = { "Utils" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = UploadFileResponse.class)) - }), - @ApiResponse(responseCode = "500", description = "Server Internal Error", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = APIResponseWithCode.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/file/upload", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - - default ResponseEntity uploadFile( - @Parameter(name = "filestorage", description = "") @RequestPart(value = "filestorage", required = false) MultipartFile filestorage - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"file_path\" : \"file_path\", \"metadata\" : { \"key\" : \"\" } }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/HomeController.java b/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index 9aa29284ab5f..000000000000 --- a/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.GetMapping; - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - -} \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java deleted file mode 100644 index 89a279010dd4..000000000000 --- a/interactive_engine/groot-http/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.Contact; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.security.SecurityScheme; - -@Configuration -public class SpringDocConfiguration { - - @Bean(name = "org.openapitools.configuration.SpringDocConfiguration.apiInfo") - OpenAPI apiInfo() { - return new OpenAPI() - .info( - new Info() - .title("GraphScope Interactive API v0.3") - .description("This is the definition of GraphScope Interactive API, including - AdminService API - Vertex/Edge API - QueryService AdminService API (with tag AdminService) defines the API for GraphManagement, ProcedureManagement and Service Management. Vertex/Edge API (with tag GraphService) defines the API for Vertex/Edge management, including creation/updating/delete/retrive. QueryService API (with tag QueryService) defines the API for procedure_call, Ahodc query. ") - .contact( - new Contact() - .email("graphscope@alibaba-inc.com") - ) - .license( - new License() - .name("Apache 2.0") - .url("http://www.apache.org/licenses/LICENSE-2.0.html") - ) - .version("1.0.0") - ) - ; - } -} \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/resources/application.properties b/interactive_engine/groot-http/src/main/resources/application.properties deleted file mode 100644 index d28c43b756f7..000000000000 --- a/interactive_engine/groot-http/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -server.port=8080 -spring.jackson.date-format=com.alibaba.graphscope.groot.RFC3339DateFormat -spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/interactive_engine/groot-http/src/main/resources/openapi.yaml b/interactive_engine/groot-http/src/main/resources/openapi.yaml deleted file mode 100644 index 7ec9a26854bd..000000000000 --- a/interactive_engine/groot-http/src/main/resources/openapi.yaml +++ /dev/null @@ -1,3221 +0,0 @@ -openapi: 3.0.3 -info: - contact: - email: graphscope@alibaba-inc.com - description: | - This is the definition of GraphScope Interactive API, including - - AdminService API - - Vertex/Edge API - - QueryService - - - AdminService API (with tag AdminService) defines the API for GraphManagement, ProcedureManagement and Service Management. - - Vertex/Edge API (with tag GraphService) defines the API for Vertex/Edge management, including creation/updating/delete/retrive. - - QueryService API (with tag QueryService) defines the API for procedure_call, Ahodc query. - license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - title: GraphScope Interactive API v0.3 - version: 1.0.0 -externalDocs: - description: Find out More about GraphScope - url: http://graphscope.io -servers: -- description: SwaggerHub API Auto Mocking - url: https://virtserver.swaggerhub.com/GRAPHSCOPE/InteractiveAPI/1.0.0 -- description: SwaggerHub API Auto Mocking - url: https://virtserver.swaggerhub.com/GRAPHSCOPE/interactive/1.0.0 -tags: -- description: GraphManagement - name: AdminService/GraphManagement -- description: ProcedureManagement - name: AdminService/ProcedureManagement -- description: ServiceManagement - name: AdminService/ServiceManagement -- description: VertexManagement - name: GraphService/VertexManagement -- description: EdgeManagement - name: GraphService/EdgeManagement -- description: Graph query - name: QueryService -paths: - /v1/graph: - get: - description: List all graphs - operationId: list_graphs - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/GetGraphResponse' - type: array - description: Successful operation - tags: - - AdminService/GraphManagement - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - post: - description: Create a new graph - operationId: create_graph - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateGraphRequest' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/CreateGraphResponse' - description: successful operation - "400": - content: - application/json: - schema: - type: string - description: BadRequest - "500": - content: - application/json: - schema: - type: string - description: Internal error - tags: - - AdminService/GraphManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - /v1/graph/{graph_id}: - delete: - description: Delete a graph by id - operationId: delete_graph - parameters: - - description: The id of graph to delete - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - example: Successfully delete graph - schema: - $ref: '#/components/schemas/APIResponse' - description: Successful operation - "404": - content: - application/json: - example: - code: 4 - message: Graph not found - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Not Found - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Internal Error - tags: - - AdminService/GraphManagement - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - get: - description: Get a graph by name - operationId: get_graph - parameters: - - description: The id of graph to get - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/GetGraphResponse' - description: Successful operation - "404": - content: - application/json: - schema: - example: graph not exists - type: string - description: Not found - tags: - - AdminService/GraphManagement - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - /v1/graph/{graph_id}/schema: - delete: - description: Delete schema by graph id - operationId: delete_schema - parameters: - - description: The id of graph to delete - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: successful operation - "500": - $ref: '#/components/responses/500' - tags: - - AdminService/GraphManagement - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - get: - description: Get schema by graph id - operationId: get_schema - parameters: - - description: The id of graph to get schema - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/GetGraphSchemaResponse' - description: successful operation - "500": - $ref: '#/components/responses/500' - tags: - - AdminService/GraphManagement - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - post: - operationId: import_schema - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateGraphSchemaRequest' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successful imported the graph schema - "400": - $ref: '#/components/responses/400' - "500": - $ref: '#/components/responses/500' - summary: Import graph schema - tags: - - AdminService/GraphManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - /v1/graph/{graph_id}/schema/vertex: - delete: - description: Delete a vertex type by name - operationId: deleteVertexTypeByName - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - explode: true - in: query - name: type_name - required: true - schema: - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully deleted the vertex type - "400": - $ref: '#/components/responses/400' - "500": - $ref: '#/components/responses/500' - tags: - - AdminService/GraphManagement - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - post: - description: Create a vertex type - operationId: createVertexType - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateVertexType' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully created the vertex type - "400": - $ref: '#/components/responses/400' - "500": - $ref: '#/components/responses/500' - tags: - - AdminService/GraphManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - put: - description: Update a vertex type to add more properties - operationId: updateVertexType - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateVertexType' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully updated the vertex type - "400": - $ref: '#/components/responses/400' - "500": - $ref: '#/components/responses/500' - tags: - - AdminService/GraphManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - /v1/graph/{graph_id}/schema/edge: - delete: - description: Delete an edge type by name - operationId: deleteEdgeTypeByName - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - explode: true - in: query - name: type_name - required: true - schema: - type: string - style: form - - explode: true - in: query - name: source_vertex_type - required: true - schema: - type: string - style: form - - explode: true - in: query - name: destination_vertex_type - required: true - schema: - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully deleted the edge type - "400": - $ref: '#/components/responses/400' - "500": - $ref: '#/components/responses/500' - tags: - - AdminService/GraphManagement - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - post: - description: Create a edge type - operationId: createEdgeType - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateEdgeType' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successful created the edge type - "400": - $ref: '#/components/responses/400' - "500": - $ref: '#/components/responses/500' - tags: - - AdminService/GraphManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - put: - description: Update an edge type to add more properties - operationId: updateEdgeType - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateEdgeType' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully updated the edge type - "400": - $ref: '#/components/responses/400' - "500": - $ref: '#/components/responses/500' - tags: - - AdminService/GraphManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - /v1/graph/{graph_id}/statistics: - get: - description: "Get the statics info of a graph, including number of vertices\ - \ for each label, number of edges for each label." - operationId: get_graph_statistic - parameters: - - description: The id of graph to get statistics - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/GetGraphStatisticsResponse' - description: successful operation - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server Internal Error - "404": - content: - application/json: - example: - code: 4 - message: Graph not found - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Not Found - "503": - content: - application/json: - example: - code: 15 - message: Service Unavailable - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Service Unavailable - tags: - - AdminService/GraphManagement - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - /v1/graph/{graph_id}/dataloading: - post: - description: Create a dataloading job - operationId: create_dataloading_job - parameters: - - description: The id of graph to do bulk loading. - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SchemaMapping' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/JobResponse' - description: successful operation - tags: - - AdminService/GraphManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: AdminService/GraphManagement - /v1/job/{job_id}: - delete: - operationId: delete_job_by_id - parameters: - - explode: false - in: path - name: job_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - example: "Successfully cancel job: 123" - schema: - $ref: '#/components/schemas/APIResponse' - description: Successful operation - tags: - - AdminService/JobManagement - x-accepts: application/json - x-tags: - - tag: AdminService/JobManagement - get: - operationId: get_job_by_id - parameters: - - description: "The id of the job, returned from POST /v1/graph/{graph_id}/dataloading" - explode: false - in: path - name: job_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/JobStatus' - description: successful operation - tags: - - AdminService/JobManagement - x-accepts: application/json - x-tags: - - tag: AdminService/JobManagement - /v1/job: - get: - operationId: list_jobs - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/JobStatus' - type: array - description: successful operation - tags: - - AdminService/JobManagement - x-accepts: application/json - x-tags: - - tag: AdminService/JobManagement - /v1/graph/{graph_id}/procedure: - get: - description: List all procedures - operationId: list_procedures - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/GetProcedureResponse' - type: array - description: Successful operation - "404": - content: - application/json: - schema: - example: Graph not found - type: string - description: Not found - tags: - - AdminService/ProcedureManagement - x-accepts: application/json - x-tags: - - tag: AdminService/ProcedureManagement - post: - description: Create a new procedure on a graph - operationId: create_procedure - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateProcedureRequest' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/CreateProcedureResponse' - description: successful operation - "400": - content: - application/json: - example: - code: 14 - message: Bad request - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Bad request - "404": - content: - application/json: - example: - code: 4 - message: Graph not found - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: not found - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Internal Error - tags: - - AdminService/ProcedureManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: AdminService/ProcedureManagement - /v1/graph/{graph_id}/procedure/{procedure_id}: - delete: - description: Delete a procedure on a graph by id - operationId: delete_procedure - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: procedure_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successful operation - "404": - content: - application/json: - example: - code: 4 - message: Graph not found/Procedure not found - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Not Found - tags: - - AdminService/ProcedureManagement - x-accepts: application/json - x-tags: - - tag: AdminService/ProcedureManagement - get: - description: Get a procedure by id - operationId: get_procedure - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: procedure_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/GetProcedureResponse' - description: successful operation - "404": - content: - application/json: - schema: - example: Graph not found/procedure not found - type: string - description: Not found - tags: - - AdminService/ProcedureManagement - x-accepts: application/json - x-tags: - - tag: AdminService/ProcedureManagement - put: - description: Update procedure on a graph by id - operationId: update_procedure - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: procedure_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProcedureRequest' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successful operation - "400": - content: - application/json: - example: - code: 14 - message: Bad request - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Bad request - "404": - content: - application/json: - example: - code: 4 - message: Graph not found/Procedure not found - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Not Found - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Internal error - tags: - - AdminService/ProcedureManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: AdminService/ProcedureManagement - /v1/service/start: - post: - description: Start service on a specified graph - operationId: start_service - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/StartServiceRequest' - description: Start service on a specified graph - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: successful operation - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Internal Error - tags: - - AdminService/ServiceManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: AdminService/ServiceManagement - /v1/service/stop: - post: - description: Stop current service - operationId: stop_service - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/StopServiceRequest' - description: Stop service on a specified graph - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: successful operation - tags: - - AdminService/ServiceManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: AdminService/ServiceManagement - /v1/service/restart: - post: - description: Start current service - operationId: restart_service - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: successful operation - tags: - - AdminService/ServiceManagement - x-accepts: application/json - x-tags: - - tag: AdminService/ServiceManagement - /v1/service/status: - get: - description: Get service status - operationId: get_service_status - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceStatus' - description: successful operation - tags: - - AdminService/ServiceManagement - x-accepts: application/json - x-tags: - - tag: AdminService/ServiceManagement - /v1/graph/{graph_id}/vertex: - delete: - description: | - Remove the vertex from the specified graph. - operationId: delete_vertex - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/delete_vertex_request' - description: The label and primary key values of the vertex to be deleted. - required: true - responses: - "200": - content: - application/json: - example: - message: Successfully delete vertex - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully delete vertex - "400": - content: - application/json: - example: - code: 101 - message: Invalid input vertex schema - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Invalid input vertex - "404": - content: - application/json: - example: - code: 4 - message: Vertex not exists - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Vertex not exists or Graph not exits. - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server internal error - summary: Remove vertex from the graph - tags: - - GraphService/VertexManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: GraphService/VertexManagement - get: - description: | - Get the properties for the specified vertex. - example: - ```http - GET /endpoint?param1=value1¶m2=value2 HTTP/1.1 - Host: example.com - ``` - operationId: get_vertex - parameters: - - description: The id of the graph - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - description: The label name of querying vertex. - explode: true - in: query - name: label - required: true - schema: - type: string - style: form - - description: The primary key value of querying vertex. - explode: true - in: query - name: primary_key_value - required: true - schema: - $ref: '#/components/schemas/AnyValue' - style: form - responses: - "200": - content: - application/json: - example: - label: person - values: - - name: id - value: 1 - - name: age - value: 23 - - name: name - value: amy - schema: - $ref: '#/components/schemas/VertexData' - description: Found vertex - "400": - description: Bad input parameter - "404": - description: Vertex not found or graph not found - "500": - description: Server internal error - summary: Get the vertex's properties with vertex primary key. - tags: - - GraphService/VertexManagement - x-accepts: application/json - x-tags: - - tag: GraphService/VertexManagement - post: - description: | - Add the provided vertex to the specified graph. - operationId: add_vertex - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - example: - - label: person - primary_key_values: - id: 2 - properties: - age: 24 - name: Cindy - schema: - items: - $ref: '#/components/schemas/VertexRequest' - type: array - required: true - responses: - "200": - content: - application/json: - example: - message: Successfully created vertex - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully created vertex - "400": - content: - application/json: - example: - code: 101 - message: Invalid input vertex schema - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Invalid input vertex - "404": - content: - application/json: - example: - code: 4 - message: Graph not found - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Graph not found - "409": - content: - application/json: - example: - code: 102 - message: Vertex already exists - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Vertex already exists - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server internal error - summary: Add vertex to the graph - tags: - - GraphService/VertexManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: GraphService/VertexManagement - put: - description: | - Remove the vertex from the specified graph. - operationId: update_vertex - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - example: - label: person - primary_key_value: 2 - properties: - age: 24 - name: Cindy - schema: - $ref: '#/components/schemas/VertexRequest' - responses: - "200": - content: - application/json: - example: - message: Successfully updated vertex - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully update vertex - "400": - content: - application/json: - example: - code: 101 - message: Invalid input vertex schema - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Invalid input parameters - "404": - content: - application/json: - example: - code: 4 - message: Vertex not exists - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Vertex not exists - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server internal error - summary: Update vertex's property - tags: - - GraphService/VertexManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: GraphService/VertexManagement - /v1/graph/{graph_id}/edge: - delete: - description: | - Remove the edge from current graph. - operationId: delete_edge - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/delete_edge_request' - description: "The label and primary key values of the src and dst vertices,\ - \ and the edge label." - required: true - responses: - "200": - content: - application/json: - example: - message: Successfully delete edge - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully delete edge - "400": - content: - application/json: - example: - code: 101 - message: Invalid input edge schema - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Invalid input edge - "404": - content: - application/json: - example: - code: 4 - message: Edge not exists - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Edge not exists or Graph not exits - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server internal error - summary: Remove edge from the graph - tags: - - GraphService/EdgeManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: GraphService/EdgeManagement - get: - description: | - Get the properties for the specified vertex. - operationId: get_edge - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - description: The label name of querying edge. - example: created - explode: true - in: query - name: edge_label - required: true - schema: - type: string - style: form - - description: The label name of src vertex. - example: person - explode: true - in: query - name: src_label - required: true - schema: - type: string - style: form - - description: The primary key value of src vertex. - example: 1 - explode: true - in: query - name: src_primary_key_value - required: true - schema: - $ref: '#/components/schemas/AnyValue' - style: form - - description: The label name of dst vertex. - example: software - explode: true - in: query - name: dst_label - required: true - schema: - type: string - style: form - - description: The value of dst vertex's primary key - example: 3 - explode: true - in: query - name: dst_primary_key_value - required: true - schema: - $ref: '#/components/schemas/AnyValue' - style: form - responses: - "200": - content: - application/json: - example: - src_label: person - dst_label: software - edge_label: created - src_pk_value: 1 - dst_pk_value: 3 - properties: - - name: weight - value: 0.2 - schema: - $ref: '#/components/schemas/EdgeData' - description: Found Edge - "400": - content: - application/json: - example: - code: 101 - message: Invalid input edge schema - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Bad input parameter - "404": - content: - application/json: - example: - code: 4 - message: Edge not found - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Edge not found or Graph not found - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server internal error - summary: Get the edge's properties with src and dst vertex primary keys. - tags: - - GraphService/EdgeManagement - x-accepts: application/json - x-tags: - - tag: GraphService/EdgeManagement - post: - description: | - Add the edge to graph. - operationId: add_edge - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - example: - - src_label: person - dst_label: software - edge_label: created - src_pk_name: id - src_pk_value: 1 - dst_pk_name: id - dst_pk_value: 3 - properties: - - name: weight - value: 0.2 - schema: - items: - $ref: '#/components/schemas/EdgeRequest' - type: array - required: true - responses: - "200": - content: - application/json: - example: - message: Successfuly create edge - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully insert the edge - "400": - content: - application/json: - example: - code: 101 - message: Invalid input edge schema - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Invalid input edge - "409": - content: - application/json: - example: - code: 102 - message: Edge already exists - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: edge already exists - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server internal error - summary: Add edge to the graph - tags: - - GraphService/EdgeManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: GraphService/EdgeManagement - put: - description: | - Update the edge on the running graph. - operationId: update_edge - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - example: - src_label: person - dst_label: software - edge_label: created - src_pk_name: id - src_pk_value: 1 - dst_pk_name: id - dst_pk_value: 3 - properties: - - name: weight - value: 0.3 - schema: - $ref: '#/components/schemas/EdgeRequest' - responses: - "200": - content: - application/json: - example: - message: Successfully update edge - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully update edge - "400": - content: - application/json: - example: - code: 101 - message: Invalid input edge schema - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Invalid input parameters - "404": - content: - application/json: - example: - code: 4 - message: Edge not exists - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Edge not exists - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server internal error - summary: Update edge's property - tags: - - GraphService/EdgeManagement - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: GraphService/EdgeManagement - /v1/graph/{graph_id}/query: - post: - description: | - After the procedure is created, user can use this API to run the procedure. - operationId: call_proc - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - text/plain: - schema: - format: byte - type: string - responses: - "200": - content: - text/plain: - schema: - format: byte - type: string - description: Successfully runned. - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server internal error - summary: run queries on graph - tags: - - QueryService - x-content-type: text/plain - x-accepts: application/json - x-tags: - - tag: QueryService - /v1/graph/current/query: - post: - description: | - Submit a query to the running graph. - operationId: call_proc_current - requestBody: - content: - text/plain: - schema: - format: byte - type: string - responses: - "200": - content: - text/plain: - schema: - format: byte - type: string - description: Successfully runned. Empty if failed? - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server internal error - summary: run queries on the running graph - tags: - - QueryService - x-content-type: text/plain - x-accepts: application/json - x-tags: - - tag: QueryService - /v1/graph/current/adhoc_query: - post: - description: | - Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: - https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto - operationId: run_adhoc_current - requestBody: - content: - text/plain: - schema: - format: byte - type: string - responses: - "200": - content: - text/plain: - schema: - format: byte - type: string - description: Successfully runned. Empty if failed? - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server internal error - summary: Submit adhoc query to the Interactive Query Service. - tags: - - QueryService - x-content-type: text/plain - x-accepts: application/json - x-tags: - - tag: QueryService - /v1/graph/{graph_id}/adhoc_query: - post: - description: | - Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan: - https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto - operationId: run_adhoc - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - text/plain: - schema: - format: byte - type: string - responses: - "200": - content: - text/plain: - schema: - format: byte - type: string - description: Successfully runned. - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server internal error - summary: Submit adhoc query to the Interactive Query Service. - tags: - - QueryService - x-content-type: text/plain - x-accepts: application/json - x-tags: - - tag: QueryService - /v1/file/upload: - post: - operationId: uploadFile - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/uploadFile_request' - required: true - responses: - "200": - content: - application/json: - example: - file_path: /home/graphscope/path/to/file.csv - schema: - $ref: '#/components/schemas/UploadFileResponse' - description: successful operation - "500": - content: - application/json: - example: - code: 103 - message: Internal error - schema: - $ref: '#/components/schemas/APIResponseWithCode' - description: Server Internal Error - tags: - - Utils - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: Utils -components: - schemas: - AnyValue: {} - TypedValue: - properties: - type: - $ref: '#/components/schemas/GSDataType' - value: {} - required: - - type - - value - type: object - PrimitiveType: - properties: - primitive_type: - enum: - - DT_SIGNED_INT32 - - DT_UNSIGNED_INT32 - - DT_SIGNED_INT64 - - DT_UNSIGNED_INT64 - - DT_BOOL - - DT_FLOAT - - DT_DOUBLE - - DT_STRING - example: DT_SIGNED_INT32 - type: string - required: - - primitive_type - type: object - x-body-name: primitive_type - LongText: - additionalProperties: false - properties: - long_text: - nullable: true - type: string - required: - - long_text - type: object - x-body-name: long_text - FixedChar: - additionalProperties: false - properties: - char: - $ref: '#/components/schemas/FixedChar_char' - required: - - char - type: object - x-body-name: fixed_char - VarChar: - additionalProperties: false - properties: - var_char: - $ref: '#/components/schemas/VarChar_var_char' - required: - - var_char - type: object - x-body-name: var_char - StringType: - properties: - string: - $ref: '#/components/schemas/StringType_string' - required: - - string - type: object - x-body-name: string_type - TimeStampType: - properties: - timestamp: - type: string - required: - - timestamp - type: object - x-body-name: time_stamp_type - DateType: - properties: - date32: - type: string - required: - - date32 - type: object - x-body-name: date_type - TemporalType: - properties: - temporal: - $ref: '#/components/schemas/TemporalType_temporal' - required: - - temporal - type: object - x-body-name: temporal_type - GSDataType: - oneOf: - - $ref: '#/components/schemas/PrimitiveType' - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/TemporalType' - x-body-name: gs_data_type - x-one-of-name: GSDataType - Property: - example: - name: id - value: "" - properties: - name: - example: id - type: string - value: {} - required: - - name - - value - type: object - x-body-name: property - Parameter: - properties: - name: - example: param1 - type: string - type: - $ref: '#/components/schemas/GSDataType' - required: - - name - - type - type: object - x-body-name: parameter - VertexRequest: - example: - primary_key_values: - - name: id - value: "" - - name: id - value: "" - label: person - properties: - - name: id - value: "" - - name: id - value: "" - properties: - label: - example: person - type: string - primary_key_values: - items: - $ref: '#/components/schemas/Property' - type: array - properties: - items: - $ref: '#/components/schemas/Property' - type: array - required: - - label - - primary_key_values - - properties - type: object - x-body-name: vertex_request - VertexData: - example: - values: - - name: id - value: "" - - name: id - value: "" - label: person - properties: - label: - example: person - type: string - values: - items: - $ref: '#/components/schemas/Property' - type: array - required: - - label - type: object - x-body-name: vertex_data - EdgeData: - example: - src_label: person - src_primary_key_value: "" - dst_label: software - edge_label: created - dst_primary_key_value: "" - properties: - - name: id - value: "" - - name: id - value: "" - properties: - src_label: - example: person - type: string - dst_label: - example: software - type: string - edge_label: - example: created - type: string - src_primary_key_value: {} - dst_primary_key_value: {} - properties: - items: - $ref: '#/components/schemas/Property' - type: array - required: - - dst_label - - dst_primary_key_value - - edge_label - - properties - - src_label - - src_primary_key_value - type: object - x-body-name: edge_data - EdgeRequest: - example: - src_label: person - dst_primary_key_values: - - name: id - value: "" - - name: id - value: "" - dst_label: software - src_primary_key_values: - - name: id - value: "" - - name: id - value: "" - edge_label: created - properties: - - name: id - value: "" - - name: id - value: "" - properties: - src_label: - example: person - type: string - dst_label: - example: software - type: string - edge_label: - example: created - type: string - src_primary_key_values: - items: - $ref: '#/components/schemas/Property' - type: array - dst_primary_key_values: - items: - $ref: '#/components/schemas/Property' - type: array - properties: - items: - $ref: '#/components/schemas/Property' - type: array - required: - - dst_label - - dst_primary_key_values - - edge_label - - src_label - - src_primary_key_values - type: object - x-body-name: edge_request - QueryRequest: - properties: - query_name: - example: ic1 - type: string - arguments: - items: - $ref: '#/components/schemas/TypedValue' - type: array - required: - - query_name - type: object - x-body-name: query_request - CreateProcedureRequest: - example: - query: MATCH(a) return COUNT(a); - name: query1 - description: A sample stored procedure - type: cpp - properties: - name: - example: query1 - type: string - description: - example: A sample stored procedure - type: string - type: - enum: - - cpp - - cypher - type: string - query: - example: MATCH(a) return COUNT(a); - type: string - required: - - name - - query - - type - type: object - x-body-name: create_procedure_request - CreateProcedureResponse: - example: - procedure_id: proc1 - properties: - procedure_id: - example: proc1 - type: string - required: - - procedure_id - type: object - x-body-name: create_procedure_response - StoredProcedureMeta: - allOf: - - $ref: '#/components/schemas/CreateProcedureRequest' - - properties: - id: - example: "The unique identifier of procedure, currently is same with name." - type: string - library: - example: /path/to/library - type: string - params: - items: - $ref: '#/components/schemas/Parameter' - type: array - returns: - items: - $ref: '#/components/schemas/Parameter' - type: array - enable: - example: true - type: boolean - option: - additionalProperties: true - type: object - type: object - x-body-name: stored_procedure_meta - GetProcedureResponse: - allOf: - - $ref: '#/components/schemas/StoredProcedureMeta' - - properties: - bound_graph: - type: string - runnable: - type: boolean - creation_time: - type: integer - update_time: - type: integer - type: object - x-body-name: get_procedure_response - UpdateProcedureRequest: - example: - description: A sample stored procedure - properties: - description: - example: A sample stored procedure - type: string - type: object - x-body-name: update_procedure_request - CreateGraphResponse: - example: - graph_id: "1" - properties: - graph_id: - example: "1" - type: string - type: object - x-body-name: create_graph_response - CreateGraphRequest: - example: - schema: - vertex_types: - - null - - null - edge_types: - - null - - null - stored_procedures: - - query: MATCH(a) return COUNT(a); - name: query1 - description: A sample stored procedure - type: cpp - - query: MATCH(a) return COUNT(a); - name: query1 - description: A sample stored procedure - type: cpp - name: modern_graph - description: A default description - properties: - name: - example: modern_graph - type: string - description: - example: A default description - type: string - stored_procedures: - items: - $ref: '#/components/schemas/CreateProcedureRequest' - type: array - schema: - $ref: '#/components/schemas/CreateGraphSchemaRequest' - type: object - x-body-name: create_graph_request - APIResponse: - example: Response string - type: string - x-body-name: api_response - APIResponseWithCode: - example: - code: 500 - message: Internal Error - properties: - code: - format: int32 - type: integer - message: - type: string - type: object - x-body-name: api_response_with_code - VertexStatistics: - example: - type_name: type_name - type_id: 1 - count: 5 - properties: - type_id: - type: integer - type_name: - type: string - count: - type: integer - type: object - x-body-name: vertex_statistics - VertexTypePairStatistics: - example: - source_vertex: source_vertex - destination_vertex: destination_vertex - count: 2 - properties: - source_vertex: - type: string - destination_vertex: - type: string - count: - type: integer - required: - - count - - destination_vertex - - source_vertex - type: object - x-body-name: vertex_type_pair_statistics - EdgeStatistics: - example: - type_name: type_name - type_id: 5 - vertex_type_pair_statistics: - - source_vertex: source_vertex - destination_vertex: destination_vertex - count: 2 - - source_vertex: source_vertex - destination_vertex: destination_vertex - count: 2 - properties: - type_id: - type: integer - type_name: - type: string - vertex_type_pair_statistics: - items: - $ref: '#/components/schemas/VertexTypePairStatistics' - type: array - type: object - x-body-name: edge_statistics - GetGraphStatisticsResponse: - example: - edge_type_statistics: - - type_name: type_name - type_id: 5 - vertex_type_pair_statistics: - - source_vertex: source_vertex - destination_vertex: destination_vertex - count: 2 - - source_vertex: source_vertex - destination_vertex: destination_vertex - count: 2 - - type_name: type_name - type_id: 5 - vertex_type_pair_statistics: - - source_vertex: source_vertex - destination_vertex: destination_vertex - count: 2 - - source_vertex: source_vertex - destination_vertex: destination_vertex - count: 2 - total_vertex_count: 0 - vertex_type_statistics: - - type_name: type_name - type_id: 1 - count: 5 - - type_name: type_name - type_id: 1 - count: 5 - total_edge_count: 6 - properties: - total_vertex_count: - type: integer - total_edge_count: - type: integer - vertex_type_statistics: - items: - $ref: '#/components/schemas/VertexStatistics' - type: array - edge_type_statistics: - items: - $ref: '#/components/schemas/EdgeStatistics' - type: array - required: - - total_edge_count - - total_vertex_count - type: object - x-body-name: graph_statistics_response - GetGraphResponse: - example: - creation_time: 11223444 - schema: - vertex_types: - - null - - null - edge_types: - - null - - null - stored_procedures: - - null - - null - name: name - description: description - id: id - store_type: mutable_csr - data_import_config: - loading_config: - x_csr_params: - parallelism: 0 - build_csr_in_mem: true - use_mmap_vector: true - format: - metadata: - key: "" - type: type - import_option: init - data_source: - scheme: odps - location: location - edge_mappings: - - inputs: - - inputs - - inputs - source_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - destination_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - type_triplet: - edge: edge - source_vertex: source_vertex - destination_vertex: destination_vertex - - inputs: - - inputs - - inputs - source_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - destination_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - type_triplet: - edge: edge - source_vertex: source_vertex - destination_vertex: destination_vertex - vertex_mappings: - - type_name: type_name - inputs: - - file:///path/to/person.csv - - file:///path/to/person.csv - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - - type_name: type_name - inputs: - - file:///path/to/person.csv - - file:///path/to/person.csv - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - version: version - data_update_time: 11123445 - properties: - version: - type: string - id: - type: string - name: - type: string - description: - type: string - store_type: - enum: - - mutable_csr - type: string - creation_time: - example: 11223444 - type: integer - data_update_time: - example: 11123445 - type: integer - stored_procedures: - items: - $ref: '#/components/schemas/GetProcedureResponse' - type: array - schema: - $ref: '#/components/schemas/GetGraphSchemaResponse' - data_import_config: - $ref: '#/components/schemas/SchemaMapping' - type: object - x-body-name: get_graph_response - CreateGraphSchemaRequest: - example: - vertex_types: - - null - - null - edge_types: - - null - - null - properties: - vertex_types: - items: - $ref: '#/components/schemas/CreateVertexType' - type: array - edge_types: - items: - $ref: '#/components/schemas/CreateEdgeType' - type: array - type: object - x-body-name: create_graph_schema_request - GetGraphSchemaResponse: - example: - vertex_types: - - null - - null - edge_types: - - null - - null - properties: - vertex_types: - items: - $ref: '#/components/schemas/GetVertexType' - type: array - edge_types: - items: - $ref: '#/components/schemas/GetEdgeType' - type: array - type: object - x-body-name: get_graph_schema_response - BaseVertexType: - properties: - type_name: - type: string - primary_keys: - items: - type: string - type: array - x_csr_params: - $ref: '#/components/schemas/BaseVertexType_x_csr_params' - type: object - CreateVertexType: - allOf: - - $ref: '#/components/schemas/BaseVertexType' - - properties: - properties: - items: - $ref: '#/components/schemas/CreatePropertyMeta' - type: array - type: object - x-body-name: create_vertex_type - GetVertexType: - allOf: - - $ref: '#/components/schemas/BaseVertexType' - - properties: - type_id: - format: int32 - type: integer - properties: - items: - $ref: '#/components/schemas/GetPropertyMeta' - type: array - description: - type: string - type: object - x-body-name: get_vertex_type - BaseEdgeType: - properties: - type_name: - type: string - vertex_type_pair_relations: - items: - $ref: '#/components/schemas/BaseEdgeType_vertex_type_pair_relations_inner' - type: array - type: object - CreateEdgeType: - allOf: - - $ref: '#/components/schemas/BaseEdgeType' - - properties: - properties: - items: - $ref: '#/components/schemas/CreatePropertyMeta' - type: array - type: object - x-body-name: create_edge_type - GetEdgeType: - allOf: - - $ref: '#/components/schemas/BaseEdgeType' - - properties: - type_id: - format: int32 - type: integer - description: - type: string - properties: - items: - $ref: '#/components/schemas/GetPropertyMeta' - type: array - type: object - x-body-name: get_edge_type - BasePropertyMeta: - properties: - property_name: - type: string - property_type: - $ref: '#/components/schemas/GSDataType' - type: object - CreatePropertyMeta: - allOf: - - $ref: '#/components/schemas/BasePropertyMeta' - x-body-name: create_property_meta - GetPropertyMeta: - allOf: - - $ref: '#/components/schemas/BasePropertyMeta' - - properties: - property_id: - format: int32 - type: integer - type: object - x-body-name: get_property_meta - SchemaMapping: - example: - loading_config: - x_csr_params: - parallelism: 0 - build_csr_in_mem: true - use_mmap_vector: true - format: - metadata: - key: "" - type: type - import_option: init - data_source: - scheme: odps - location: location - edge_mappings: - - inputs: - - inputs - - inputs - source_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - destination_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - type_triplet: - edge: edge - source_vertex: source_vertex - destination_vertex: destination_vertex - - inputs: - - inputs - - inputs - source_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - destination_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - type_triplet: - edge: edge - source_vertex: source_vertex - destination_vertex: destination_vertex - vertex_mappings: - - type_name: type_name - inputs: - - file:///path/to/person.csv - - file:///path/to/person.csv - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - - type_name: type_name - inputs: - - file:///path/to/person.csv - - file:///path/to/person.csv - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - properties: - loading_config: - $ref: '#/components/schemas/SchemaMapping_loading_config' - vertex_mappings: - items: - $ref: '#/components/schemas/VertexMapping' - type: array - edge_mappings: - items: - $ref: '#/components/schemas/EdgeMapping' - type: array - type: object - x-body-name: schema_mapping - VertexMapping: - example: - type_name: type_name - inputs: - - file:///path/to/person.csv - - file:///path/to/person.csv - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - properties: - type_name: - type: string - inputs: - items: - example: file:///path/to/person.csv - type: string - type: array - column_mappings: - items: - $ref: '#/components/schemas/ColumnMapping' - type: array - type: object - x-body-name: vertex_mapping - EdgeMapping: - example: - inputs: - - inputs - - inputs - source_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - destination_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - type_triplet: - edge: edge - source_vertex: source_vertex - destination_vertex: destination_vertex - properties: - type_triplet: - $ref: '#/components/schemas/EdgeMapping_type_triplet' - inputs: - items: - type: string - type: array - source_vertex_mappings: - items: - $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner' - type: array - destination_vertex_mappings: - items: - $ref: '#/components/schemas/EdgeMapping_destination_vertex_mappings_inner' - type: array - column_mappings: - items: - $ref: '#/components/schemas/ColumnMapping' - type: array - type: object - x-body-name: edge_mapping - ColumnMapping: - example: - column: - name: name - index: 6 - property: property - properties: - column: - $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner_column' - property: - description: must align with the schema - type: string - type: object - x-body-name: column_mapping - StartServiceRequest: - example: - graph_id: graph_id - properties: - graph_id: - type: string - x-body-name: start_service_request - StopServiceRequest: - additionalProperties: false - example: - graph_id: graph_id - properties: - graph_id: - nullable: true - type: string - type: object - x-body-name: stop_service_request - ServiceStatus: - example: - start_time: 5 - statistics_enabled: true - bolt_port: 0 - hqps_port: 6 - gremlin_port: 1 - graph: - creation_time: 11223444 - schema: - vertex_types: - - null - - null - edge_types: - - null - - null - stored_procedures: - - null - - null - name: name - description: description - id: id - store_type: mutable_csr - data_import_config: - loading_config: - x_csr_params: - parallelism: 0 - build_csr_in_mem: true - use_mmap_vector: true - format: - metadata: - key: "" - type: type - import_option: init - data_source: - scheme: odps - location: location - edge_mappings: - - inputs: - - inputs - - inputs - source_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - destination_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - type_triplet: - edge: edge - source_vertex: source_vertex - destination_vertex: destination_vertex - - inputs: - - inputs - - inputs - source_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - destination_vertex_mappings: - - column: - name: name - index: 6 - property: id - - column: - name: name - index: 6 - property: id - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - type_triplet: - edge: edge - source_vertex: source_vertex - destination_vertex: destination_vertex - vertex_mappings: - - type_name: type_name - inputs: - - file:///path/to/person.csv - - file:///path/to/person.csv - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - - type_name: type_name - inputs: - - file:///path/to/person.csv - - file:///path/to/person.csv - column_mappings: - - column: - name: name - index: 6 - property: property - - column: - name: name - index: 6 - property: property - version: version - data_update_time: 11123445 - status: status - properties: - statistics_enabled: - type: boolean - status: - type: string - graph: - $ref: '#/components/schemas/GetGraphResponse' - bolt_port: - format: int32 - type: integer - hqps_port: - format: int32 - type: integer - gremlin_port: - format: int32 - type: integer - start_time: - format: int32 - type: integer - type: object - x-body-name: service_status - JobResponse: - example: - job_id: job_id - properties: - job_id: - type: string - type: object - x-body-name: job_response - JobStatus: - example: - start_time: 0 - log: log - end_time: 6 - id: id - detail: - key: "" - type: type - status: RUNNING - properties: - id: - type: string - type: - type: string - status: - enum: - - RUNNING - - SUCCESS - - FAILED - - CANCELLED - - WAITING - type: string - start_time: - format: int32 - type: integer - end_time: - format: int32 - type: integer - log: - description: URL or log string - type: string - detail: - additionalProperties: true - type: object - type: object - x-body-name: job_status - UploadFileResponse: - example: - file_path: file_path - metadata: - key: "" - properties: - file_path: - type: string - metadata: - additionalProperties: true - type: object - required: - - file_path - VertexEdgeRequest: - properties: - vertex_request: - items: - $ref: '#/components/schemas/VertexRequest' - type: array - edge_request: - items: - $ref: '#/components/schemas/EdgeRequest' - type: array - required: - - edge_request - - vertex_request - type: object - delete_vertex_request: - properties: - label: - description: The label name of the vertex to delete. - type: string - primary_key_values: - description: The primary key values for locating the vertex. - items: - $ref: '#/components/schemas/Property' - type: array - type: object - delete_edge_request: - properties: - edge_label: - description: The label name of the edge. - example: created - type: string - src_label: - description: The label name of the source vertex. - example: person - type: string - dst_label: - description: The label name of the destination vertex. - example: software - type: string - src_primary_key_values: - description: Primary key values for the source vertex. - items: - $ref: '#/components/schemas/Property' - type: array - dst_primary_key_values: - description: Primary key values for the destination vertex. - items: - $ref: '#/components/schemas/Property' - type: array - type: object - uploadFile_request: - properties: - filestorage: - format: binary - type: string - type: object - FixedChar_char: - properties: - fixed_length: - type: integer - required: - - fixed_length - type: object - VarChar_var_char: - properties: - max_length: - type: integer - required: - - max_length - type: object - StringType_string: - oneOf: - - $ref: '#/components/schemas/LongText' - - $ref: '#/components/schemas/FixedChar' - - $ref: '#/components/schemas/VarChar' - x-one-of-name: StringTypeString - TemporalType_temporal: - oneOf: - - $ref: '#/components/schemas/TimeStampType' - - $ref: '#/components/schemas/DateType' - x-one-of-name: TemporalTypeTemporal - BaseVertexType_x_csr_params: - description: Used for storage optimization - properties: - max_vertex_num: - type: integer - type: object - BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params: - description: Used for storage optimization - properties: - edge_storage_strategy: - enum: - - ONLY_IN - - ONLY_OUT - - BOTH_OUT_IN - type: string - sort_on_compaction: - type: boolean - oe_mutability: - type: string - ie_mutability: - type: string - type: object - BaseEdgeType_vertex_type_pair_relations_inner: - properties: - source_vertex: - type: string - destination_vertex: - type: string - relation: - enum: - - MANY_TO_MANY - - ONE_TO_MANY - - MANY_TO_ONE - - ONE_TO_ONE - type: string - x_csr_params: - $ref: '#/components/schemas/BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params' - type: object - SchemaMapping_loading_config_x_csr_params: - description: mutable_csr specific parameters - example: - parallelism: 0 - build_csr_in_mem: true - use_mmap_vector: true - properties: - parallelism: - type: integer - build_csr_in_mem: - type: boolean - use_mmap_vector: - type: boolean - type: object - SchemaMapping_loading_config_data_source: - example: - scheme: odps - location: location - properties: - scheme: - enum: - - odps - - file - type: string - location: - type: string - type: object - SchemaMapping_loading_config_format: - example: - metadata: - key: "" - type: type - properties: - type: - type: string - metadata: - additionalProperties: true - type: object - type: object - SchemaMapping_loading_config: - example: - x_csr_params: - parallelism: 0 - build_csr_in_mem: true - use_mmap_vector: true - format: - metadata: - key: "" - type: type - import_option: init - data_source: - scheme: odps - location: location - properties: - x_csr_params: - $ref: '#/components/schemas/SchemaMapping_loading_config_x_csr_params' - data_source: - $ref: '#/components/schemas/SchemaMapping_loading_config_data_source' - import_option: - enum: - - init - - overwrite - type: string - format: - $ref: '#/components/schemas/SchemaMapping_loading_config_format' - type: object - EdgeMapping_type_triplet: - description: "source label -> [edge label] -> destination label" - example: - edge: edge - source_vertex: source_vertex - destination_vertex: destination_vertex - properties: - edge: - type: string - source_vertex: - type: string - destination_vertex: - type: string - type: object - EdgeMapping_source_vertex_mappings_inner_column: - example: - name: name - index: 6 - properties: - index: - format: int32 - type: integer - name: - type: string - type: object - EdgeMapping_source_vertex_mappings_inner: - description: Mapping column to the primary key of source vertex - example: - column: - name: name - index: 6 - property: id - properties: - column: - $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner_column' - property: - example: id - type: string - type: object - EdgeMapping_destination_vertex_mappings_inner: - description: Mapping column to the primary key of destination vertex - example: - column: - name: name - index: 6 - property: id - properties: - column: - $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner_column' - property: - example: id - type: string - type: object diff --git a/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java b/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java deleted file mode 100644 index a9bd70bc0224..000000000000 --- a/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.alibaba.graphscope.groot; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class OpenApiGeneratorApplicationTests { - - @Test - void contextLoads() { - } - -} \ No newline at end of file From fb71533a1d7cfe5d3ab070588c413fbe269dbbdb Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Wed, 8 Jan 2025 11:17:16 +0800 Subject: [PATCH 14/23] minor refine Committed-by: bingqing.lbq from Dev container --- .gitignore | 3 +++ .../groot/OpenApiGeneratorApplicationTests.java | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java diff --git a/.gitignore b/.gitignore index bf8773ee2638..07f98b1ac2f0 100644 --- a/.gitignore +++ b/.gitignore @@ -159,6 +159,9 @@ flex/interactive/sdk/python/gs_interactive/rest.py interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/ interactive_engine/groot-http/.openapi-generator/ +interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/*.java +interactive_engine/groot-http/src/main/java/org/ +interactive_engine/groot-http/src/main/resources/ **/.cache/ diff --git a/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java b/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..a9bd70bc0224 --- /dev/null +++ b/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package com.alibaba.graphscope.groot; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file From 8a5d048d833ebc46ca6e05250e1570976196331a Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Wed, 8 Jan 2025 17:03:18 +0800 Subject: [PATCH 15/23] refine openapi: 1) seperate batch operations; 2) add a addVerticesEdges api; 3) other minor refine Committed-by: bingqing.lbq from Dev container --- flex/openapi/openapi_interactive.yaml | 558 ++++++++++++++++++++++++-- 1 file changed, 519 insertions(+), 39 deletions(-) diff --git a/flex/openapi/openapi_interactive.yaml b/flex/openapi/openapi_interactive.yaml index 920174c9363a..47b1a0cc9dcb 100644 --- a/flex/openapi/openapi_interactive.yaml +++ b/flex/openapi/openapi_interactive.yaml @@ -875,9 +875,7 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/VertexRequest' + $ref: '#/components/schemas/VertexRequest' example: - label: "person" primary_key_values: @@ -1010,16 +1008,204 @@ paths: content: application/json: schema: - type: object - properties: - label: - type: string - description: The label name of the vertex to delete. - primary_key_values: - type: array - description: The primary key values for locating the vertex. - items: - $ref: '#/components/schemas/Property' + $ref: '#/components/schemas/DeleteVertexRequest' + responses: + '200': + description: Successfully delete vertex + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + example: + message: "Successfully delete vertex" + '400': + description: Invalid input vertex + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 101 + message: "Invalid input vertex schema" + '404': + description: Vertex not exists or Graph not exits. + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 4 + message: "Vertex not exists" + '500': + description: Server internal error + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 103 + message: "Internal error" + + /v1/graph/{graph_id}/vertex/bulk: + post: + tags: + - GraphService/VertexManagement + summary: Add vertex to the graph + operationId: add_vertices + parameters: + - name: graph_id + in : path + required: true + schema: + type: string + description: | + Add the provided vertex to the specified graph. + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VertexRequest' + example: + - label: "person" + primary_key_values: + id: 2 + properties: + age: 24 + name: "Cindy" + + responses: + '200': + description: Successfully created vertex + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + example: + message: "Successfully created vertex" + '400': + description: Invalid input vertex + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 101 + message: "Invalid input vertex schema" + '404': + description: Graph not found + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 4 + message: "Graph not found" + '409': + description: Vertex already exists + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 102 + message: "Vertex already exists" + '500': + description: Server internal error + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 103 + message: "Internal error" + put: + tags: + - GraphService/VertexManagement + summary: Update vertex's property + operationId: update_vertices + description: | + Remove the vertex from the specified graph. + parameters: + - name: graph_id + in : path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VertexRequest' + example: + - label: "person" + primary_key_values: + id: 2 + properties: + age: 24 + name: "Cindy" + responses: + '200': + description: Successfully update vertex + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + example: + message: "Successfully updated vertex" + '400': + description: Invalid input parameters + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 101 + message: "Invalid input vertex schema" + '404': + description: Vertex not exists + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 4 + message: "Vertex not exists" + '500': + description: Server internal error + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 103 + message: "Internal error" + delete: + tags: + - GraphService/VertexManagement + summary: Remove vertex from the graph + operationId: delete_vertices + description: | + Remove the vertex from the specified graph. + parameters: + - name: graph_id + in : path + required: true + schema: + type: string + requestBody: + description: The label and primary key values of the vertex to be deleted. + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeleteVertexRequest' responses: '200': description: Successfully delete vertex @@ -1203,9 +1389,7 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/EdgeRequest' + $ref: '#/components/schemas/EdgeRequest' example: - src_label: "person" dst_label: "software" @@ -1301,30 +1485,202 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/DeleteEdgeRequest' + responses: + '200': + description: Successfully delete edge + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + example: + message: "Successfully delete edge" + '400': + description: Invalid input edge + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 101 + message: "Invalid input edge schema" + '404': + description: Edge not exists or Graph not exits + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 4 + message: "Edge not exists" + '500': + description: Server internal error + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 103 + message: "Internal error" + + /v1/graph/{graph_id}/edge/bulk: + post: + tags: + - GraphService/EdgeManagement + summary: Add edge to the graph + operationId: add_edges + description: | + Add the edge to graph. + parameters: + - name: graph_id + in : path + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EdgeRequest' + example: + - src_label: "person" + dst_label: "software" + edge_label: "created" + src_pk_name: "id" + src_pk_value: 1 + dst_pk_name: "id" + dst_pk_value: 3 + properties: + - name: "weight" + value: 0.2 + responses: + '200': + description: Successfully insert the edge + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + example: + message: "Successfuly create edge" + '400': + description: Invalid input edge + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 101 + message: "Invalid input edge schema" + '409': + description: edge already exists + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 102 + message: "Edge already exists" + '500': + description: Server internal error + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 103 + message: "Internal error" + put: + tags: + - GraphService/EdgeManagement + summary: Update edge's property + operationId: update_edges + description: | + Update the edge on the running graph. + parameters: + - name: graph_id + in : path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EdgeRequest' + example: + src_label: "person" + dst_label: "software" + edge_label: "created" + src_pk_name: "id" + src_pk_value: 1 + dst_pk_name: "id" + dst_pk_value: 3 properties: - edge_label: - type: string - description: The label name of the edge. - example: created - src_label: - type: string - description: The label name of the source vertex. - example: person - dst_label: - type: string - description: The label name of the destination vertex. - example: software - src_primary_key_values: - type: array - description: Primary key values for the source vertex. - items: - $ref: '#/components/schemas/Property' - dst_primary_key_values: - type: array - description: Primary key values for the destination vertex. - items: - $ref: '#/components/schemas/Property' + - name: "weight" + value: 0.3 + responses: + '200': + description: Successfully update edge + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + example: + message: "Successfully update edge" + '400': + description: Invalid input parameters + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 101 + message: "Invalid input edge schema" + '404': + description: Edge not exists + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 4 + message: "Edge not exists" + '500': + description: Server internal error + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 103 + message: "Internal error" + delete: + tags: + - GraphService/EdgeManagement + summary: Remove edge from the graph + operationId: delete_edges + description: | + Remove the edge from current graph. + parameters: + - name: graph_id + in : path + required: true + schema: + type: string + requestBody: + description: The label and primary key values of the src and dst vertices, and the edge label. + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeleteEdgeRequest' responses: '200': description: Successfully delete edge @@ -1361,6 +1717,91 @@ paths: example: code: 103 message: "Internal error" + + /v1/graph/{graph_id}/vertex-edge/bulk: + post: + tags: + - GraphService/VertexManagement + summary: Add vertex and/or edge to the graph + operationId: add_vertices_edges + parameters: + - name: graph_id + in : path + required: true + schema: + type: string + description: | + Add the provided vertex to the specified graph. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/VertexEdgeRequest' + example: + vertex_request: + - label: "person" + primary_key_value: 2 + properties: + age: 24 + name: "Cindy" + edge_request: + - src_label: "person" + dst_label: "software" + edge_label: "created" + src_pk_name: "id" + src_pk_value: 1 + dst_pk_name: "id" + dst_pk_value: 3 + properties: + - name: "weight" + value: 0.2 + responses: + '200': + description: Successfully created vertex + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + example: + message: "Successfully created vertex" + '400': + description: Invalid input vertex + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 101 + message: "Invalid input vertex schema" + '404': + description: Graph not found + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 4 + message: "Graph not found" + '409': + description: Vertex already exists + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 102 + message: "Vertex already exists" + '500': + description: Server internal error + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponseWithCode' + example: + code: 103 + message: "Internal error" + /v1/graph/{graph_id}/query: post: tags: @@ -1686,6 +2127,19 @@ components: type: array items: $ref: '#/components/schemas/Property' + DeleteVertexRequest: + x-body-name: delete_vertex_request + type: object + properties: + label: + type: string + description: The label name of the vertex. + example: person + primary_key_values: + type: array + description: Primary key values for the vertex. + items: + $ref: '#/components/schemas/Property' VertexData: x-body-name: vertex_data type: object @@ -1758,6 +2212,32 @@ components: type: array items: $ref: '#/components/schemas/Property' + DeleteEdgeRequest: + x-body-name: delete_edge_request + type: object + properties: + edge_label: + type: string + description: The label name of the edge. + example: created + src_label: + type: string + description: The label name of the source vertex. + example: person + dst_label: + type: string + description: The label name of the destination vertex. + example: software + src_primary_key_values: + type: array + description: Primary key values for the source vertex. + items: + $ref: '#/components/schemas/Property' + dst_primary_key_values: + type: array + description: Primary key values for the destination vertex. + items: + $ref: '#/components/schemas/Property' QueryRequest: x-body-name: query_request type: object From 4f2eba1b7e9d1d240a0c8a967dd47be4587db8f3 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Wed, 8 Jan 2025 17:04:30 +0800 Subject: [PATCH 16/23] refine implementations for batch operations etc. Committed-by: bingqing.lbq from Dev container --- flex/openapi/openapi_interactive.yaml | 28 ++-- .../groot/service/api/V1ApiController.java | 129 ++++++++++++++++-- .../groot/service/impl/DtoConverter.java | 21 +-- .../service/impl/EdgeManagementService.java | 25 +++- .../service/impl/VertexManagementService.java | 55 ++++++-- 5 files changed, 205 insertions(+), 53 deletions(-) diff --git a/flex/openapi/openapi_interactive.yaml b/flex/openapi/openapi_interactive.yaml index 47b1a0cc9dcb..57b7dfdd58f8 100644 --- a/flex/openapi/openapi_interactive.yaml +++ b/flex/openapi/openapi_interactive.yaml @@ -935,7 +935,7 @@ paths: summary: Update vertex's property operationId: update_vertex description: | - Remove the vertex from the specified graph. + Update the vertex with the provided properties to the specified graph. parameters: - name: graph_id in : path @@ -1050,7 +1050,7 @@ paths: post: tags: - GraphService/VertexManagement - summary: Add vertex to the graph + summary: Add a batch of vertices to the graph operationId: add_vertices parameters: - name: graph_id @@ -1059,7 +1059,7 @@ paths: schema: type: string description: | - Add the provided vertex to the specified graph. + Add the provided vertices to the specified graph. requestBody: required: true content: @@ -1124,10 +1124,10 @@ paths: put: tags: - GraphService/VertexManagement - summary: Update vertex's property + summary: Update vertices' properties operationId: update_vertices description: | - Remove the vertex from the specified graph. + Update the vertices with the provided properties to the specified graph. parameters: - name: graph_id in : path @@ -1187,10 +1187,10 @@ paths: delete: tags: - GraphService/VertexManagement - summary: Remove vertex from the graph + summary: Remove vertices from the graph operationId: delete_vertices description: | - Remove the vertex from the specified graph. + Remove the vertices from the specified graph. parameters: - name: graph_id in : path @@ -1527,10 +1527,10 @@ paths: post: tags: - GraphService/EdgeManagement - summary: Add edge to the graph + summary: Add a batch of edges to the graph operationId: add_edges description: | - Add the edge to graph. + Add the edges to graph. parameters: - name: graph_id in : path @@ -1595,10 +1595,10 @@ paths: put: tags: - GraphService/EdgeManagement - summary: Update edge's property + summary: Update edges' properties operationId: update_edges description: | - Update the edge on the running graph. + Update the edges on the running graph. parameters: - name: graph_id in : path @@ -1662,10 +1662,10 @@ paths: delete: tags: - GraphService/EdgeManagement - summary: Remove edge from the graph + summary: Remove edges from the graph operationId: delete_edges description: | - Remove the edge from current graph. + Remove the edges from current graph. parameters: - name: graph_id in : path @@ -1722,7 +1722,7 @@ paths: post: tags: - GraphService/VertexManagement - summary: Add vertex and/or edge to the graph + summary: Add vertices and edges to the graph operationId: add_vertices_edges parameters: - name: graph_id diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java index 831114981651..17dfb544cee3 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java @@ -1,5 +1,7 @@ package com.alibaba.graphscope.groot.service.api; +import com.alibaba.graphscope.groot.sdk.schema.Edge; +import com.alibaba.graphscope.groot.sdk.schema.Vertex; import com.alibaba.graphscope.groot.service.impl.EdgeManagementService; import com.alibaba.graphscope.groot.service.impl.SchemaManagementService; import com.alibaba.graphscope.groot.service.impl.VertexManagementService; @@ -10,10 +12,16 @@ import com.alibaba.graphscope.groot.service.models.DeleteVertexRequest; import com.alibaba.graphscope.groot.service.models.EdgeRequest; import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; +import com.alibaba.graphscope.groot.service.models.VertexEdgeRequest; import com.alibaba.graphscope.groot.service.models.VertexRequest; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.ParameterIn; + import java.util.List; +import javax.validation.Valid; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -24,6 +32,7 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -49,12 +58,9 @@ public V1ApiController(VertexManagementService vertexService, EdgeManagementServ @PostMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity addVertex( @PathVariable("graph_id") String graphId, - @RequestBody @Validated List vertexRequests) { + @RequestBody @Validated VertexRequest vertexRequest) { try { - if (vertexRequests.isEmpty()) { - return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Vertex request must not be empty"); - } - long si = vertexManagementService.addVertices(vertexRequests); + long si = vertexManagementService.addVertex(vertexRequest); return ApiUtil.createSuccessResponse("Vertex added successfully", si); } catch (Exception e) { e.printStackTrace(); @@ -68,8 +74,7 @@ public ResponseEntity deleteVertex( @PathVariable("graph_id") String graphId, @RequestBody(required = true) DeleteVertexRequest deleteVertexRequest) { try { - long si = vertexManagementService.deleteVertex(deleteVertexRequest.getLabel(), - deleteVertexRequest.getPrimaryKeyValues()); + long si = vertexManagementService.deleteVertex(deleteVertexRequest); return ApiUtil.createSuccessResponse("Vertex deleted successfully", si); } catch (Exception e) { e.printStackTrace(); @@ -94,16 +99,56 @@ public ResponseEntity updateVertex( } } + + @Override + @PostMapping(value = "/{graph_id}/vertex/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity addVertices( + @PathVariable("graph_id") String graphId, + @RequestBody(required = true) List vertexRequest) { + try { + long si = vertexManagementService.addVertices(vertexRequest); + return ApiUtil.createSuccessResponse("Vertices added successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertices"); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/vertex/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteVertices( + @PathVariable("graph_id") String graphId, + @RequestBody(required = true) List deleteVertexRequest) { + try { + long si = vertexManagementService.deleteVertices(deleteVertexRequest); + return ApiUtil.createSuccessResponse("Vertices deleted successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertices"); + } + } + + @Override + @PutMapping(value = "/{graph_id}/vertex/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateVertices( + @PathVariable("graph_id") String graphId, + @RequestBody(required = false) List vertexRequest) { + try { + long si = vertexManagementService.updateVertices(vertexRequest); + return ApiUtil.createSuccessResponse("Vertices updated successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertices"); + } + } + @Override @PostMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity addEdge( @PathVariable("graph_id") String graphId, - @RequestBody @Validated List edgeRequests) { + @RequestBody @Validated EdgeRequest edgeRequest) { try { - if (edgeRequests.isEmpty()) { - return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Edge request must not be empty"); - } - long si = edgeManagementService.addEdges(edgeRequests); + long si = edgeManagementService.addEdge(edgeRequest); return ApiUtil.createSuccessResponse("Edge added successfully", si); } catch (Exception e) { e.printStackTrace(); @@ -117,9 +162,7 @@ public ResponseEntity deleteEdge( @PathVariable("graph_id") String graphId, @RequestBody(required = true) DeleteEdgeRequest deleteEdgeRequest) { try { - long si = edgeManagementService.deleteEdge(deleteEdgeRequest.getEdgeLabel(), - deleteEdgeRequest.getSrcLabel(), deleteEdgeRequest.getDstLabel(), - deleteEdgeRequest.getSrcPrimaryKeyValues(), deleteEdgeRequest.getDstPrimaryKeyValues()); + long si = edgeManagementService.deleteEdge(deleteEdgeRequest); return ApiUtil.createSuccessResponse("Edge deleted successfully", si); } catch (Exception e) { e.printStackTrace(); @@ -144,6 +187,62 @@ public ResponseEntity updateEdge( } } + @Override + @PostMapping(value = "/{graph_id}/edge/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity addEdges( + @PathVariable("graph_id") String graphId, + @RequestBody(required = true) List edgeRequest) { + try { + long si = edgeManagementService.addEdges(edgeRequest); + return ApiUtil.createSuccessResponse("Edges added successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add edges"); + } + } + + @Override + @DeleteMapping(value = "/{graph_id}/edge/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteEdges( + @PathVariable("graph_id") String graphId, + @RequestBody(required = true) List deleteEdgeRequest) { + try { + long si = edgeManagementService.deleteEdges(deleteEdgeRequest); + return ApiUtil.createSuccessResponse("Edges deleted successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edges"); + } + } + + @Override + @PutMapping(value = "/{graph_id}/edge/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateEdges( + @PathVariable("graph_id") String graphId, + @RequestBody(required = false) List edgeRequest) { + try { + long si = edgeManagementService.updateEdges(edgeRequest); + return ApiUtil.createSuccessResponse("Edges updated successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edges"); + } + } + + @Override + @PostMapping(value = "/{graph_id}/vertex-edge/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity addVerticesEdges( + @PathVariable("graph_id") String graphId, + @RequestBody @Valid VertexEdgeRequest vertexEdgeRequest) { + try { + long si = vertexManagementService.addVerticesAndEdges(vertexEdgeRequest); + return ApiUtil.createSuccessResponse("Vertices and edges added successfully", si); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertices and edges"); + } + } + @Override @PostMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity createVertexType( diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java index 80f2325454e8..5ef356806e49 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java @@ -29,6 +29,8 @@ import com.alibaba.graphscope.groot.service.models.VertexRequest; import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; import com.alibaba.graphscope.groot.service.models.DateType; +import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; +import com.alibaba.graphscope.groot.service.models.DeleteVertexRequest; import com.alibaba.graphscope.proto.groot.DataTypePb; import com.alibaba.graphscope.proto.groot.GraphDefPb; @@ -41,9 +43,10 @@ public static Vertex convertToVertex(VertexRequest vertexRequest) { return new Vertex(label, propertyMap); } - public static Vertex convertToVertex(String label, List pkValues) { - Map propertyMap = convertToPropertyMap(pkValues); - return new Vertex(label, propertyMap); + public static Vertex convertToVertex(DeleteVertexRequest deleteVertexRequest) { + String label = deleteVertexRequest.getLabel(); + Map primaryKeyValues = convertToPropertyMap(deleteVertexRequest.getPrimaryKeyValues()); + return new Vertex(label, primaryKeyValues); } public static Edge convertToEdge(EdgeRequest edgeRequest) { @@ -56,11 +59,13 @@ public static Edge convertToEdge(EdgeRequest edgeRequest) { return new Edge(label, srcLabel, dstLabel, srcPkMap, dstPkMap, propertyMap); } - public static Edge convertToEdge(String edgeLabel, String srcLabel, String dstLabel, List srcPkValues, - List dstPkValues) { - Map srcPkMap = convertToPropertyMap(srcPkValues); - Map dstPkMap = convertToPropertyMap(dstPkValues); - return new Edge(edgeLabel, srcLabel, dstLabel, srcPkMap, dstPkMap); + public static Edge convertToEdge(DeleteEdgeRequest deleteEdgeRequest) { + String label = deleteEdgeRequest.getEdgeLabel(); + String srcLabel = deleteEdgeRequest.getSrcLabel(); + String dstLabel = deleteEdgeRequest.getDstLabel(); + Map srcPkMap = convertToPropertyMap(deleteEdgeRequest.getSrcPrimaryKeyValues()); + Map dstPkMap = convertToPropertyMap(deleteEdgeRequest.getDstPrimaryKeyValues()); + return new Edge(label, srcLabel, dstLabel, srcPkMap, dstPkMap); } public static DataTypePb convertToDataTypePb(GSDataType dataType) { diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java index f5803681d245..cd085ea23623 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java @@ -8,8 +8,8 @@ import com.alibaba.graphscope.groot.sdk.GrootClient; import com.alibaba.graphscope.groot.sdk.schema.Edge; +import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; import com.alibaba.graphscope.groot.service.models.EdgeRequest; -import com.alibaba.graphscope.groot.service.models.Property; @Service public class EdgeManagementService { @@ -38,17 +38,34 @@ public long addEdges(List edgeRequests) { } } - public long deleteEdge(String edgeLabel, String srcLabel, String dstLabel, List srcPkValues, - List dstPkValues) { - Edge edge = DtoConverter.convertToEdge(edgeLabel, srcLabel, dstLabel, srcPkValues, dstPkValues); + public long deleteEdge(DeleteEdgeRequest deleteEdgeRequest) { + Edge edge = DtoConverter.convertToEdge(deleteEdgeRequest); // TODO: deleteEdge will only delete the first edge that matches the given parameters // e.g., if we have multiple edges from v1 to v2 with the same edge label, only one of them will be deleted return grootClient.deleteEdge(edge); } + public long deleteEdges(List edgeRequests) { + List edges = new ArrayList<>(); + for (DeleteEdgeRequest edgeRequest : edgeRequests) { + Edge edge = DtoConverter.convertToEdge(edgeRequest); + edges.add(edge); + } + return grootClient.deleteEdges(edges); + } + public long updateEdge(EdgeRequest edgeRequest) { Edge edge = DtoConverter.convertToEdge(edgeRequest); // TODO: updateEdge will add a new edge even if it already exists return grootClient.updateEdge(edge); } + + public long updateEdges(List edgeRequests) { + List edges = new ArrayList<>(); + for (EdgeRequest edgeRequest : edgeRequests) { + Edge edge = DtoConverter.convertToEdge(edgeRequest); + edges.add(edge); + } + return grootClient.updateEdges(edges); + } } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java index b7bd268b1c37..722e6d301ffa 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java @@ -7,8 +7,11 @@ import org.springframework.stereotype.Service; import com.alibaba.graphscope.groot.sdk.GrootClient; +import com.alibaba.graphscope.groot.sdk.schema.Edge; import com.alibaba.graphscope.groot.sdk.schema.Vertex; -import com.alibaba.graphscope.groot.service.models.Property; +import com.alibaba.graphscope.groot.service.models.DeleteVertexRequest; +import com.alibaba.graphscope.groot.service.models.EdgeRequest; +import com.alibaba.graphscope.groot.service.models.VertexEdgeRequest; import com.alibaba.graphscope.groot.service.models.VertexRequest; @Service @@ -27,26 +30,54 @@ public long addVertex(VertexRequest vertexRequest) { } public long addVertices(List vertexRequests) { - if (vertexRequests.size() == 1) { - return addVertex(vertexRequests.get(0)); - } else { - List vertices = new ArrayList<>(); - for (VertexRequest vertexRequest : vertexRequests) { - Vertex vertex = DtoConverter.convertToVertex(vertexRequest); - vertices.add(vertex); - } - return grootClient.addVertices(vertices); + List vertices = new ArrayList<>(); + for (VertexRequest vertexRequest : vertexRequests) { + Vertex vertex = DtoConverter.convertToVertex(vertexRequest); + vertices.add(vertex); } + return grootClient.addVertices(vertices); } - public long deleteVertex(String label, List properties) { - Vertex vertex = DtoConverter.convertToVertex(label, properties); + public long deleteVertex(DeleteVertexRequest deleteVertexRequest) { + Vertex vertex = DtoConverter.convertToVertex(deleteVertexRequest); return grootClient.deleteVertex(vertex); } + public long deleteVertices(List deleteVertexRequests) { + List vertices = new ArrayList<>(); + for (DeleteVertexRequest deleteVertexRequest : deleteVertexRequests) { + Vertex vertex = DtoConverter.convertToVertex(deleteVertexRequest); + vertices.add(vertex); + } + return grootClient.deleteVertices(vertices); + } + public long updateVertex(VertexRequest vertexRequest) { Vertex vertex = DtoConverter.convertToVertex(vertexRequest); return grootClient.updateVertex(vertex); } + public long updateVertices(List vertexRequests) { + List vertices = new ArrayList<>(); + for (VertexRequest vertexRequest : vertexRequests) { + Vertex vertex = DtoConverter.convertToVertex(vertexRequest); + vertices.add(vertex); + } + return grootClient.updateVertices(vertices); + } + + public long addVerticesAndEdges(VertexEdgeRequest vertexEdgeRequest) { + List vertices = new ArrayList<>(); + for (VertexRequest vertexRequest : vertexEdgeRequest.getVertexRequest()) { + Vertex vertex = DtoConverter.convertToVertex(vertexRequest); + vertices.add(vertex); + } + List edges = new ArrayList<>(); + for (EdgeRequest edgeRequest : vertexEdgeRequest.getEdgeRequest()) { + Edge edge = DtoConverter.convertToEdge(edgeRequest); + edges.add(edge); + } + return grootClient.addVerticesAndEdges(vertices, edges); + } + } \ No newline at end of file From c2556b5f03c9bb061011bc36f28f58befb7df141 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Wed, 8 Jan 2025 19:55:39 +0800 Subject: [PATCH 17/23] add a remoteFlush api to check the si's availability Committed-by: bingqing.lbq from Dev container --- flex/openapi/openapi_interactive.yaml | 29 +++++++++++++++++++ .../groot/service/api/V1ApiController.java | 15 ++++++++++ .../service/impl/VertexManagementService.java | 4 +++ 3 files changed, 48 insertions(+) diff --git a/flex/openapi/openapi_interactive.yaml b/flex/openapi/openapi_interactive.yaml index 57b7dfdd58f8..c44cad5b82c4 100644 --- a/flex/openapi/openapi_interactive.yaml +++ b/flex/openapi/openapi_interactive.yaml @@ -407,6 +407,35 @@ paths: $ref: "#/components/responses/400" 500: $ref: "#/components/responses/500" + + /v1/graph/{graph_id}/flush: + post: + tags: + - AdminService/GraphManagement + description: Flush Snapshot Id to see if it becomes available + operationId: remoteFlush + parameters: + - name: graph_id + in: path + required: true + schema: + type: string + - name: snapshot_id + in: query + required: true + schema: + type: long + responses: + '200': + description: Successful flush snapshot id, return if the snapshot id becomes available + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + '400': + $ref: "#/components/responses/400" + '500': + $ref: "#/components/responses/500" /v1/graph/{graph_id}/statistics: get: diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java index 17dfb544cee3..bdf4828d83c1 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java @@ -369,4 +369,19 @@ public ResponseEntity deleteSchema( } } + + @Override + @PostMapping(value = "/{graph_id}/flush", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity remoteFlush( + @PathVariable("graph_id") String graphId, + @RequestParam(value = "snapshot_id", required = true) Long snapshotId) { + try { + boolean res = vertexManagementService.remoteFlush(snapshotId); + return ApiUtil.createSuccessResponse("Snapshot flushed successfully: " + res, snapshotId.longValue()); + } catch (Exception e) { + e.printStackTrace(); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to flush snapshot"); + } + } + } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java index 722e6d301ffa..f25a2940d2b4 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java @@ -80,4 +80,8 @@ public long addVerticesAndEdges(VertexEdgeRequest vertexEdgeRequest) { return grootClient.addVerticesAndEdges(vertices, edges); } + + public boolean remoteFlush(long snapshotId) { + return grootClient.remoteFlush(snapshotId); + } } \ No newline at end of file From bea9a189e785e943d91f17a6c2034cf45d3856ee Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Thu, 9 Jan 2025 14:55:12 +0800 Subject: [PATCH 18/23] refine apis: 1) only preserve batch apis; 2) support add vertices and edges in add_vertex Committed-by: bingqing.lbq from Dev container --- flex/openapi/openapi_interactive.yaml | 583 ++---------------- .../groot/service/api/V1ApiController.java | 186 ++---- .../service/impl/SchemaManagementService.java | 38 +- .../service/impl/VertexManagementService.java | 4 - 4 files changed, 112 insertions(+), 699 deletions(-) diff --git a/flex/openapi/openapi_interactive.yaml b/flex/openapi/openapi_interactive.yaml index c44cad5b82c4..739abe395cdd 100644 --- a/flex/openapi/openapi_interactive.yaml +++ b/flex/openapi/openapi_interactive.yaml @@ -155,34 +155,6 @@ paths: code: 103 message: "Internal error" /v1/graph/{graph_id}/schema: - post: - tags: - - AdminService/GraphManagement - summary: Import graph schema - operationId: import_schema - parameters: - - name: graph_id - in : path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateGraphSchemaRequest' - required: true - responses: - 200: - description: Successful imported the graph schema - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - 400: - $ref: "#/components/responses/400" - 500: - $ref: "#/components/responses/500" get: tags: - AdminService/GraphManagement @@ -204,27 +176,6 @@ paths: $ref: '#/components/schemas/GetGraphSchemaResponse' 500: $ref: "#/components/responses/500" - delete: - tags: - - AdminService/GraphManagement - description: Delete schema by graph id - operationId: delete_schema - parameters: - - name: graph_id - in : path - required: true - schema: - type: string - description: The id of graph to delete - responses: - 200: - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - 500: - $ref: "#/components/responses/500" /v1/graph/{graph_id}/schema/vertex: post: tags: @@ -408,12 +359,12 @@ paths: 500: $ref: "#/components/responses/500" - /v1/graph/{graph_id}/flush: + /v1/graph/{graph_id}/snapshot: post: tags: - AdminService/GraphManagement - description: Flush Snapshot Id to see if it becomes available - operationId: remoteFlush + description: test if the snapshot id is available + operationId: flush_snapshot_id parameters: - name: graph_id in: path @@ -436,6 +387,28 @@ paths: $ref: "#/components/responses/400" '500': $ref: "#/components/responses/500" + get: + tags: + - AdminService/GraphManagement + description: Get the latest snapshot id + operationId: get_snapshot_id + parameters: + - name: graph_id + in: path + required: true + schema: + type: string + responses: + '200': + description: Successful get snapshot id + content: + application/json: + schema: + type: long + '400': + $ref: "#/components/responses/400" + '500': + $ref: "#/components/responses/500" /v1/graph/{graph_id}/statistics: get: @@ -889,7 +862,7 @@ paths: post: tags: - GraphService/VertexManagement - summary: Add vertex to the graph + summary: Add vertex (and edge) to the graph operationId: add_vertex parameters: - name: graph_id @@ -898,21 +871,31 @@ paths: schema: type: string description: | - Add the provided vertex to the specified graph. + Add the provided vertex (and edge) to the specified graph. requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/VertexRequest' + $ref: '#/components/schemas/VertexEdgeRequest' example: + vertex_request: - label: "person" - primary_key_values: - id: 2 + primary_key_value: 2 properties: age: 24 name: "Cindy" - + edge_request: + - src_label: "person" + dst_label: "software" + edge_label: "created" + src_pk_name: "id" + src_pk_value: 1 + dst_pk_name: "id" + dst_pk_value: 3 + properties: + - name: "weight" + value: 0.2 responses: '200': description: Successfully created vertex @@ -975,7 +958,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/VertexRequest' + type: array + items: + $ref: '#/components/schemas/VertexRequest' example: label: "person" primary_key_value: 2 @@ -1031,201 +1016,6 @@ paths: required: true schema: type: string - requestBody: - description: The label and primary key values of the vertex to be deleted. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteVertexRequest' - responses: - '200': - description: Successfully delete vertex - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - example: - message: "Successfully delete vertex" - '400': - description: Invalid input vertex - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 101 - message: "Invalid input vertex schema" - '404': - description: Vertex not exists or Graph not exits. - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 4 - message: "Vertex not exists" - '500': - description: Server internal error - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 103 - message: "Internal error" - - /v1/graph/{graph_id}/vertex/bulk: - post: - tags: - - GraphService/VertexManagement - summary: Add a batch of vertices to the graph - operationId: add_vertices - parameters: - - name: graph_id - in : path - required: true - schema: - type: string - description: | - Add the provided vertices to the specified graph. - requestBody: - required: true - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/VertexRequest' - example: - - label: "person" - primary_key_values: - id: 2 - properties: - age: 24 - name: "Cindy" - - responses: - '200': - description: Successfully created vertex - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - example: - message: "Successfully created vertex" - '400': - description: Invalid input vertex - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 101 - message: "Invalid input vertex schema" - '404': - description: Graph not found - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 4 - message: "Graph not found" - '409': - description: Vertex already exists - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 102 - message: "Vertex already exists" - '500': - description: Server internal error - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 103 - message: "Internal error" - put: - tags: - - GraphService/VertexManagement - summary: Update vertices' properties - operationId: update_vertices - description: | - Update the vertices with the provided properties to the specified graph. - parameters: - - name: graph_id - in : path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/VertexRequest' - example: - - label: "person" - primary_key_values: - id: 2 - properties: - age: 24 - name: "Cindy" - responses: - '200': - description: Successfully update vertex - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - example: - message: "Successfully updated vertex" - '400': - description: Invalid input parameters - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 101 - message: "Invalid input vertex schema" - '404': - description: Vertex not exists - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 4 - message: "Vertex not exists" - '500': - description: Server internal error - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 103 - message: "Internal error" - delete: - tags: - - GraphService/VertexManagement - summary: Remove vertices from the graph - operationId: delete_vertices - description: | - Remove the vertices from the specified graph. - parameters: - - name: graph_id - in : path - required: true - schema: - type: string requestBody: description: The label and primary key values of the vertex to be deleted. required: true @@ -1413,159 +1203,6 @@ paths: example: code: 103 message: "Internal error" - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/EdgeRequest' - example: - - src_label: "person" - dst_label: "software" - edge_label: "created" - src_pk_name: "id" - src_pk_value: 1 - dst_pk_name: "id" - dst_pk_value: 3 - properties: - - name: "weight" - value: 0.2 - put: - tags: - - GraphService/EdgeManagement - summary: Update edge's property - operationId: update_edge - description: | - Update the edge on the running graph. - parameters: - - name: graph_id - in : path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EdgeRequest' - example: - src_label: "person" - dst_label: "software" - edge_label: "created" - src_pk_name: "id" - src_pk_value: 1 - dst_pk_name: "id" - dst_pk_value: 3 - properties: - - name: "weight" - value: 0.3 - responses: - '200': - description: Successfully update edge - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - example: - message: "Successfully update edge" - '400': - description: Invalid input parameters - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 101 - message: "Invalid input edge schema" - '404': - description: Edge not exists - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 4 - message: "Edge not exists" - '500': - description: Server internal error - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 103 - message: "Internal error" - delete: - tags: - - GraphService/EdgeManagement - summary: Remove edge from the graph - operationId: delete_edge - description: | - Remove the edge from current graph. - parameters: - - name: graph_id - in : path - required: true - schema: - type: string - requestBody: - description: The label and primary key values of the src and dst vertices, and the edge label. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteEdgeRequest' - responses: - '200': - description: Successfully delete edge - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - example: - message: "Successfully delete edge" - '400': - description: Invalid input edge - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 101 - message: "Invalid input edge schema" - '404': - description: Edge not exists or Graph not exits - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 4 - message: "Edge not exists" - '500': - description: Server internal error - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 103 - message: "Internal error" - - /v1/graph/{graph_id}/edge/bulk: - post: - tags: - - GraphService/EdgeManagement - summary: Add a batch of edges to the graph - operationId: add_edges - description: | - Add the edges to graph. - parameters: - - name: graph_id - in : path - required: true - schema: - type: string requestBody: required: true content: @@ -1585,49 +1222,13 @@ paths: properties: - name: "weight" value: 0.2 - responses: - '200': - description: Successfully insert the edge - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - example: - message: "Successfuly create edge" - '400': - description: Invalid input edge - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 101 - message: "Invalid input edge schema" - '409': - description: edge already exists - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 102 - message: "Edge already exists" - '500': - description: Server internal error - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 103 - message: "Internal error" put: tags: - GraphService/EdgeManagement - summary: Update edges' properties - operationId: update_edges + summary: Update edge's property + operationId: update_edge description: | - Update the edges on the running graph. + Update the edge on the running graph. parameters: - name: graph_id in : path @@ -1691,10 +1292,10 @@ paths: delete: tags: - GraphService/EdgeManagement - summary: Remove edges from the graph - operationId: delete_edges + summary: Remove edge from the graph + operationId: delete_edge description: | - Remove the edges from current graph. + Remove the edge from current graph. parameters: - name: graph_id in : path @@ -1746,90 +1347,6 @@ paths: example: code: 103 message: "Internal error" - - /v1/graph/{graph_id}/vertex-edge/bulk: - post: - tags: - - GraphService/VertexManagement - summary: Add vertices and edges to the graph - operationId: add_vertices_edges - parameters: - - name: graph_id - in : path - required: true - schema: - type: string - description: | - Add the provided vertex to the specified graph. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/VertexEdgeRequest' - example: - vertex_request: - - label: "person" - primary_key_value: 2 - properties: - age: 24 - name: "Cindy" - edge_request: - - src_label: "person" - dst_label: "software" - edge_label: "created" - src_pk_name: "id" - src_pk_value: 1 - dst_pk_name: "id" - dst_pk_value: 3 - properties: - - name: "weight" - value: 0.2 - responses: - '200': - description: Successfully created vertex - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - example: - message: "Successfully created vertex" - '400': - description: Invalid input vertex - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 101 - message: "Invalid input vertex schema" - '404': - description: Graph not found - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 4 - message: "Graph not found" - '409': - description: Vertex already exists - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 102 - message: "Vertex already exists" - '500': - description: Server internal error - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponseWithCode' - example: - code: 103 - message: "Internal error" /v1/graph/{graph_id}/query: post: diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java index bdf4828d83c1..049c22888820 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java @@ -1,12 +1,11 @@ package com.alibaba.graphscope.groot.service.api; -import com.alibaba.graphscope.groot.sdk.schema.Edge; -import com.alibaba.graphscope.groot.sdk.schema.Vertex; import com.alibaba.graphscope.groot.service.impl.EdgeManagementService; import com.alibaba.graphscope.groot.service.impl.SchemaManagementService; import com.alibaba.graphscope.groot.service.impl.VertexManagementService; import com.alibaba.graphscope.groot.service.models.CreateEdgeType; -import com.alibaba.graphscope.groot.service.models.CreateGraphSchemaRequest; +import com.alibaba.graphscope.groot.service.models.CreateGraphRequest; +import com.alibaba.graphscope.groot.service.models.CreateGraphResponse; import com.alibaba.graphscope.groot.service.models.CreateVertexType; import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; import com.alibaba.graphscope.groot.service.models.DeleteVertexRequest; @@ -15,9 +14,6 @@ import com.alibaba.graphscope.groot.service.models.VertexEdgeRequest; import com.alibaba.graphscope.groot.service.models.VertexRequest; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.enums.ParameterIn; - import java.util.List; import javax.validation.Valid; @@ -32,7 +28,6 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -58,65 +53,24 @@ public V1ApiController(VertexManagementService vertexService, EdgeManagementServ @PostMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity addVertex( @PathVariable("graph_id") String graphId, - @RequestBody @Validated VertexRequest vertexRequest) { + @RequestBody @Valid VertexEdgeRequest vertexEdgeRequest) { try { - long si = vertexManagementService.addVertex(vertexRequest); - return ApiUtil.createSuccessResponse("Vertex added successfully", si); + long si; + if (vertexEdgeRequest.getEdgeRequest() == null) { + si = vertexManagementService.addVertices(vertexEdgeRequest.getVertexRequest()); + } else { + si = vertexManagementService.addVerticesAndEdges(vertexEdgeRequest); + } + return ApiUtil.createSuccessResponse("Vertices and edges added successfully", si); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertex"); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertices and edges"); } } @Override @DeleteMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity deleteVertex( - @PathVariable("graph_id") String graphId, - @RequestBody(required = true) DeleteVertexRequest deleteVertexRequest) { - try { - long si = vertexManagementService.deleteVertex(deleteVertexRequest); - return ApiUtil.createSuccessResponse("Vertex deleted successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex"); - } - } - - @Override - @PutMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity updateVertex( - @PathVariable("graph_id") String graphId, - @RequestBody(required = false) VertexRequest vertexRequest) { - try { - if (vertexRequest == null) { - return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Request body must not be null"); - } - long si = vertexManagementService.updateVertex(vertexRequest); - return ApiUtil.createSuccessResponse("Vertex updated successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex"); - } - } - - - @Override - @PostMapping(value = "/{graph_id}/vertex/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity addVertices( - @PathVariable("graph_id") String graphId, - @RequestBody(required = true) List vertexRequest) { - try { - long si = vertexManagementService.addVertices(vertexRequest); - return ApiUtil.createSuccessResponse("Vertices added successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertices"); - } - } - - @Override - @DeleteMapping(value = "/{graph_id}/vertex/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteVertices( @PathVariable("graph_id") String graphId, @RequestBody(required = true) List deleteVertexRequest) { try { @@ -129,8 +83,8 @@ public ResponseEntity deleteVertices( } @Override - @PutMapping(value = "/{graph_id}/vertex/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity updateVertices( + @PutMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateVertex( @PathVariable("graph_id") String graphId, @RequestBody(required = false) List vertexRequest) { try { @@ -145,51 +99,6 @@ public ResponseEntity updateVertices( @Override @PostMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity addEdge( - @PathVariable("graph_id") String graphId, - @RequestBody @Validated EdgeRequest edgeRequest) { - try { - long si = edgeManagementService.addEdge(edgeRequest); - return ApiUtil.createSuccessResponse("Edge added successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add edge"); - } - } - - @Override - @DeleteMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteEdge( - @PathVariable("graph_id") String graphId, - @RequestBody(required = true) DeleteEdgeRequest deleteEdgeRequest) { - try { - long si = edgeManagementService.deleteEdge(deleteEdgeRequest); - return ApiUtil.createSuccessResponse("Edge deleted successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge"); - } - } - - @Override - @PutMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity updateEdge( - @PathVariable("graph_id") String graphId, - @RequestBody(required = false) EdgeRequest edgeRequest) { - try { - if (edgeRequest == null) { - return ApiUtil.createErrorResponse(HttpStatus.BAD_REQUEST, "Request body must not be null"); - } - long si = edgeManagementService.updateEdge(edgeRequest); - return ApiUtil.createSuccessResponse("Edge updated successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge"); - } - } - - @Override - @PostMapping(value = "/{graph_id}/edge/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity addEdges( @PathVariable("graph_id") String graphId, @RequestBody(required = true) List edgeRequest) { try { @@ -202,8 +111,8 @@ public ResponseEntity addEdges( } @Override - @DeleteMapping(value = "/{graph_id}/edge/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteEdges( + @DeleteMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteEdge( @PathVariable("graph_id") String graphId, @RequestBody(required = true) List deleteEdgeRequest) { try { @@ -216,8 +125,8 @@ public ResponseEntity deleteEdges( } @Override - @PutMapping(value = "/{graph_id}/edge/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity updateEdges( + @PutMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateEdge( @PathVariable("graph_id") String graphId, @RequestBody(required = false) List edgeRequest) { try { @@ -229,27 +138,13 @@ public ResponseEntity updateEdges( } } - @Override - @PostMapping(value = "/{graph_id}/vertex-edge/bulk", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity addVerticesEdges( - @PathVariable("graph_id") String graphId, - @RequestBody @Valid VertexEdgeRequest vertexEdgeRequest) { - try { - long si = vertexManagementService.addVerticesAndEdges(vertexEdgeRequest); - return ApiUtil.createSuccessResponse("Vertices and edges added successfully", si); - } catch (Exception e) { - e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertices and edges"); - } - } - @Override @PostMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity createVertexType( @PathVariable("graph_id") String graphId, @RequestBody @Validated CreateVertexType createVertexType) { try { - schemaManagementService.createVertexType(graphId, createVertexType); + schemaManagementService.createVertexType(createVertexType); return ApiUtil.createSuccessResponse("Vertex type created successfully"); } catch (Exception e) { e.printStackTrace(); @@ -263,7 +158,7 @@ public ResponseEntity deleteVertexTypeByName( @PathVariable("graph_id") String graphId, @RequestParam(value = "type_name", required = true) String typeName) { try { - schemaManagementService.deleteVertexType(graphId, typeName); + schemaManagementService.deleteVertexType(typeName); return ApiUtil.createSuccessResponse("Vertex type deleted successfully"); } catch (Exception e) { e.printStackTrace(); @@ -277,7 +172,7 @@ public ResponseEntity updateVertexType( @PathVariable("graph_id") String graphId, @RequestBody @Validated CreateVertexType updateVertexType) { try { - schemaManagementService.updateVertexType(graphId, updateVertexType); + schemaManagementService.updateVertexType(updateVertexType); return ApiUtil.createSuccessResponse("Vertex type updated successfully"); } catch (Exception e) { e.printStackTrace(); @@ -291,7 +186,7 @@ public ResponseEntity createEdgeType( @PathVariable("graph_id") String graphId, @RequestBody @Validated CreateEdgeType createEdgeType) { try { - schemaManagementService.createEdgeType(graphId, createEdgeType); + schemaManagementService.createEdgeType(createEdgeType); return ApiUtil.createSuccessResponse("Edge type created successfully"); } catch (Exception e) { e.printStackTrace(); @@ -307,7 +202,7 @@ public ResponseEntity deleteEdgeTypeByName( @RequestParam(value = "source_vertex_type", required = true) String sourceVertexType, @RequestParam(value = "destination_vertex_type", required = true) String destinationVertexType) { try { - schemaManagementService.deleteEdgeType(graphId, typeName, sourceVertexType, destinationVertexType); + schemaManagementService.deleteEdgeType(typeName, sourceVertexType, destinationVertexType); return ApiUtil.createSuccessResponse("Edge type deleted successfully"); } catch (Exception e) { e.printStackTrace(); @@ -321,7 +216,7 @@ public ResponseEntity updateEdgeType( @PathVariable("graph_id") String graphId, @RequestBody @Validated CreateEdgeType updateEdgeType) { try { - schemaManagementService.updateEdgeType(graphId, updateEdgeType); + schemaManagementService.updateEdgeType(updateEdgeType); return ApiUtil.createSuccessResponse("Edge type updated successfully"); } catch (Exception e) { e.printStackTrace(); @@ -330,16 +225,18 @@ public ResponseEntity updateEdgeType( } @Override - @PostMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity importSchema( - @PathVariable("graph_id") String graphId, - @RequestBody @Validated CreateGraphSchemaRequest createGraphSchemaRequest) { + @PostMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity createGraph( + @RequestBody @Validated CreateGraphRequest createGraphRequest) { try { - schemaManagementService.importSchema(graphId, createGraphSchemaRequest); - return ApiUtil.createSuccessResponse("Schema imported successfully"); + schemaManagementService.importSchema(createGraphRequest.getSchema()); + CreateGraphResponse response = new CreateGraphResponse(); + // a default graph id, since groot does not support multiple graphs + response.setGraphId("0"); + return ResponseEntity.status(HttpStatus.OK).body(response); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to import schema"); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null); } } @@ -348,7 +245,7 @@ public ResponseEntity importSchema( public ResponseEntity getSchema( @PathVariable("graph_id") String graphId) { try { - GetGraphSchemaResponse response = schemaManagementService.getSchema(graphId); + GetGraphSchemaResponse response = schemaManagementService.getSchema(); return ResponseEntity.status(HttpStatus.OK).body(response); } catch (Exception e) { e.printStackTrace(); @@ -357,26 +254,25 @@ public ResponseEntity getSchema( } @Override - @DeleteMapping(value = "/{graph_id}/schema", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteSchema( + @DeleteMapping(value = "/{graph_id}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteGraph( @PathVariable("graph_id") String graphId) { try { - schemaManagementService.dropSchema(graphId); - return ApiUtil.createSuccessResponse("Schema deleted successfully"); + schemaManagementService.dropSchema(); + return ApiUtil.createSuccessResponse("Graph schema deleted successfully"); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete schema"); + return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete graph"); } } - @Override - @PostMapping(value = "/{graph_id}/flush", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity remoteFlush( + @PostMapping(value = "/{graph_id}/snapshot", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity flushSnapshotId( @PathVariable("graph_id") String graphId, @RequestParam(value = "snapshot_id", required = true) Long snapshotId) { try { - boolean res = vertexManagementService.remoteFlush(snapshotId); + boolean res = schemaManagementService.remoteFlush(snapshotId); return ApiUtil.createSuccessResponse("Snapshot flushed successfully: " + res, snapshotId.longValue()); } catch (Exception e) { e.printStackTrace(); diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java index bdcd219635a0..0853577bedc1 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java @@ -32,35 +32,35 @@ public SchemaManagementService(GrootClient grootClient) { this.grootClient = grootClient; } - public void createVertexType(String graphId, CreateVertexType createVertexType) { - VertexLabel vLabelBuilder = createVertexLabel(graphId, createVertexType); + public void createVertexType(CreateVertexType createVertexType) { + VertexLabel vLabelBuilder = createVertexLabel(createVertexType); Schema.Builder schema = Schema.newBuilder(); schema.addVertexLabel(vLabelBuilder); grootClient.submitSchema(schema); } - public void deleteVertexType(String graphId, String vertexType) { + public void deleteVertexType( String vertexType) { VertexLabel.Builder vLabelBuilder = VertexLabel.newBuilder().setLabel(vertexType); Schema.Builder schema = Schema.newBuilder(); schema.dropVertexLabel(vLabelBuilder); grootClient.submitSchema(schema); } - public void updateVertexType(String graphId, CreateVertexType updateVertexType) { - VertexLabel vLabel = createVertexLabel(graphId, updateVertexType); + public void updateVertexType(CreateVertexType updateVertexType) { + VertexLabel vLabel = createVertexLabel( updateVertexType); Schema.Builder schema = Schema.newBuilder(); schema.addVertexLabelProperties(vLabel); grootClient.submitSchema(schema); } - public void createEdgeType(String graphId, CreateEdgeType createEdgeType) { - EdgeLabel eLabel = createEdgeLabel(graphId, createEdgeType); + public void createEdgeType( CreateEdgeType createEdgeType) { + EdgeLabel eLabel = createEdgeLabel( createEdgeType); Schema.Builder schema = Schema.newBuilder(); schema.addEdgeLabel(eLabel); grootClient.submitSchema(schema); } - public void deleteEdgeType(String graphId, String edgeType, String srcVertexType, String dstVertexType) { + public void deleteEdgeType(String edgeType, String srcVertexType, String dstVertexType) { // Delete edge relation, if it is the only relation, then delete edge label EdgeLabel.Builder eKindBuilder = EdgeLabel.newBuilder(); eKindBuilder.setLabel(edgeType); @@ -78,27 +78,27 @@ public void deleteEdgeType(String graphId, String edgeType, String srcVertexType } } - public void updateEdgeType(String graphId, CreateEdgeType updateEdgeType) { - EdgeLabel eLabel = createEdgeLabel(graphId, updateEdgeType); + public void updateEdgeType(CreateEdgeType updateEdgeType) { + EdgeLabel eLabel = createEdgeLabel( updateEdgeType); Schema.Builder schema = Schema.newBuilder(); schema.addEdgeLabelProperties(eLabel); grootClient.submitSchema(schema); } - public void importSchema(String graphId, CreateGraphSchemaRequest createSchema) { + public void importSchema(CreateGraphSchemaRequest createSchema) { Schema.Builder schema = Schema.newBuilder(); for (CreateVertexType vertexType : createSchema.getVertexTypes()) { - VertexLabel vLabel = createVertexLabel(graphId, vertexType); + VertexLabel vLabel = createVertexLabel(vertexType); schema.addVertexLabel(vLabel); } for (CreateEdgeType edgeType : createSchema.getEdgeTypes()) { - EdgeLabel eLabel = createEdgeLabel(graphId, edgeType); + EdgeLabel eLabel = createEdgeLabel( edgeType); schema.addEdgeLabel(eLabel); } grootClient.submitSchema(schema); } - public GetGraphSchemaResponse getSchema(String graphId) { + public GetGraphSchemaResponse getSchema() { Schema schema = Schema.fromGraphDef(grootClient.getSchema()); GetGraphSchemaResponse response = new GetGraphSchemaResponse(); for (VertexLabel vertex : schema.getVertexLabels()) { @@ -110,11 +110,11 @@ public GetGraphSchemaResponse getSchema(String graphId) { return response; } - public void dropSchema(String graphId) { + public void dropSchema() { grootClient.dropSchema(); } - private VertexLabel createVertexLabel(String graphId, CreateVertexType createVertexType) { + private VertexLabel createVertexLabel(CreateVertexType createVertexType) { VertexLabel.Builder vLabelBuilder = VertexLabel.newBuilder(); vLabelBuilder.setLabel(createVertexType.getTypeName()); List primaryKeys = createVertexType.getPrimaryKeys(); @@ -129,7 +129,7 @@ private VertexLabel createVertexLabel(String graphId, CreateVertexType createVer return vLabelBuilder.build(); } - private EdgeLabel createEdgeLabel(String graphId, CreateEdgeType createEdgeType) { + private EdgeLabel createEdgeLabel(CreateEdgeType createEdgeType) { EdgeLabel.Builder eLabelBuilder = EdgeLabel.newBuilder(); eLabelBuilder.setLabel(createEdgeType.getTypeName()); for (BaseEdgeTypeVertexTypePairRelationsInner pair : createEdgeType.getVertexTypePairRelations()) { @@ -142,4 +142,8 @@ private EdgeLabel createEdgeLabel(String graphId, CreateEdgeType createEdgeType) } return eLabelBuilder.build(); } + + public boolean remoteFlush(long snapshotId) { + return grootClient.remoteFlush(snapshotId); + } } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java index f25a2940d2b4..722e6d301ffa 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java @@ -80,8 +80,4 @@ public long addVerticesAndEdges(VertexEdgeRequest vertexEdgeRequest) { return grootClient.addVerticesAndEdges(vertices, edges); } - - public boolean remoteFlush(long snapshotId) { - return grootClient.remoteFlush(snapshotId); - } } \ No newline at end of file From 316a43da66bdaa45e7002fd21274c45a84620f0d Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Thu, 9 Jan 2025 15:10:30 +0800 Subject: [PATCH 19/23] format Committed-by: bingqing.lbq from Dev container --- .gitignore | 1 + .../graphscope/groot/service/api/ApiUtil.java | 14 +- .../groot/service/api/V1ApiController.java | 136 ++++++++++++------ .../groot/service/impl/DtoConverter.java | 66 +++++---- .../service/impl/EdgeManagementService.java | 15 +- .../groot/service/impl/GrootClientConfig.java | 8 +- .../service/impl/SchemaManagementService.java | 38 ++--- .../service/impl/VertexManagementService.java | 15 +- .../groot/service/models/GSDataType.java | 32 +---- .../OpenApiGeneratorApplicationTests.java | 6 +- 10 files changed, 186 insertions(+), 145 deletions(-) diff --git a/.gitignore b/.gitignore index 07f98b1ac2f0..39e230a42e00 100644 --- a/.gitignore +++ b/.gitignore @@ -162,6 +162,7 @@ interactive_engine/groot-http/.openapi-generator/ interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/*.java interactive_engine/groot-http/src/main/java/org/ interactive_engine/groot-http/src/main/resources/ +interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1Api.java **/.cache/ diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java index 564485d8ba2d..2e1dd6b8cf58 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java @@ -4,11 +4,13 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.context.request.NativeWebRequest; -import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + public static void setExampleResponse( + NativeWebRequest req, String contentType, String example) { try { HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); res.setCharacterEncoding("UTF-8"); @@ -25,11 +27,13 @@ public static ResponseEntity createErrorResponse(HttpStatus status, Stri public static ResponseEntity createSuccessResponse(String message, long snapshotId) { return ResponseEntity.status(HttpStatus.OK) - .body(String.format("{\"message\": \"%s\", \"snapshot id\": %d}", message, snapshotId)); + .body( + String.format( + "{\"message\": \"%s\", \"snapshot id\": %d}", message, snapshotId)); } public static ResponseEntity createSuccessResponse(String message) { - return ResponseEntity.status(HttpStatus.OK).body(String.format("{\"message\": \"%s\"}", message)); + return ResponseEntity.status(HttpStatus.OK) + .body(String.format("{\"message\": \"%s\"}", message)); } - } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java index 049c22888820..35cee132abef 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java @@ -14,10 +14,6 @@ import com.alibaba.graphscope.groot.service.models.VertexEdgeRequest; import com.alibaba.graphscope.groot.service.models.VertexRequest; -import java.util.List; - -import javax.validation.Valid; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -26,13 +22,17 @@ import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + +import javax.validation.Valid; + @RestController @RequestMapping("${openapi.graphScopeInteractiveAPIV03.base-path:/v1/graph}") public class V1ApiController implements V1Api { @@ -42,7 +42,9 @@ public class V1ApiController implements V1Api { private final SchemaManagementService schemaManagementService; @Autowired - public V1ApiController(VertexManagementService vertexService, EdgeManagementService edgeService, + public V1ApiController( + VertexManagementService vertexService, + EdgeManagementService edgeService, SchemaManagementService schemaManagementService) { this.vertexManagementService = vertexService; this.edgeManagementService = edgeService; @@ -50,7 +52,10 @@ public V1ApiController(VertexManagementService vertexService, EdgeManagementServ } @Override - @PostMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping( + value = "/{graph_id}/vertex", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity addVertex( @PathVariable("graph_id") String graphId, @RequestBody @Valid VertexEdgeRequest vertexEdgeRequest) { @@ -64,12 +69,16 @@ public ResponseEntity addVertex( return ApiUtil.createSuccessResponse("Vertices and edges added successfully", si); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertices and edges"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertices and edges"); } } @Override - @DeleteMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @DeleteMapping( + value = "/{graph_id}/vertex", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity deleteVertex( @PathVariable("graph_id") String graphId, @RequestBody(required = true) List deleteVertexRequest) { @@ -78,12 +87,16 @@ public ResponseEntity deleteVertex( return ApiUtil.createSuccessResponse("Vertices deleted successfully", si); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertices"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertices"); } } @Override - @PutMapping(value = "/{graph_id}/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @PutMapping( + value = "/{graph_id}/vertex", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity updateVertex( @PathVariable("graph_id") String graphId, @RequestBody(required = false) List vertexRequest) { @@ -92,12 +105,16 @@ public ResponseEntity updateVertex( return ApiUtil.createSuccessResponse("Vertices updated successfully", si); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertices"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertices"); } } @Override - @PostMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping( + value = "/{graph_id}/edge", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity addEdge( @PathVariable("graph_id") String graphId, @RequestBody(required = true) List edgeRequest) { @@ -106,12 +123,16 @@ public ResponseEntity addEdge( return ApiUtil.createSuccessResponse("Edges added successfully", si); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add edges"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add edges"); } } @Override - @DeleteMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @DeleteMapping( + value = "/{graph_id}/edge", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity deleteEdge( @PathVariable("graph_id") String graphId, @RequestBody(required = true) List deleteEdgeRequest) { @@ -120,12 +141,16 @@ public ResponseEntity deleteEdge( return ApiUtil.createSuccessResponse("Edges deleted successfully", si); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edges"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edges"); } } @Override - @PutMapping(value = "/{graph_id}/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @PutMapping( + value = "/{graph_id}/edge", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity updateEdge( @PathVariable("graph_id") String graphId, @RequestBody(required = false) List edgeRequest) { @@ -134,12 +159,16 @@ public ResponseEntity updateEdge( return ApiUtil.createSuccessResponse("Edges updated successfully", si); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edges"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edges"); } } @Override - @PostMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping( + value = "/{graph_id}/schema/vertex", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity createVertexType( @PathVariable("graph_id") String graphId, @RequestBody @Validated CreateVertexType createVertexType) { @@ -148,12 +177,16 @@ public ResponseEntity createVertexType( return ApiUtil.createSuccessResponse("Vertex type created successfully"); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create vertex type"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create vertex type"); } } @Override - @DeleteMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @DeleteMapping( + value = "/{graph_id}/schema/vertex", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity deleteVertexTypeByName( @PathVariable("graph_id") String graphId, @RequestParam(value = "type_name", required = true) String typeName) { @@ -162,12 +195,16 @@ public ResponseEntity deleteVertexTypeByName( return ApiUtil.createSuccessResponse("Vertex type deleted successfully"); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex type"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex type"); } } @Override - @PutMapping(value = "/{graph_id}/schema/vertex", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @PutMapping( + value = "/{graph_id}/schema/vertex", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity updateVertexType( @PathVariable("graph_id") String graphId, @RequestBody @Validated CreateVertexType updateVertexType) { @@ -176,12 +213,16 @@ public ResponseEntity updateVertexType( return ApiUtil.createSuccessResponse("Vertex type updated successfully"); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex type"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex type"); } } @Override - @PostMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping( + value = "/{graph_id}/schema/edge", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity createEdgeType( @PathVariable("graph_id") String graphId, @RequestBody @Validated CreateEdgeType createEdgeType) { @@ -190,28 +231,38 @@ public ResponseEntity createEdgeType( return ApiUtil.createSuccessResponse("Edge type created successfully"); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create edge type"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create edge type"); } } @Override - @DeleteMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @DeleteMapping( + value = "/{graph_id}/schema/edge", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity deleteEdgeTypeByName( @PathVariable("graph_id") String graphId, @RequestParam(value = "type_name", required = true) String typeName, @RequestParam(value = "source_vertex_type", required = true) String sourceVertexType, - @RequestParam(value = "destination_vertex_type", required = true) String destinationVertexType) { + @RequestParam(value = "destination_vertex_type", required = true) + String destinationVertexType) { try { - schemaManagementService.deleteEdgeType(typeName, sourceVertexType, destinationVertexType); + schemaManagementService.deleteEdgeType( + typeName, sourceVertexType, destinationVertexType); return ApiUtil.createSuccessResponse("Edge type deleted successfully"); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge type"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge type"); } } @Override - @PutMapping(value = "/{graph_id}/schema/edge", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @PutMapping( + value = "/{graph_id}/schema/edge", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity updateEdgeType( @PathVariable("graph_id") String graphId, @RequestBody @Validated CreateEdgeType updateEdgeType) { @@ -220,12 +271,16 @@ public ResponseEntity updateEdgeType( return ApiUtil.createSuccessResponse("Edge type updated successfully"); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge type"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge type"); } } @Override - @PostMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping( + value = "", + produces = MediaType.APPLICATION_JSON_VALUE, + consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity createGraph( @RequestBody @Validated CreateGraphRequest createGraphRequest) { try { @@ -255,14 +310,14 @@ public ResponseEntity getSchema( @Override @DeleteMapping(value = "/{graph_id}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteGraph( - @PathVariable("graph_id") String graphId) { + public ResponseEntity deleteGraph(@PathVariable("graph_id") String graphId) { try { schemaManagementService.dropSchema(); return ApiUtil.createSuccessResponse("Graph schema deleted successfully"); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete graph"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete graph"); } } @@ -273,11 +328,12 @@ public ResponseEntity flushSnapshotId( @RequestParam(value = "snapshot_id", required = true) Long snapshotId) { try { boolean res = schemaManagementService.remoteFlush(snapshotId); - return ApiUtil.createSuccessResponse("Snapshot flushed successfully: " + res, snapshotId.longValue()); + return ApiUtil.createSuccessResponse( + "Snapshot flushed successfully: " + res, snapshotId.longValue()); } catch (Exception e) { e.printStackTrace(); - return ApiUtil.createErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to flush snapshot"); + return ApiUtil.createErrorResponse( + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to flush snapshot"); } } - } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java index 5ef356806e49..3f1f5fc7830e 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java @@ -1,23 +1,17 @@ package com.alibaba.graphscope.groot.service.impl; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.openapitools.jackson.nullable.JsonNullable; - import com.alibaba.graphscope.groot.sdk.schema.Edge; import com.alibaba.graphscope.groot.sdk.schema.EdgeLabel; import com.alibaba.graphscope.groot.sdk.schema.EdgeLabel.EdgeRelation; -import com.alibaba.graphscope.groot.sdk.schema.Schema; import com.alibaba.graphscope.groot.sdk.schema.Vertex; import com.alibaba.graphscope.groot.sdk.schema.VertexLabel; +import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; +import com.alibaba.graphscope.groot.service.models.DateType; +import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; +import com.alibaba.graphscope.groot.service.models.DeleteVertexRequest; import com.alibaba.graphscope.groot.service.models.EdgeRequest; import com.alibaba.graphscope.groot.service.models.GSDataType; import com.alibaba.graphscope.groot.service.models.GetEdgeType; -import com.alibaba.graphscope.groot.service.models.GetGraphSchemaResponse; import com.alibaba.graphscope.groot.service.models.GetPropertyMeta; import com.alibaba.graphscope.groot.service.models.GetVertexType; import com.alibaba.graphscope.groot.service.models.PrimitiveType; @@ -27,25 +21,30 @@ import com.alibaba.graphscope.groot.service.models.TemporalTypeTemporal; import com.alibaba.graphscope.groot.service.models.TimeStampType; import com.alibaba.graphscope.groot.service.models.VertexRequest; -import com.alibaba.graphscope.groot.service.models.BaseEdgeTypeVertexTypePairRelationsInner; -import com.alibaba.graphscope.groot.service.models.DateType; -import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; -import com.alibaba.graphscope.groot.service.models.DeleteVertexRequest; import com.alibaba.graphscope.proto.groot.DataTypePb; -import com.alibaba.graphscope.proto.groot.GraphDefPb; + +import org.openapitools.jackson.nullable.JsonNullable; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; public class DtoConverter { public static Vertex convertToVertex(VertexRequest vertexRequest) { String label = vertexRequest.getLabel(); Map propertyMap = convertToPropertyMap(vertexRequest.getProperties()); - Map primaryKeyValues = convertToPropertyMap(vertexRequest.getPrimaryKeyValues()); + Map primaryKeyValues = + convertToPropertyMap(vertexRequest.getPrimaryKeyValues()); propertyMap.putAll(primaryKeyValues); return new Vertex(label, propertyMap); } public static Vertex convertToVertex(DeleteVertexRequest deleteVertexRequest) { String label = deleteVertexRequest.getLabel(); - Map primaryKeyValues = convertToPropertyMap(deleteVertexRequest.getPrimaryKeyValues()); + Map primaryKeyValues = + convertToPropertyMap(deleteVertexRequest.getPrimaryKeyValues()); return new Vertex(label, primaryKeyValues); } @@ -63,8 +62,10 @@ public static Edge convertToEdge(DeleteEdgeRequest deleteEdgeRequest) { String label = deleteEdgeRequest.getEdgeLabel(); String srcLabel = deleteEdgeRequest.getSrcLabel(); String dstLabel = deleteEdgeRequest.getDstLabel(); - Map srcPkMap = convertToPropertyMap(deleteEdgeRequest.getSrcPrimaryKeyValues()); - Map dstPkMap = convertToPropertyMap(deleteEdgeRequest.getDstPrimaryKeyValues()); + Map srcPkMap = + convertToPropertyMap(deleteEdgeRequest.getSrcPrimaryKeyValues()); + Map dstPkMap = + convertToPropertyMap(deleteEdgeRequest.getDstPrimaryKeyValues()); return new Edge(label, srcLabel, dstLabel, srcPkMap, dstPkMap); } @@ -89,7 +90,8 @@ public static DataTypePb convertToDataTypePb(GSDataType dataType) { case STRING: return DataTypePb.STRING; default: - throw new IllegalArgumentException("Unsupported primitive type: " + primitiveType); + throw new IllegalArgumentException( + "Unsupported primitive type: " + primitiveType); } } else if (dataType instanceof StringType) { return DataTypePb.STRING; @@ -97,11 +99,9 @@ public static DataTypePb convertToDataTypePb(GSDataType dataType) { TemporalType temporalType = (TemporalType) dataType; TemporalTypeTemporal temporal = temporalType.getTemporal(); if (temporal instanceof DateType) { - // TODO: confirm the date type return DataTypePb.DATE32; } else if (temporal instanceof TimeStampType) { - // TODO: confirm the timestamp type - return DataTypePb.TIMESTAMP_S; + return DataTypePb.TIMESTAMP_MS; } else { throw new IllegalArgumentException("Unsupported temporal type: " + temporalType); } @@ -114,7 +114,11 @@ public static GetVertexType convertToDtoVertexType(VertexLabel vertexLabel) { vertexType.setTypeName(vertexLabel.getLabel()); vertexType.setTypeId(vertexLabel.getId()); vertexType.setProperties(convertToDtoProperties(vertexLabel.getProperties())); - vertexType.setPrimaryKeys(vertexLabel.getProperties().stream().filter(p -> p.isPrimaryKey()).map(p -> p.getName()).collect(Collectors.toList())); + vertexType.setPrimaryKeys( + vertexLabel.getProperties().stream() + .filter(p -> p.isPrimaryKey()) + .map(p -> p.getName()) + .collect(Collectors.toList())); return vertexType; } @@ -124,7 +128,8 @@ public static GetEdgeType convertToDtoEdgeType(EdgeLabel edgeLabel) { edgeType.setTypeId(edgeLabel.getId()); edgeType.setProperties(convertToDtoProperties(edgeLabel.getProperties())); for (EdgeRelation edgeRelation : edgeLabel.getRelations()) { - BaseEdgeTypeVertexTypePairRelationsInner pair = new BaseEdgeTypeVertexTypePairRelationsInner(); + BaseEdgeTypeVertexTypePairRelationsInner pair = + new BaseEdgeTypeVertexTypePairRelationsInner(); pair.setSourceVertex(edgeRelation.getSrcLabel()); pair.setDestinationVertex(edgeRelation.getDstLabel()); edgeType.addVertexTypePairRelationsItem(pair); @@ -171,15 +176,15 @@ private static GSDataType convertToDtoDataType(DataTypePb dataType) { case DOUBLE: return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.DOUBLE); case STRING: - // TODO: confirm the string type return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.STRING); case DATE32: - // TODO: confirm the date type TemporalTypeTemporal date = new DateType("YYYY-MM-DD".toString()); return new TemporalType(date); - case TIMESTAMP_S: - // TODO: confirm the timestamp type - TemporalTypeTemporal timestamp = new TimeStampType("YYYY-MM-DD HH:MM:SS".toString()); + case TIMESTAMP_MS: + // TODO: confirm the format of timestamp? should be int64 milliseconds since + // 1970-01-01 00:00:00.000000? + TemporalTypeTemporal timestamp = + new TimeStampType("YYYY-MM-DD HH:MM:SS".toString()); return new TemporalType(timestamp); default: throw new IllegalArgumentException("Unsupported data type: " + dataType); @@ -189,5 +194,4 @@ private static GSDataType convertToDtoDataType(DataTypePb dataType) { private static String extractValue(JsonNullable jsonNullable) { return jsonNullable.isPresent() ? jsonNullable.get().toString() : null; } - } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java index cd085ea23623..97b3d0b79076 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/EdgeManagementService.java @@ -1,16 +1,16 @@ package com.alibaba.graphscope.groot.service.impl; -import java.util.ArrayList; -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import com.alibaba.graphscope.groot.sdk.GrootClient; import com.alibaba.graphscope.groot.sdk.schema.Edge; import com.alibaba.graphscope.groot.service.models.DeleteEdgeRequest; import com.alibaba.graphscope.groot.service.models.EdgeRequest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + @Service public class EdgeManagementService { private final GrootClient grootClient; @@ -41,7 +41,8 @@ public long addEdges(List edgeRequests) { public long deleteEdge(DeleteEdgeRequest deleteEdgeRequest) { Edge edge = DtoConverter.convertToEdge(deleteEdgeRequest); // TODO: deleteEdge will only delete the first edge that matches the given parameters - // e.g., if we have multiple edges from v1 to v2 with the same edge label, only one of them will be deleted + // e.g., if we have multiple edges from v1 to v2 with the same edge label, only one of them + // will be deleted return grootClient.deleteEdge(edge); } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootClientConfig.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootClientConfig.java index d8ee4e099f7f..64928c93dd43 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootClientConfig.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/GrootClientConfig.java @@ -1,16 +1,14 @@ package com.alibaba.graphscope.groot.service.impl; +import com.alibaba.graphscope.groot.sdk.GrootClient; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import com.alibaba.graphscope.groot.sdk.GrootClient; - @Configuration public class GrootClientConfig { @Bean public GrootClient grootClient() { - return GrootClient.newBuilder() - .addHost("localhost", 55556) - .build(); + return GrootClient.newBuilder().addHost("localhost", 55556).build(); } } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java index 0853577bedc1..438dec4a9e74 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/SchemaManagementService.java @@ -1,13 +1,5 @@ package com.alibaba.graphscope.groot.service.impl; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.crypto.Data; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import com.alibaba.graphscope.groot.sdk.GrootClient; import com.alibaba.graphscope.groot.sdk.schema.EdgeLabel; import com.alibaba.graphscope.groot.sdk.schema.Property; @@ -22,6 +14,10 @@ import com.alibaba.graphscope.proto.GraphDefPb; import com.alibaba.graphscope.proto.groot.DataTypePb; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; @Service public class SchemaManagementService { @@ -39,7 +35,7 @@ public void createVertexType(CreateVertexType createVertexType) { grootClient.submitSchema(schema); } - public void deleteVertexType( String vertexType) { + public void deleteVertexType(String vertexType) { VertexLabel.Builder vLabelBuilder = VertexLabel.newBuilder().setLabel(vertexType); Schema.Builder schema = Schema.newBuilder(); schema.dropVertexLabel(vLabelBuilder); @@ -47,14 +43,14 @@ public void deleteVertexType( String vertexType) { } public void updateVertexType(CreateVertexType updateVertexType) { - VertexLabel vLabel = createVertexLabel( updateVertexType); + VertexLabel vLabel = createVertexLabel(updateVertexType); Schema.Builder schema = Schema.newBuilder(); schema.addVertexLabelProperties(vLabel); grootClient.submitSchema(schema); } - public void createEdgeType( CreateEdgeType createEdgeType) { - EdgeLabel eLabel = createEdgeLabel( createEdgeType); + public void createEdgeType(CreateEdgeType createEdgeType) { + EdgeLabel eLabel = createEdgeLabel(createEdgeType); Schema.Builder schema = Schema.newBuilder(); schema.addEdgeLabel(eLabel); grootClient.submitSchema(schema); @@ -67,8 +63,9 @@ public void deleteEdgeType(String edgeType, String srcVertexType, String dstVert eKindBuilder.addRelation(srcVertexType, dstVertexType); Schema.Builder schema = Schema.newBuilder(); schema.dropEdgeLabelOrKind(eKindBuilder); - GraphDefPb grootGraphDefPb = grootClient.submitSchema(schema); - if (grootGraphDefPb.getEdgeKindsList().stream().noneMatch(edgeKind -> edgeKind.getEdgeLabel().equals(edgeType))) { + GraphDefPb grootGraphDefPb = grootClient.submitSchema(schema); + if (grootGraphDefPb.getEdgeKindsList().stream() + .noneMatch(edgeKind -> edgeKind.getEdgeLabel().equals(edgeType))) { // no more edgeKind with the given edge label, so we can delete it. EdgeLabel.Builder eLabelBuilder = EdgeLabel.newBuilder(); eLabelBuilder.setLabel(edgeType); @@ -79,7 +76,7 @@ public void deleteEdgeType(String edgeType, String srcVertexType, String dstVert } public void updateEdgeType(CreateEdgeType updateEdgeType) { - EdgeLabel eLabel = createEdgeLabel( updateEdgeType); + EdgeLabel eLabel = createEdgeLabel(updateEdgeType); Schema.Builder schema = Schema.newBuilder(); schema.addEdgeLabelProperties(eLabel); grootClient.submitSchema(schema); @@ -92,7 +89,7 @@ public void importSchema(CreateGraphSchemaRequest createSchema) { schema.addVertexLabel(vLabel); } for (CreateEdgeType edgeType : createSchema.getEdgeTypes()) { - EdgeLabel eLabel = createEdgeLabel( edgeType); + EdgeLabel eLabel = createEdgeLabel(edgeType); schema.addEdgeLabel(eLabel); } grootClient.submitSchema(schema); @@ -120,7 +117,8 @@ private VertexLabel createVertexLabel(CreateVertexType createVertexType) { List primaryKeys = createVertexType.getPrimaryKeys(); for (CreatePropertyMeta prop : createVertexType.getProperties()) { DataTypePb dataType = DtoConverter.convertToDataTypePb(prop.getPropertyType()); - Property.Builder property = Property.newBuilder().setName(prop.getPropertyName()).setDataType(dataType); + Property.Builder property = + Property.newBuilder().setName(prop.getPropertyName()).setDataType(dataType); if (primaryKeys.contains(prop.getPropertyName())) { property.setPrimaryKey(); } @@ -132,12 +130,14 @@ private VertexLabel createVertexLabel(CreateVertexType createVertexType) { private EdgeLabel createEdgeLabel(CreateEdgeType createEdgeType) { EdgeLabel.Builder eLabelBuilder = EdgeLabel.newBuilder(); eLabelBuilder.setLabel(createEdgeType.getTypeName()); - for (BaseEdgeTypeVertexTypePairRelationsInner pair : createEdgeType.getVertexTypePairRelations()) { + for (BaseEdgeTypeVertexTypePairRelationsInner pair : + createEdgeType.getVertexTypePairRelations()) { eLabelBuilder.addRelation(pair.getSourceVertex(), pair.getDestinationVertex()); } for (CreatePropertyMeta prop : createEdgeType.getProperties()) { DataTypePb dataType = DtoConverter.convertToDataTypePb(prop.getPropertyType()); - Property.Builder property = Property.newBuilder().setName(prop.getPropertyName()).setDataType(dataType); + Property.Builder property = + Property.newBuilder().setName(prop.getPropertyName()).setDataType(dataType); eLabelBuilder.addProperty(property); } return eLabelBuilder.build(); diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java index 722e6d301ffa..7d82e949a2c3 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/VertexManagementService.java @@ -1,11 +1,5 @@ package com.alibaba.graphscope.groot.service.impl; -import java.util.ArrayList; -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import com.alibaba.graphscope.groot.sdk.GrootClient; import com.alibaba.graphscope.groot.sdk.schema.Edge; import com.alibaba.graphscope.groot.sdk.schema.Vertex; @@ -14,6 +8,12 @@ import com.alibaba.graphscope.groot.service.models.VertexEdgeRequest; import com.alibaba.graphscope.groot.service.models.VertexRequest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + @Service public class VertexManagementService { @@ -79,5 +79,4 @@ public long addVerticesAndEdges(VertexEdgeRequest vertexEdgeRequest) { } return grootClient.addVerticesAndEdges(vertices, edges); } - -} \ No newline at end of file +} diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java index cf11e49b9973..5dcc8decf712 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java @@ -1,36 +1,16 @@ package com.alibaba.graphscope.groot.service.models; -import java.net.URI; -import java.util.Objects; -import com.alibaba.graphscope.groot.service.models.PrimitiveType; -import com.alibaba.graphscope.groot.service.models.StringType; -import com.alibaba.graphscope.groot.service.models.StringTypeString; -import com.alibaba.graphscope.groot.service.models.TemporalType; -import com.alibaba.graphscope.groot.service.models.TemporalTypeTemporal; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - import java.util.*; -import javax.annotation.Generated; +import javax.validation.constraints.*; -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ - @JsonSubTypes.Type(value = PrimitiveType.class, name = "PrimitiveType"), - @JsonSubTypes.Type(value = StringType.class, name = "StringType"), - @JsonSubTypes.Type(value = TemporalType.class, name = "TemporalType") + @JsonSubTypes.Type(value = PrimitiveType.class, name = "PrimitiveType"), + @JsonSubTypes.Type(value = StringType.class, name = "StringType"), + @JsonSubTypes.Type(value = TemporalType.class, name = "TemporalType") }) -public interface GSDataType { -} +public interface GSDataType {} diff --git a/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java b/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java index a9bd70bc0224..ac38704affd7 100644 --- a/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java +++ b/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java @@ -7,7 +7,5 @@ class OpenApiGeneratorApplicationTests { @Test - void contextLoads() { - } - -} \ No newline at end of file + void contextLoads() {} +} From 6b5efaa17afa038000c9be09515f2af4ba8b683d Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Thu, 9 Jan 2025 17:05:48 +0800 Subject: [PATCH 20/23] minor fix Committed-by: bingqing.lbq from Dev container --- flex/openapi/openapi_interactive.yaml | 4 ++-- .../alibaba/graphscope/groot/service/api/V1ApiController.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flex/openapi/openapi_interactive.yaml b/flex/openapi/openapi_interactive.yaml index c07bb7f01d31..b37cd1f45c1f 100644 --- a/flex/openapi/openapi_interactive.yaml +++ b/flex/openapi/openapi_interactive.yaml @@ -375,7 +375,7 @@ paths: in: query required: true schema: - type: long + type: integer responses: '200': description: Successful flush snapshot id, return if the snapshot id becomes available @@ -404,7 +404,7 @@ paths: content: application/json: schema: - type: long + type: integer '400': $ref: "#/components/responses/400" '500': diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java index 35cee132abef..4eeedc3cbe8d 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java @@ -325,7 +325,7 @@ public ResponseEntity deleteGraph(@PathVariable("graph_id") String graph @PostMapping(value = "/{graph_id}/snapshot", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity flushSnapshotId( @PathVariable("graph_id") String graphId, - @RequestParam(value = "snapshot_id", required = true) Long snapshotId) { + @RequestParam(value = "snapshot_id", required = true) Integer snapshotId) { try { boolean res = schemaManagementService.remoteFlush(snapshotId); return ApiUtil.createSuccessResponse( From 5e7e4600efdbe29df5dc18187188711df52b680d Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Thu, 9 Jan 2025 19:21:29 +0800 Subject: [PATCH 21/23] refine discriminator Committed-by: bingqing.lbq from Dev container --- flex/openapi/openapi_interactive.yaml | 38 +++++++++++++++++ .../groot-http/.openapi-generator-ignore | 3 +- .../groot/service/api/V1ApiController.java | 42 +++++++------------ .../groot/service/impl/DtoConverter.java | 24 +++++------ .../groot/service/models/GSDataType.java | 16 ------- .../OpenApiGeneratorApplicationTests.java | 6 ++- 6 files changed, 69 insertions(+), 60 deletions(-) delete mode 100644 interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java diff --git a/flex/openapi/openapi_interactive.yaml b/flex/openapi/openapi_interactive.yaml index b37cd1f45c1f..a2b2f6e51c5a 100644 --- a/flex/openapi/openapi_interactive.yaml +++ b/flex/openapi/openapi_interactive.yaml @@ -1541,6 +1541,7 @@ components: type: object required: - primitive_type + - ref_type properties: primitive_type: type: string @@ -1548,22 +1549,30 @@ components: DT_BOOL, DT_FLOAT, DT_DOUBLE, DT_STRING] # The DT_STRING is added for backward compatibility, it should be replaced by StringType example: DT_SIGNED_INT32 + ref_type: + type: string + example: "PrimitiveType" LongText: x-body-name: long_text type: object additionalProperties: false required: - long_text + - string_ref_type properties: long_text: type: string nullable: true + string_ref_type: + type: string + example: "LongText" FixedChar: x-body-name: fixed_char type: object additionalProperties: false required: - char + - string_ref_type properties: char: type: object @@ -1572,12 +1581,16 @@ components: properties: fixed_length: type: integer + string_ref_type: + type: string + example: "FixedChar" VarChar: x-body-name: var_char type: object additionalProperties: false required: - var_char + - string_ref_type properties: var_char: type: object @@ -1586,49 +1599,74 @@ components: properties: max_length: type: integer + string_ref_type: + type: string + example: "VarChar" StringType: x-body-name: string_type type: object required: - string + - ref_type properties: string: oneOf: - $ref: '#/components/schemas/LongText' - $ref: '#/components/schemas/FixedChar' - $ref: '#/components/schemas/VarChar' + discriminator: + propertyName: string_ref_type + ref_type: + type: string + example: "StringType" TimeStampType: x-body-name: time_stamp_type type: object required: - timestamp + - temporal_ref_type properties: timestamp: type: string + temporal_ref_type: + type: string + example: "TimeStampType" DateType: x-body-name: date_type type: object required: - date32 + - temporal_ref_type properties: date32: type: string + temporal_ref_type: + type: string + example: "DateType" TemporalType: x-body-name: temporal_type type: object required: - temporal + - ref_type properties: temporal: oneOf: - $ref: '#/components/schemas/TimeStampType' - $ref: '#/components/schemas/DateType' + discriminator: + propertyName: temporal_ref_type + ref_type: + type: string + example: "TemporalType" GSDataType: x-body-name: gs_data_type oneOf: - $ref: '#/components/schemas/PrimitiveType' - $ref: '#/components/schemas/StringType' - $ref: '#/components/schemas/TemporalType' + discriminator: + propertyName: ref_type Property: x-body-name: property type: object diff --git a/interactive_engine/groot-http/.openapi-generator-ignore b/interactive_engine/groot-http/.openapi-generator-ignore index 07aaa9885626..e5386b6dd5a9 100644 --- a/interactive_engine/groot-http/.openapi-generator-ignore +++ b/interactive_engine/groot-http/.openapi-generator-ignore @@ -25,5 +25,4 @@ pom.xml src/main/java/com/alibaba/graphscope/groot/service/impl src/main/java/com/alibaba/graphscope/groot/service/api/ApiUtil.java -src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java -src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java \ No newline at end of file +src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java \ No newline at end of file diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java index 4eeedc3cbe8d..371be69f9cc2 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java @@ -68,9 +68,8 @@ public ResponseEntity addVertex( } return ApiUtil.createSuccessResponse("Vertices and edges added successfully", si); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertices and edges"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertices and edges: " + e.getMessage()); } } @@ -86,9 +85,8 @@ public ResponseEntity deleteVertex( long si = vertexManagementService.deleteVertices(deleteVertexRequest); return ApiUtil.createSuccessResponse("Vertices deleted successfully", si); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertices"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertices: " + e.getMessage()); } } @@ -104,9 +102,8 @@ public ResponseEntity updateVertex( long si = vertexManagementService.updateVertices(vertexRequest); return ApiUtil.createSuccessResponse("Vertices updated successfully", si); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertices"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertices: " + e.getMessage()); } } @@ -122,9 +119,8 @@ public ResponseEntity addEdge( long si = edgeManagementService.addEdges(edgeRequest); return ApiUtil.createSuccessResponse("Edges added successfully", si); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add edges"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add edges: " + e.getMessage()); } } @@ -140,9 +136,8 @@ public ResponseEntity deleteEdge( long si = edgeManagementService.deleteEdges(deleteEdgeRequest); return ApiUtil.createSuccessResponse("Edges deleted successfully", si); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edges"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edges: " + e.getMessage()); } } @@ -158,9 +153,8 @@ public ResponseEntity updateEdge( long si = edgeManagementService.updateEdges(edgeRequest); return ApiUtil.createSuccessResponse("Edges updated successfully", si); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edges"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edges: " + e.getMessage()); } } @@ -176,9 +170,8 @@ public ResponseEntity createVertexType( schemaManagementService.createVertexType(createVertexType); return ApiUtil.createSuccessResponse("Vertex type created successfully"); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create vertex type"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create vertex type: " + e.getMessage()); } } @@ -194,9 +187,8 @@ public ResponseEntity deleteVertexTypeByName( schemaManagementService.deleteVertexType(typeName); return ApiUtil.createSuccessResponse("Vertex type deleted successfully"); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex type"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex type" + e.getMessage()); } } @@ -212,9 +204,8 @@ public ResponseEntity updateVertexType( schemaManagementService.updateVertexType(updateVertexType); return ApiUtil.createSuccessResponse("Vertex type updated successfully"); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex type"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex type: " + e.getMessage()); } } @@ -230,9 +221,8 @@ public ResponseEntity createEdgeType( schemaManagementService.createEdgeType(createEdgeType); return ApiUtil.createSuccessResponse("Edge type created successfully"); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create edge type"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create edge type: " + e.getMessage()); } } @@ -252,9 +242,8 @@ public ResponseEntity deleteEdgeTypeByName( typeName, sourceVertexType, destinationVertexType); return ApiUtil.createSuccessResponse("Edge type deleted successfully"); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge type"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge type: " + e.getMessage()); } } @@ -270,9 +259,8 @@ public ResponseEntity updateEdgeType( schemaManagementService.updateEdgeType(updateEdgeType); return ApiUtil.createSuccessResponse("Edge type updated successfully"); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge type"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge type: " + e.getMessage()); } } @@ -315,9 +303,8 @@ public ResponseEntity deleteGraph(@PathVariable("graph_id") String graph schemaManagementService.dropSchema(); return ApiUtil.createSuccessResponse("Graph schema deleted successfully"); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete graph"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete graph schema: " + e.getMessage()); } } @@ -331,9 +318,8 @@ public ResponseEntity flushSnapshotId( return ApiUtil.createSuccessResponse( "Snapshot flushed successfully: " + res, snapshotId.longValue()); } catch (Exception e) { - e.printStackTrace(); return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to flush snapshot"); + HttpStatus.INTERNAL_SERVER_ERROR, "Failed to flush snapshot: " + e.getMessage()); } } } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java index 3f1f5fc7830e..42f1480ab658 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java @@ -162,30 +162,30 @@ private static List convertToDtoProperties( private static GSDataType convertToDtoDataType(DataTypePb dataType) { switch (dataType) { case INT: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.SIGNED_INT32); + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.SIGNED_INT32, "PrimitiveType"); case UINT: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.UNSIGNED_INT32); + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.UNSIGNED_INT32, "PrimitiveType"); case LONG: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.SIGNED_INT64); + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.SIGNED_INT64, "PrimitiveType"); case ULONG: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.UNSIGNED_INT64); + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.UNSIGNED_INT64, "PrimitiveType"); case BOOL: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.BOOL); + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.BOOL, "PrimitiveType"); case FLOAT: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.FLOAT); + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.FLOAT, "PrimitiveType"); case DOUBLE: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.DOUBLE); + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.DOUBLE, "PrimitiveType"); case STRING: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.STRING); + return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.STRING, "PrimitiveType"); case DATE32: - TemporalTypeTemporal date = new DateType("YYYY-MM-DD".toString()); - return new TemporalType(date); + TemporalTypeTemporal date = new DateType("YYYY-MM-DD".toString(), "DateType"); + return new TemporalType(date, "TemporalType"); case TIMESTAMP_MS: // TODO: confirm the format of timestamp? should be int64 milliseconds since // 1970-01-01 00:00:00.000000? TemporalTypeTemporal timestamp = - new TimeStampType("YYYY-MM-DD HH:MM:SS".toString()); - return new TemporalType(timestamp); + new TimeStampType("YYYY-MM-DD HH:MM:SS".toString(), "TimeStampType"); + return new TemporalType(timestamp, "TemporalType"); default: throw new IllegalArgumentException("Unsupported data type: " + dataType); } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java deleted file mode 100644 index 5dcc8decf712..000000000000 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/models/GSDataType.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.alibaba.graphscope.groot.service.models; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -import java.util.*; - -import javax.validation.constraints.*; - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = PrimitiveType.class, name = "PrimitiveType"), - @JsonSubTypes.Type(value = StringType.class, name = "StringType"), - @JsonSubTypes.Type(value = TemporalType.class, name = "TemporalType") -}) -public interface GSDataType {} diff --git a/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java b/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java index ac38704affd7..a9bd70bc0224 100644 --- a/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java +++ b/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java @@ -7,5 +7,7 @@ class OpenApiGeneratorApplicationTests { @Test - void contextLoads() {} -} + void contextLoads() { + } + +} \ No newline at end of file From 2e416f16a19e6d3ad87f347982f2570d6c61a0b1 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Mon, 13 Jan 2025 13:56:18 +0800 Subject: [PATCH 22/23] refine discriminator Committed-by: bingqing.lbq from Dev container --- flex/openapi/openapi_interactive.yaml | 198 +++++++++--------- .../groot/service/impl/DtoConverter.java | 7 +- 2 files changed, 107 insertions(+), 98 deletions(-) diff --git a/flex/openapi/openapi_interactive.yaml b/flex/openapi/openapi_interactive.yaml index a2b2f6e51c5a..126701fdf3fc 100644 --- a/flex/openapi/openapi_interactive.yaml +++ b/flex/openapi/openapi_interactive.yaml @@ -1538,135 +1538,143 @@ components: $ref: '#/components/schemas/AnyValue' PrimitiveType: x-body-name: primitive_type + allOf: + - $ref: '#/components/schemas/BaseGSDataType' + - type: object + required: + - primitive_type + properties: + primitive_type: + type: string + enum: [DT_SIGNED_INT32, DT_UNSIGNED_INT32, DT_SIGNED_INT64, DT_UNSIGNED_INT64, + DT_BOOL, DT_FLOAT, DT_DOUBLE, DT_STRING] + # The DT_STRING is added for backward compatibility, it should be replaced by StringType + example: DT_SIGNED_INT32 + BaseStringType: + x-body-name: base_string_type type: object - required: - - primitive_type - - ref_type + required: + - string_type properties: - primitive_type: + string_type: type: string - enum: [DT_SIGNED_INT32, DT_UNSIGNED_INT32, DT_SIGNED_INT64, DT_UNSIGNED_INT64, - DT_BOOL, DT_FLOAT, DT_DOUBLE, DT_STRING] - # The DT_STRING is added for backward compatibility, it should be replaced by StringType - example: DT_SIGNED_INT32 - ref_type: - type: string - example: "PrimitiveType" + discriminator: + propertyName: string_type LongText: x-body-name: long_text - type: object - additionalProperties: false - required: - - long_text - - string_ref_type - properties: - long_text: - type: string - nullable: true - string_ref_type: - type: string - example: "LongText" + allOf: + - $ref: '#/components/schemas/BaseStringType' + - type: object + additionalProperties: false + required: + - long_text + properties: + long_text: + type: string + nullable: true FixedChar: x-body-name: fixed_char - type: object - additionalProperties: false - required: - - char - - string_ref_type - properties: - char: - type: object + allOf: + - $ref: '#/components/schemas/BaseStringType' + - type: object + additionalProperties: false required: - - fixed_length + - char properties: - fixed_length: - type: integer - string_ref_type: - type: string - example: "FixedChar" + char: + type: object + required: + - fixed_length + properties: + fixed_length: + type: integer VarChar: x-body-name: var_char - type: object - additionalProperties: false - required: - - var_char - - string_ref_type - properties: - var_char: - type: object + allOf: + - $ref: '#/components/schemas/BaseStringType' + - type: object + additionalProperties: false required: - - max_length + - var_char properties: - max_length: - type: integer - string_ref_type: - type: string - example: "VarChar" + var_char: + type: object + required: + - max_length + properties: + max_length: + type: integer StringType: x-body-name: string_type + allOf: + - $ref: '#/components/schemas/BaseGSDataType' + - type: object + required: + - string + properties: + string: + oneOf: + - $ref: '#/components/schemas/LongText' + - $ref: '#/components/schemas/FixedChar' + - $ref: '#/components/schemas/VarChar' + BaseTemporalType: + x-body-name: base_temporal_type type: object - required: - - string - - ref_type + required: + - temporal_type properties: - string: - oneOf: - - $ref: '#/components/schemas/LongText' - - $ref: '#/components/schemas/FixedChar' - - $ref: '#/components/schemas/VarChar' - discriminator: - propertyName: string_ref_type - ref_type: + temporal_type: type: string - example: "StringType" + discriminator: + propertyName: temporal_type TimeStampType: x-body-name: time_stamp_type - type: object - required: - - timestamp - - temporal_ref_type - properties: - timestamp: - type: string - temporal_ref_type: - type: string - example: "TimeStampType" + allOf: + - $ref: '#/components/schemas/BaseTemporalType' + - type: object + required: + - timestamp + properties: + timestamp: + type: string DateType: x-body-name: date_type - type: object - required: - - date32 - - temporal_ref_type - properties: - date32: - type: string - temporal_ref_type: - type: string - example: "DateType" + allOf: + - $ref: '#/components/schemas/BaseTemporalType' + - type: object + required: + - date32 + properties: + date32: + type: string TemporalType: x-body-name: temporal_type + allOf: + - $ref: '#/components/schemas/BaseGSDataType' + - type: object + required: + - temporal + properties: + temporal: + oneOf: + - $ref: '#/components/schemas/TimeStampType' + - $ref: '#/components/schemas/DateType' + BaseGSDataType: + x-body-name: base_gs_data_type type: object required: - - temporal - - ref_type + - type_name properties: - temporal: - oneOf: - - $ref: '#/components/schemas/TimeStampType' - - $ref: '#/components/schemas/DateType' - discriminator: - propertyName: temporal_ref_type - ref_type: + type_name: type: string - example: "TemporalType" + discriminator: + propertyName: type_name GSDataType: x-body-name: gs_data_type oneOf: - $ref: '#/components/schemas/PrimitiveType' - $ref: '#/components/schemas/StringType' - $ref: '#/components/schemas/TemporalType' - discriminator: - propertyName: ref_type Property: x-body-name: property type: object diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java index 42f1480ab658..d89091213ae1 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java @@ -18,6 +18,7 @@ import com.alibaba.graphscope.groot.service.models.Property; import com.alibaba.graphscope.groot.service.models.StringType; import com.alibaba.graphscope.groot.service.models.TemporalType; +import com.alibaba.graphscope.groot.service.models.TemporalTypeAllOfTemporal; import com.alibaba.graphscope.groot.service.models.TemporalTypeTemporal; import com.alibaba.graphscope.groot.service.models.TimeStampType; import com.alibaba.graphscope.groot.service.models.VertexRequest; @@ -97,7 +98,7 @@ public static DataTypePb convertToDataTypePb(GSDataType dataType) { return DataTypePb.STRING; } else if (dataType instanceof TemporalType) { TemporalType temporalType = (TemporalType) dataType; - TemporalTypeTemporal temporal = temporalType.getTemporal(); + TemporalTypeAllOfTemporal temporal = temporalType.getTemporal(); if (temporal instanceof DateType) { return DataTypePb.DATE32; } else if (temporal instanceof TimeStampType) { @@ -178,12 +179,12 @@ private static GSDataType convertToDtoDataType(DataTypePb dataType) { case STRING: return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.STRING, "PrimitiveType"); case DATE32: - TemporalTypeTemporal date = new DateType("YYYY-MM-DD".toString(), "DateType"); + TemporalTypeAllOfTemporal date = new DateType("YYYY-MM-DD".toString(), "DateType"); return new TemporalType(date, "TemporalType"); case TIMESTAMP_MS: // TODO: confirm the format of timestamp? should be int64 milliseconds since // 1970-01-01 00:00:00.000000? - TemporalTypeTemporal timestamp = + TemporalTypeAllOfTemporal timestamp = new TimeStampType("YYYY-MM-DD HH:MM:SS".toString(), "TimeStampType"); return new TemporalType(timestamp, "TemporalType"); default: From db00091547a79e2defc9c10a8948d541362c2761 Mon Sep 17 00:00:00 2001 From: "bingqing.lbq" Date: Mon, 13 Jan 2025 14:09:40 +0800 Subject: [PATCH 23/23] refine get_snapshot_status api Committed-by: bingqing.lbq from Dev container --- flex/openapi/openapi_interactive.yaml | 36 +++------------ .../groot/service/api/V1ApiController.java | 44 ++++++++++++------- .../groot/service/impl/DtoConverter.java | 15 ++++--- .../OpenApiGeneratorApplicationTests.java | 6 +-- 4 files changed, 45 insertions(+), 56 deletions(-) diff --git a/flex/openapi/openapi_interactive.yaml b/flex/openapi/openapi_interactive.yaml index 126701fdf3fc..92b307d9a265 100644 --- a/flex/openapi/openapi_interactive.yaml +++ b/flex/openapi/openapi_interactive.yaml @@ -359,12 +359,12 @@ paths: 500: $ref: "#/components/responses/500" - /v1/graph/{graph_id}/snapshot: - post: + /v1/graph/{graph_id}/snapshot/{snapshot_id}/status: + get: tags: - AdminService/GraphManagement - description: test if the snapshot id is available - operationId: flush_snapshot_id + description: Get the status of a snapshot by id + operationId: get_snapshot_status parameters: - name: graph_id in: path @@ -372,39 +372,17 @@ paths: schema: type: string - name: snapshot_id - in: query - required: true - schema: - type: integer - responses: - '200': - description: Successful flush snapshot id, return if the snapshot id becomes available - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - '400': - $ref: "#/components/responses/400" - '500': - $ref: "#/components/responses/500" - get: - tags: - - AdminService/GraphManagement - description: Get the latest snapshot id - operationId: get_snapshot_id - parameters: - - name: graph_id in: path required: true schema: - type: string + type: integer responses: '200': - description: Successful get snapshot id + description: the status of a snapshot_id of whether it is available content: application/json: schema: - type: integer + type: boolean '400': $ref: "#/components/responses/400" '500': diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java index 371be69f9cc2..3db37441e571 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/api/V1ApiController.java @@ -69,7 +69,8 @@ public ResponseEntity addVertex( return ApiUtil.createSuccessResponse("Vertices and edges added successfully", si); } catch (Exception e) { return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to add vertices and edges: " + e.getMessage()); + HttpStatus.INTERNAL_SERVER_ERROR, + "Failed to add vertices and edges: " + e.getMessage()); } } @@ -86,7 +87,8 @@ public ResponseEntity deleteVertex( return ApiUtil.createSuccessResponse("Vertices deleted successfully", si); } catch (Exception e) { return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertices: " + e.getMessage()); + HttpStatus.INTERNAL_SERVER_ERROR, + "Failed to delete vertices: " + e.getMessage()); } } @@ -103,7 +105,8 @@ public ResponseEntity updateVertex( return ApiUtil.createSuccessResponse("Vertices updated successfully", si); } catch (Exception e) { return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertices: " + e.getMessage()); + HttpStatus.INTERNAL_SERVER_ERROR, + "Failed to update vertices: " + e.getMessage()); } } @@ -171,7 +174,8 @@ public ResponseEntity createVertexType( return ApiUtil.createSuccessResponse("Vertex type created successfully"); } catch (Exception e) { return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create vertex type: " + e.getMessage()); + HttpStatus.INTERNAL_SERVER_ERROR, + "Failed to create vertex type: " + e.getMessage()); } } @@ -188,7 +192,8 @@ public ResponseEntity deleteVertexTypeByName( return ApiUtil.createSuccessResponse("Vertex type deleted successfully"); } catch (Exception e) { return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete vertex type" + e.getMessage()); + HttpStatus.INTERNAL_SERVER_ERROR, + "Failed to delete vertex type" + e.getMessage()); } } @@ -205,7 +210,8 @@ public ResponseEntity updateVertexType( return ApiUtil.createSuccessResponse("Vertex type updated successfully"); } catch (Exception e) { return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update vertex type: " + e.getMessage()); + HttpStatus.INTERNAL_SERVER_ERROR, + "Failed to update vertex type: " + e.getMessage()); } } @@ -222,7 +228,8 @@ public ResponseEntity createEdgeType( return ApiUtil.createSuccessResponse("Edge type created successfully"); } catch (Exception e) { return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to create edge type: " + e.getMessage()); + HttpStatus.INTERNAL_SERVER_ERROR, + "Failed to create edge type: " + e.getMessage()); } } @@ -243,7 +250,8 @@ public ResponseEntity deleteEdgeTypeByName( return ApiUtil.createSuccessResponse("Edge type deleted successfully"); } catch (Exception e) { return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete edge type: " + e.getMessage()); + HttpStatus.INTERNAL_SERVER_ERROR, + "Failed to delete edge type: " + e.getMessage()); } } @@ -260,7 +268,8 @@ public ResponseEntity updateEdgeType( return ApiUtil.createSuccessResponse("Edge type updated successfully"); } catch (Exception e) { return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to update edge type: " + e.getMessage()); + HttpStatus.INTERNAL_SERVER_ERROR, + "Failed to update edge type: " + e.getMessage()); } } @@ -304,22 +313,23 @@ public ResponseEntity deleteGraph(@PathVariable("graph_id") String graph return ApiUtil.createSuccessResponse("Graph schema deleted successfully"); } catch (Exception e) { return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to delete graph schema: " + e.getMessage()); + HttpStatus.INTERNAL_SERVER_ERROR, + "Failed to delete graph schema: " + e.getMessage()); } } @Override - @PostMapping(value = "/{graph_id}/snapshot", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity flushSnapshotId( + @PostMapping( + value = "/{graph_id}/snapshot/{snapshot_id}/status", + produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity getSnapshotStatus( @PathVariable("graph_id") String graphId, - @RequestParam(value = "snapshot_id", required = true) Integer snapshotId) { + @PathVariable("snapshot_id") Integer snapshotId) { try { boolean res = schemaManagementService.remoteFlush(snapshotId); - return ApiUtil.createSuccessResponse( - "Snapshot flushed successfully: " + res, snapshotId.longValue()); + return ResponseEntity.status(HttpStatus.OK).body(res); } catch (Exception e) { - return ApiUtil.createErrorResponse( - HttpStatus.INTERNAL_SERVER_ERROR, "Failed to flush snapshot: " + e.getMessage()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(false); } } } diff --git a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java index d89091213ae1..a60cc927fefc 100644 --- a/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java +++ b/interactive_engine/groot-http/src/main/java/com/alibaba/graphscope/groot/service/impl/DtoConverter.java @@ -19,7 +19,6 @@ import com.alibaba.graphscope.groot.service.models.StringType; import com.alibaba.graphscope.groot.service.models.TemporalType; import com.alibaba.graphscope.groot.service.models.TemporalTypeAllOfTemporal; -import com.alibaba.graphscope.groot.service.models.TemporalTypeTemporal; import com.alibaba.graphscope.groot.service.models.TimeStampType; import com.alibaba.graphscope.groot.service.models.VertexRequest; import com.alibaba.graphscope.proto.groot.DataTypePb; @@ -163,13 +162,17 @@ private static List convertToDtoProperties( private static GSDataType convertToDtoDataType(DataTypePb dataType) { switch (dataType) { case INT: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.SIGNED_INT32, "PrimitiveType"); + return new PrimitiveType( + PrimitiveType.PrimitiveTypeEnum.SIGNED_INT32, "PrimitiveType"); case UINT: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.UNSIGNED_INT32, "PrimitiveType"); + return new PrimitiveType( + PrimitiveType.PrimitiveTypeEnum.UNSIGNED_INT32, "PrimitiveType"); case LONG: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.SIGNED_INT64, "PrimitiveType"); + return new PrimitiveType( + PrimitiveType.PrimitiveTypeEnum.SIGNED_INT64, "PrimitiveType"); case ULONG: - return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.UNSIGNED_INT64, "PrimitiveType"); + return new PrimitiveType( + PrimitiveType.PrimitiveTypeEnum.UNSIGNED_INT64, "PrimitiveType"); case BOOL: return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.BOOL, "PrimitiveType"); case FLOAT: @@ -179,7 +182,7 @@ private static GSDataType convertToDtoDataType(DataTypePb dataType) { case STRING: return new PrimitiveType(PrimitiveType.PrimitiveTypeEnum.STRING, "PrimitiveType"); case DATE32: - TemporalTypeAllOfTemporal date = new DateType("YYYY-MM-DD".toString(), "DateType"); + TemporalTypeAllOfTemporal date = new DateType("YYYY-MM-DD".toString(), "DateType"); return new TemporalType(date, "TemporalType"); case TIMESTAMP_MS: // TODO: confirm the format of timestamp? should be int64 milliseconds since diff --git a/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java b/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java index a9bd70bc0224..ac38704affd7 100644 --- a/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java +++ b/interactive_engine/groot-http/src/test/java/com/alibaba/graphscope/groot/OpenApiGeneratorApplicationTests.java @@ -7,7 +7,5 @@ class OpenApiGeneratorApplicationTests { @Test - void contextLoads() { - } - -} \ No newline at end of file + void contextLoads() {} +}