### Install via Setuptools Source: https://graphscope.io/docs/flex/coordinator/development/python/README Install the package using the provided setup script. ```bash python setup.py install --user ``` ```bash sudo python setup.py install ``` -------------------------------- ### PHP SDK Example Source: https://graphscope.io/docs/flex/interactive/development/restful_api Initial setup for the PHP OpenAPI client. ```php start = session.startService(new StartServiceRequest().graphId("1")); if (!start.isOk()) { System.out.println("Failed to start service: " + start.getStatusMessage()); } else { System.out.println("Service started: " + start.getValue()); } } } ``` -------------------------------- ### start() Source: https://graphscope.io/docs/reference/gae_java/com/alibaba/RDDReaderTransfer/RDDReadServer Starts the RDDReadServer instance. ```APIDOC ## Method: start() ### Description Starts the server to begin processing requests. ### Throws - **IOException** - If an I/O error occurs during startup. ``` -------------------------------- ### Get Graph Statistics SDK Examples Source: https://graphscope.io/docs/flex/interactive/development/restful_api Implementation examples for various programming languages using the generated OpenAPI client. ```java import org.openapitools.client.*; import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.AdminServiceGraphManagementApi; import java.io.File; import java.util.*; public class AdminServiceGraphManagementApiExample { public static void main(String[] args) { // Create an instance of the API class AdminServiceGraphManagementApi apiInstance = new AdminServiceGraphManagementApi(); String graphId = graphId_example; // String | The id of graph to get statistics try { GetGraphStatisticsResponse result = apiInstance.getGraphStatistic(graphId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdminServiceGraphManagementApi#getGraphStatistic"); e.printStackTrace(); } } } ``` ```dart import 'package:openapi/api.dart'; final api_instance = DefaultApi(); final String graphId = new String(); // String | The id of graph to get statistics try { final result = await api_instance.getGraphStatistic(graphId); print(result); } catch (e) { print('Exception when calling DefaultApi->getGraphStatistic: $e\n'); } ``` ```java import org.openapitools.client.api.AdminServiceGraphManagementApi; public class AdminServiceGraphManagementApiExample { public static void main(String[] args) { AdminServiceGraphManagementApi apiInstance = new AdminServiceGraphManagementApi(); String graphId = graphId_example; // String | The id of graph to get statistics try { GetGraphStatisticsResponse result = apiInstance.getGraphStatistic(graphId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdminServiceGraphManagementApi#getGraphStatistic"); e.printStackTrace(); } } } ``` ```objective-c // Create an instance of the API class AdminServiceGraphManagementApi *apiInstance = [[AdminServiceGraphManagementApi alloc] init]; String *graphId = graphId_example; // The id of graph to get statistics (default to null) [apiInstance getGraphStatisticWith:graphId completionHandler: ^(GetGraphStatisticsResponse output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }]; ``` ```javascript var GraphScopeInteractiveApiV03 = require('graph_scope_interactive_api_v0_3'); // Create an instance of the API class var api = new GraphScopeInteractiveApiV03.AdminServiceGraphManagementApi() var graphId = graphId_example; // {String} The id of graph to get statistics var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.getGraphStatistic(graphId, callback); ``` ```csharp using System; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; using Org.OpenAPITools.Model; namespace Example { public class getGraphStatisticExample { public void main() { // Create an instance of the API class var apiInstance = new AdminServiceGraphManagementApi(); var graphId = graphId_example; // String | The id of graph to get statistics (default to null) try { GetGraphStatisticsResponse result = apiInstance.getGraphStatistic(graphId); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling AdminServiceGraphManagementApi.getGraphStatistic: " + e.Message ); } } } } ``` ```php getGraphStatistic($graphId); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdminServiceGraphManagementApi->getGraphStatistic: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Start Service via Curl Source: https://graphscope.io/docs/flex/coordinator/restful_api Example of triggering the start service endpoint using a curl command. ```bash curl -X POST \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ "http://localhost/api/v1/service/start" \ -d '{ "graph_id" : "graph_id" }' ``` -------------------------------- ### Setup virtual environment and initialize GraphScope Source: https://graphscope.io/docs/interactive_engine/getting_started Commands to create a clean Python 3.9 virtual environment and start an interactive session. ```bash # Create a new virtual environment python3.9 -m venv tutorial-env # Activate the virtual environment source tutorial-env/bin/activate # Install GraphScope python3.9 -m pip install graphscope # Use GraphScope python3.9 >>> import graphscope as gs >>> ...... ``` -------------------------------- ### start() Source: https://graphscope.io/docs/reference/gae_java/com/alibaba/graphscope/parallel/ParallelMessageManagerGen_cxx_0x5a835738 Starts the message manager. ```APIDOC ## start() ### Description Initiates the message manager operations. ``` -------------------------------- ### Configure Groot with Helm flags Source: https://graphscope.io/docs/storage_engine/groot Example of setting configuration parameters directly during installation using the --set flag. ```bash helm install demo graphscope/graphscope-store \ --set auth.username=admin,auth.password=123456 ``` -------------------------------- ### Build and install from source Source: https://graphscope.io/docs/deployment/install_on_local Compiles and installs GraphScope from the source directory. ```bash make make install ``` -------------------------------- ### Configure Groot with YAML file Source: https://graphscope.io/docs/storage_engine/groot Example of installing Groot using a configuration file and the corresponding YAML content. ```bash helm install demo graphscope/graphscope-store -f settings.yaml ``` ```yaml # cat settings.yaml --- image: tag: latest auth: username: admin password: 123456 ``` -------------------------------- ### Running examples for in() step Source: https://graphscope.io/docs/interactive_engine/tinkerpop/supported_gremlin_steps Interactive console examples showing the output of various in() step configurations. ```gremlin gremlin> g.V().in("1..3", "knows").with('RESULT_OPT', 'ALL_V') ==>[v[2], v[1]] ==>[v[4], v[1]] gremlin> g.V().in("1..3", "knows").with('RESULT_OPT', 'ALL_V_E') ==>[v[2], e[0][1-knows->2], v[1]] ==>[v[4], e[2][1-knows->4], v[1]] gremlin> g.V().in("1..3", "knows").with('RESULT_OPT', 'END_V').endV() ==>v[1] ==>v[1] ``` -------------------------------- ### BulkLoading Job Creation Example Source: https://graphscope.io/docs/flex/interactive/development/java/GraphManagementApi Demonstrates the setup of schema and mapping JSON strings required to initiate a bulk loading job via the GraphScope Java driver. ```java // Import classes: import com.alibaba.graphscope.interactive.client.Driver; import com.alibaba.graphscope.interactive.client.Session; import com.alibaba.graphscope.interactive.client.common.Result; import com.alibaba.graphscope.interactive.models.*; public class Example { private static final String MODERN_GRAPH_SCHEMA_JSON = "{\n" + " \"name\": \"modern_graph\",\n" + " \"description\": \"This is a test graph\",\n" + " \"schema\": {\n" + " \"vertex_types\": [\n" + " {\n" + " \"type_name\": \"person\",\n" + " \"properties\": [\n" + " {\n" + " \"property_name\": \"id\",\n" + " \"property_type\": {\"primitive_type\": \"DT_SIGNED_INT64\"},\n" + " },\n" + " {\n" + " \"property_name\": \"name\",\n" + " \"property_type\": {\"string\": {\"long_text\": \"\"}},\n" + " },\n" + " {\n" + " \"property_name\": \"age\",\n" + " \"property_type\": {\"primitive_type\": \"DT_SIGNED_INT32\"},\n" + " },\n" + " ],\n" + " \"primary_keys\": [\"id\"],\n" + " }\n" + " ],\n" + " \"edge_types\": [\n" + " {\n" + " \"type_name\": \"knows\",\n" + " \"vertex_type_pair_relations\": [\n" + " {\n" + " \"source_vertex\": \"person\",\n" + " \"destination_vertex\": \"person\",\n" + " \"relation\": \"MANY_TO_MANY\",\n" + " }\n" + " ],\n" + " \"properties\": [\n" + " {\n" + " \"property_name\": \"weight\",\n" + " \"property_type\": {\"primitive_type\": \"DT_DOUBLE\"},\n" + " }\n" + " ],\n" + " \"primary_keys\": [],\n" + " }\n" + " ],\n" + " },\n" + "}"; private static final String MODERN_GRAPH_BULK_LOADING_JSON = "{\n" + " \"vertex_mappings\": [\n" + " {\n" + " \"type_name\": \"person\",\n" + " \"inputs\": [\"@/tmp/person.csv\"],\n" + " \"column_mappings\": [\n" + " {\"column\": {\"index\": 0, \"name\": \"id\"}, \"property\": \"id\"},\n" + " {\"column\": {\"index\": 1, \"name\": \"name\"}, \"property\": \"name\"},\n" + " {\"column\": {\"index\": 2, \"name\": \"age\"}, \"property\": \"age\"},\n" + " ],\n" + " }\n" + " ],\n" + " \"edge_mappings\": [\n" + " {\n" + " \"type_triplet\": {\n" + " \"edge\": \"knows\",\n" + " \"source_vertex\": \"person\",\n" + " \"destination_vertex\": \"person\",\n" + " },\n" + " \"inputs\": [\n" + " \"@/tmp/person_knows_person.csv\"\n" + " ],\n" + " \"source_vertex_mappings\": [\n" + " {\"column\": {\"index\": 0, \"name\": \"person.id\"}, \"property\": \"id\"}\n" + " ],\n" + " \"destination_vertex_mappings\": [\n" + " {\"column\": {\"index\": 1, \"name\": \"person.id\"}, \"property\": \"id\"}\n" + " ],\n" + " \"column_mappings\": [\n" + " {\"column\": {\"index\": 2, \"name\": \"weight\"}, \"property\": \"weight\"}\n" + " ],\n" + " }\n" + " ],\n" + "}"; public static void main(String[] args) throws IOException { Driver driver = Driver.connect(); Session session = driver.session(); ``` -------------------------------- ### Running examples for out() step Source: https://graphscope.io/docs/interactive_engine/tinkerpop/supported_gremlin_steps Interactive console examples showing the output of various out() step configurations. ```gremlin gremlin> g.V().out("1..3", "knows").with('RESULT_OPT', 'ALL_V') ==>[v[1], v[2]] ==>[v[1], v[4]] gremlin> g.V().out("1..3", "knows").with('RESULT_OPT', 'ALL_V_E') ==>[v[1], e[0][1-knows->2], v[2]] ==>[v[1], e[2][1-knows->4], v[4]] gremlin> g.V().out("1..3", "knows").with('RESULT_OPT', 'END_V').endV() ==>v[2] ==>v[4] gremlin> g.V().out("1..3", "knows").with('RESULT_OPT', 'ALL_V').values("name") ==>[marko, vadas] ==>[marko, josh] gremlin> g.V().out("1..3", "knows").with('RESULT_OPT', 'ALL_V').valueMap("id","name") ==>{id=[[1, 2]], name=[[marko, vadas]]} ==>{id=[[1, 4]], name=[[marko, josh]]} ``` -------------------------------- ### Build Giraph Examples Source: https://graphscope.io/docs/analytical_engine/tutorial_run_giraph_apps Clone the official Giraph repository and package the examples using Maven. ```bash git clone https://github.com/apache/giraph.git cd giraph/ mvn package -pl :giraph-examples ``` -------------------------------- ### Install and Initialize GraphScope Source: https://graphscope.io/docs/blog/tech/2026/04/20/Star-Counts-Lied-Graph-Database-Health-Check.html Install the GraphScope package and initialize a session to load graph data. ```bash pip install graphscope ``` ```python import graphscope sess = graphscope.session() from graphscope.dataset.ogbn_mag import load_ogbn_mag g = load_ogbn_mag(sess, "testing_data") ``` -------------------------------- ### Curl Request Example Source: https://graphscope.io/docs/flex/interactive/development/restful_api Example of using curl to perform a GET request to the vertex endpoint. ```bash curl -X GET \ -H "Accept: application/json" \ "https://virtserver.swaggerhub.com/GRAPHSCOPE/InteractiveAPI/1.0.0/v1/graph/{graph_id}/vertex?label=label_example&primary_key_value=" ``` -------------------------------- ### PHP SDK Service Status Example Source: https://graphscope.io/docs/flex/coordinator/restful_api Example implementation using the PHP OpenAPI client. ```php listServiceStatus(); print_r($result); } catch (Exception $e) { echo 'Exception when calling ServiceApi->listServiceStatus: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Running Java SDK Example Source: https://graphscope.io/docs/interactive_engine/graph_planner Command to execute the compiled Java SDK example with required configuration files. ```bash java -cp ".:./libs/*" com.alibaba.graphscope.sdk.examples.TestGraphPlanner ./conf/gs_interactive_hiactor.yaml "Match (n) Return n;" ./conf/graph.yaml ./conf/modern_statistics.json ``` -------------------------------- ### Rust SDK Service Status Example Source: https://graphscope.io/docs/flex/coordinator/restful_api Example implementation using the Rust OpenAPI client. ```rust extern crate ServiceApi; pub fn main() { let mut context = ServiceApi::Context::default(); let result = client.listServiceStatus(&context).wait(); println!("{:?}", result); } ``` -------------------------------- ### Execute Example Binary Source: https://graphscope.io/docs/interactive_engine/graph_planner Command to run the test_graph_planner binary with required paths and query parameters. ```bash # bin/test_graph_planner bin/test_graph_planner libs native ./conf/graph.yaml ./conf/modern_statistics.json "MATCH (n) RETURN n, COUNT(n);" ./conf/gs_interactive_hiactor.yaml ``` -------------------------------- ### Start Service with Python Client Source: https://graphscope.io/docs/flex/coordinator/restful_api Demonstrates initializing the ServiceApi and invoking the start_service method. ```python from __future__ import print_statement import time import openapi_client from openapi_client.rest import ApiException from pprint import pprint # Create an instance of the API class api_instance = openapi_client.ServiceApi() startServiceRequest = # StartServiceRequest | (optional) try: api_response = api_instance.start_service(startServiceRequest=startServiceRequest) pprint(api_response) except ApiException as e: print("Exception when calling ServiceApi->startService: %s\n" % e) ``` -------------------------------- ### Python SDK Service Status Example Source: https://graphscope.io/docs/flex/coordinator/restful_api Example implementation using the Python OpenAPI client. ```python from __future__ import print_statement import time import openapi_client from openapi_client.rest import ApiException from pprint import pprint # Create an instance of the API class api_instance = openapi_client.ServiceApi() try { api_response = api_instance.list_service_status() pprint(api_response) except ApiException as e: print("Exception when calling ServiceApi->listServiceStatus: %s\n" % e) ``` -------------------------------- ### Run GraphScope in Docker Source: https://graphscope.io/docs/deployment/install_on_local Starts a Docker container and installs necessary dependencies for GraphScope. ```bash docker run --name dev -it --shm-size=4096m ubuntu:latest # inside the docker apt-get update -y && apt-get install python3-pip default-jdk -y python3 -m pip install graphscope ipython tensorflow ``` -------------------------------- ### Install and Deploy Interactive Instance Source: https://graphscope.io/docs/flex/coordinator/getting_started Install the gsctl command-line tool and deploy an Interactive instance in local mode. ```bash pip3 install gsctl # Deploy the Interactive instance in local mode gsctl instance deploy --type interactive ``` -------------------------------- ### Java SDK Service Status Example Source: https://graphscope.io/docs/flex/coordinator/restful_api Example implementation using the Java OpenAPI client. ```java import org.openapitools.client.*; import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.ServiceApi; import java.io.File; import java.util.*; public class ServiceApiExample { public static void main(String[] args) { // Create an instance of the API class ServiceApi apiInstance = new ServiceApi(); try { array[ServiceStatus] result = apiInstance.listServiceStatus(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ServiceApi#listServiceStatus"); e.printStackTrace(); } } } ``` ```java import org.openapitools.client.api.ServiceApi; public class ServiceApiExample { public static void main(String[] args) { ServiceApi apiInstance = new ServiceApi(); try { array[ServiceStatus] result = apiInstance.listServiceStatus(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ServiceApi#listServiceStatus"); e.printStackTrace(); } } } ``` -------------------------------- ### Install Dependencies and Build Locally Source: https://graphscope.io/docs/flex/coordinator/development/dev_and_test Commands to install the gsctl utility, set up minimal dependencies, and build the Coordinator. ```bash pip3 install gsctl # install coordinator dependencies # dev-learning is the minimal set of dependencies to build coordinator gsctl install-deps dev-learning # build cd GraphScope && make coordinator ``` -------------------------------- ### Get Out-Edge Offsets Begin Pointer Source: https://graphscope.io/docs/reference/gae_java/com/alibaba/graphscope/fragment/ArrowProjectedFragment_cxx_0x57e61773 Retrieves the starting pointer for out-edge offsets. ```java public @com.alibaba.fastffi.FFINameAlias("get_oe_offsets_begin_ptr") long getOEOffsetsBeginPtr() ``` ```java public static @com.alibaba.fastffi.FFINameAlias("get_oe_offsets_begin_ptr") long nativeGetOEOffsetsBeginPtr(long ptr) ``` -------------------------------- ### Get Edge Dart Example Source: https://graphscope.io/docs/flex/interactive/development/restful_api Retrieves edge properties using the Dart SDK. ```dart import 'package:openapi/api.dart'; final api_instance = DefaultApi(); final String graphId = new String(); // String | final String edgeLabel = new String(); // String | The label name of querying edge. final String srcLabel = new String(); // String | The label name of src vertex. final oas_any_type_not_mapped srcPrimaryKeyValue = new oas_any_type_not_mapped(); // oas_any_type_not_mapped | The primary key value of src vertex. final String dstLabel = new String(); // String | The label name of dst vertex. final oas_any_type_not_mapped dstPrimaryKeyValue = new oas_any_type_not_mapped(); // oas_any_type_not_mapped | The value of dst vertex's primary key try { final result = await api_instance.getEdge(graphId, edgeLabel, srcLabel, srcPrimaryKeyValue, dstLabel, dstPrimaryKeyValue); print(result); } catch (e) { print('Exception when calling DefaultApi->getEdge: $e\n'); } ``` -------------------------------- ### Get Edge Java Example Source: https://graphscope.io/docs/flex/interactive/development/restful_api Retrieves edge properties using the Java SDK. ```java import org.openapitools.client.*; import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.GraphServiceEdgeManagementApi; import java.io.File; import java.util.*; public class GraphServiceEdgeManagementApiExample { public static void main(String[] args) { // Create an instance of the API class GraphServiceEdgeManagementApi apiInstance = new GraphServiceEdgeManagementApi(); String graphId = graphId_example; // String | String edgeLabel = created; // String | The label name of querying edge. String srcLabel = person; // String | The label name of src vertex. oas_any_type_not_mapped srcPrimaryKeyValue = 1; // oas_any_type_not_mapped | The primary key value of src vertex. String dstLabel = software; // String | The label name of dst vertex. oas_any_type_not_mapped dstPrimaryKeyValue = 3; // oas_any_type_not_mapped | The value of dst vertex's primary key try { EdgeData result = apiInstance.getEdge(graphId, edgeLabel, srcLabel, srcPrimaryKeyValue, dstLabel, dstPrimaryKeyValue); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling GraphServiceEdgeManagementApi#getEdge"); e.printStackTrace(); } } } ``` -------------------------------- ### Start Frontend Service Source: https://graphscope.io/docs/interactive_engine/dev_and_test Launches the Java-based frontend service using the provided configuration file. ```bash java -cp ".:$GIE_TEST_HOME/lib/*" -Djna.library.path=$GIE_TEST_HOME/lib com.alibaba.graphscope.frontend.Frontend $GIE_TEST_HOME/conf/frontend.vineyard.properties & ``` -------------------------------- ### Start the RESTful Service Source: https://graphscope.io/docs/interactive_engine/graph_planner Launch the Graph Planner service using the specified configuration file. ```bash java -cp ".:./libs/*" com.alibaba.graphscope.sdk.restful.GraphPlannerService --spring.config.location=./conf/application.yaml ``` -------------------------------- ### Get Iterator Start Source: https://graphscope.io/docs/reference/gae_java/com/alibaba/graphscope/ds/ImmutableCSR Returns an iterator pointing to the beginning of the neighbor list for a given vertex. ```java GrapeNbr getBegin​(VID_T lid) ``` -------------------------------- ### Interactive Configuration Example Source: https://graphscope.io/docs/flex/interactive/development/dev_and_test Configuration file defining service directories, compute engine settings, and compiler options. ```yaml directories: workspace: /tmp/interactive_workspace # The workspace to start service on. log_level: INFO default_graph: modern_graph # The graph to serve at the beginning compute_engine: type: hiactor workers: - localhost:10000 thread_num_per_worker: 1 store: type: cpp-mcsr metadata_store: type: file compiler: # Configurations for the Graph Compiler planner: is_on: true opt: RBO rules: - FilterIntoJoinRule - FilterMatchRule - NotMatchToAntiJoinRule meta: reader: schema: uri: http://localhost:7777/v1/service/status interval: 1000 # ms statistics: uri: http://localhost:7777/v1/graph/%s/statistics interval: 86400000 # ms endpoint: default_listen_address: localhost bolt_connector: disabled: false port: 7687 gremlin_connector: disabled: false port: 8182 query_timeout: 40000 gremlin_script_language_name: antlr_gremlin_calcite http_service: default_listen_address: localhost admin_port: 7777 query_port: 10000 ``` -------------------------------- ### Get Edge Curl Example Source: https://graphscope.io/docs/flex/interactive/development/restful_api Retrieves edge properties using a standard curl command. ```bash curl -X GET \ -H "Accept: application/json" \ "https://virtserver.swaggerhub.com/GRAPHSCOPE/InteractiveAPI/1.0.0/v1/graph/{graph_id}/edge?edge_label=created&src_label=person&src_primary_key_value=1&dst_label=software&dst_primary_key_value=3" ``` -------------------------------- ### HTTP GET Request Example Source: https://graphscope.io/docs/flex/interactive/development/java/VertexApi Generic representation of the HTTP request structure for vertex retrieval. ```http GET /endpoint?param1=value1¶m2=value2 HTTP/1.1 Host: example.com ``` -------------------------------- ### Curl Request Example Source: https://graphscope.io/docs/flex/coordinator/restful_api A standard curl command to perform a GET request to the stored procedure endpoint. ```bash curl -X GET \ -H "Accept: application/json" \ "http://localhost/api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}" ``` -------------------------------- ### Set up a virtual environment and install GraphScope Source: https://graphscope.io/docs/overview/getting_started Follow these steps to create a clean Python 3.9 virtual environment and install GraphScope. ```bash # Create a new virtual environment python3.9 -m venv tutorial-env # Activate the virtual environment source tutorial-env/bin/activate # Install GraphScope python3.9 -m pip install graphscope # Use GraphScope python3.9 >>> import graphscope as gs >>> ...... ``` -------------------------------- ### Get Graph by ID via Curl Source: https://graphscope.io/docs/flex/coordinator/restful_api Example request using curl to fetch graph data. ```bash curl -X GET \ -H "Accept: application/json" \ "http://localhost/api/v1/graph/{graph_id}" ``` -------------------------------- ### Get Deployment Status via Curl Source: https://graphscope.io/docs/flex/coordinator/restful_api A command-line example using curl to request the deployment status. ```bash curl -X GET \ -H "Accept: application/json" \ "http://localhost/api/v1/deployment/status" ``` -------------------------------- ### Create Data Loading Job SDK Samples Source: https://graphscope.io/docs/flex/interactive/development/restful_api Examples demonstrating how to initialize the AdminServiceGraphManagementApi and invoke the createDataloadingJob method in various languages. ```java import org.openapitools.client.api.AdminServiceGraphManagementApi; public class AdminServiceGraphManagementApiExample { public static void main(String[] args) { AdminServiceGraphManagementApi apiInstance = new AdminServiceGraphManagementApi(); String graphId = graphId_example; // String | The id of graph to do bulk loading. SchemaMapping schemaMapping = ; // SchemaMapping | try { JobResponse result = apiInstance.createDataloadingJob(graphId, schemaMapping); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdminServiceGraphManagementApi#createDataloadingJob"); e.printStackTrace(); } } } ``` ```objective-c // Create an instance of the API class AdminServiceGraphManagementApi *apiInstance = [[AdminServiceGraphManagementApi alloc] init]; String *graphId = graphId_example; // The id of graph to do bulk loading. (default to null) SchemaMapping *schemaMapping = ; // [apiInstance createDataloadingJobWith:graphId schemaMapping:schemaMapping completionHandler: ^(JobResponse output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }]; ``` ```javascript var GraphScopeInteractiveApiV03 = require('graph_scope_interactive_api_v0_3'); // Create an instance of the API class var api = new GraphScopeInteractiveApiV03.AdminServiceGraphManagementApi() var graphId = graphId_example; // {String} The id of graph to do bulk loading. var schemaMapping = ; // {SchemaMapping} var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.createDataloadingJob(graphId, schemaMapping, callback); ``` ```csharp using System; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; using Org.OpenAPITools.Model; namespace Example { public class createDataloadingJobExample { public void main() { // Create an instance of the API class var apiInstance = new AdminServiceGraphManagementApi(); var graphId = graphId_example; // String | The id of graph to do bulk loading. (default to null) var schemaMapping = new SchemaMapping(); // SchemaMapping | try { JobResponse result = apiInstance.createDataloadingJob(graphId, schemaMapping); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling AdminServiceGraphManagementApi.createDataloadingJob: " + e.Message ); } } } } ``` ```php createDataloadingJob($graphId, $schemaMapping); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdminServiceGraphManagementApi->createDataloadingJob: ', $e->getMessage(), PHP_EOL; } ?> ``` ```perl use Data::Dumper; use WWW::OPenAPIClient::Configuration; use WWW::OPenAPIClient::AdminServiceGraphManagementApi; # Create an instance of the API class my $api_instance = WWW::OPenAPIClient::AdminServiceGraphManagementApi->new(); my $graphId = graphId_example; # String | The id of graph to do bulk loading. my $schemaMapping = WWW::OPenAPIClient::Object::SchemaMapping->new(); # SchemaMapping | eval { my $result = $api_instance->createDataloadingJob(graphId => $graphId, schemaMapping => $schemaMapping); print Dumper($result); }; if ($@) { warn "Exception when calling AdminServiceGraphManagementApi->createDataloadingJob: $@\n"; } ``` ```python from __future__ import print_statement import time import openapi_client from openapi_client.rest import ApiException from pprint import pprint # Create an instance of the API class api_instance = openapi_client.AdminServiceGraphManagementApi() graphId = graphId_example # String | The id of graph to do bulk loading. (default to null) schemaMapping = # SchemaMapping | try: api_response = api_instance.create_dataloading_job(graphId, schemaMapping) pprint(api_response) except ApiException as e: print("Exception when calling AdminServiceGraphManagementApi->createDataloadingJob: %s\n" % e) ``` ```rust extern crate AdminServiceGraphManagementApi; pub fn main() { let graphId = graphId_example; // String let schemaMapping = ; // SchemaMapping let mut context = AdminServiceGraphManagementApi::Context::default(); let result = client.createDataloadingJob(graphId, schemaMapping, &context).wait(); println!("{:?}", result); } ``` -------------------------------- ### startServer Source: https://graphscope.io/docs/reference/gae_java/com/alibaba/graphscope/parallel/netty/NettyServer Starts the Netty server. ```APIDOC ## void startServer() ### Description Starts the Netty server to begin listening for incoming network requests. ``` -------------------------------- ### List Jobs via Curl Source: https://graphscope.io/docs/flex/coordinator/restful_api A command-line example using curl to perform a GET request to the listJobs endpoint. ```bash curl -X GET \ -H "Accept: application/json" \ "http://localhost/api/v1/job" ``` -------------------------------- ### Generate JAR for manual installation Source: https://graphscope.io/docs/flex/interactive/development/java/java_sdk Use this command to package the SDK into a JAR file. ```bash mvn clean package ``` -------------------------------- ### Get Data Source by ID in Java Source: https://graphscope.io/docs/flex/coordinator/restful_api Examples for using the Java SDK to fetch data source information. ```java import org.openapitools.client.*; import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.DataSourceApi; import java.io.File; import java.util.*; public class DataSourceApiExample { public static void main(String[] args) { // Create an instance of the API class DataSourceApi apiInstance = new DataSourceApi(); String graphId = graphId_example; // String | try { SchemaMapping result = apiInstance.getDatasourceById(graphId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DataSourceApi#getDatasourceById"); e.printStackTrace(); } } } ``` ```java import org.openapitools.client.api.DataSourceApi; public class DataSourceApiExample { public static void main(String[] args) { DataSourceApi apiInstance = new DataSourceApi(); String graphId = graphId_example; // String | try { SchemaMapping result = apiInstance.getDatasourceById(graphId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DataSourceApi#getDatasourceById"); e.printStackTrace(); } } } ``` -------------------------------- ### Start Service in PHP Source: https://graphscope.io/docs/flex/coordinator/restful_api Implementation using the PHP OpenAPI client. ```php startService($startServiceRequest); print_r($result); } catch (Exception $e) { echo 'Exception when calling ServiceApi->startService: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Get Data Loading Job Configuration Source: https://graphscope.io/docs/flex/coordinator/restful_api Examples for retrieving data loading configurations via REST API or SDKs. ```bash curl -X POST \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ "http://localhost/api/v1/graph/{graph_id}/dataloading/config" \ -d '{ "schedule" : "schedule", "loading_config" : { "format" : { "metadata" : { "key" : "" }, "type" : "type" }, "import_option" : "overwrite" }, "vertices" : [ { "type_name" : "type_name" }, { "type_name" : "type_name" } ], "repeat" : "once", "edges" : [ { "type_name" : "type_name", "source_vertex" : "source_vertex", "destination_vertex" : "destination_vertex" }, { "type_name" : "type_name", "source_vertex" : "source_vertex", "destination_vertex" : "destination_vertex" } ] }' ``` ```java import org.openapitools.client.*; import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.JobApi; import java.io.File; import java.util.*; public class JobApiExample { public static void main(String[] args) { // Create an instance of the API class JobApi apiInstance = new JobApi(); String graphId = graphId_example; // String | DataloadingJobConfig dataloadingJobConfig = ; // DataloadingJobConfig | try { DataloadingMRJobConfig result = apiInstance.getDataloadingJobConfig(graphId, dataloadingJobConfig); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling JobApi#getDataloadingJobConfig"); e.printStackTrace(); } } } ``` ```dart import 'package:openapi/api.dart'; final api_instance = DefaultApi(); final String graphId = new String(); // String | final DataloadingJobConfig dataloadingJobConfig = new DataloadingJobConfig(); // DataloadingJobConfig | try { final result = await api_instance.getDataloadingJobConfig(graphId, dataloadingJobConfig); print(result); } catch (e) { print('Exception when calling DefaultApi->getDataloadingJobConfig: $e\n'); } ``` ```java import org.openapitools.client.api.JobApi; public class JobApiExample { public static void main(String[] args) { JobApi apiInstance = new JobApi(); String graphId = graphId_example; // String | DataloadingJobConfig dataloadingJobConfig = ; // DataloadingJobConfig | try { DataloadingMRJobConfig result = apiInstance.getDataloadingJobConfig(graphId, dataloadingJobConfig); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling JobApi#getDataloadingJobConfig"); e.printStackTrace(); } } } ``` ```objective-c // Create an instance of the API class JobApi *apiInstance = [[JobApi alloc] init]; String *graphId = graphId_example; // (default to null) DataloadingJobConfig *dataloadingJobConfig = ; // [apiInstance getDataloadingJobConfigWith:graphId dataloadingJobConfig:dataloadingJobConfig completionHandler: ^(DataloadingMRJobConfig output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }]; ``` -------------------------------- ### Initialize Graph Learning Engine Source: https://graphscope.io/docs/_modules/graphscope/client/session Examples demonstrating how to configure the graph learning engine for supervised and unsupervised training tasks. ```python >>> # Assume the input graph contains one label node `paper` and one edge label `link`. >>> features = ["weight", "name"] # use properties "weight" and "name" as features >>> lg = sess.graphlearn( graph, nodes=[("paper", features)]) # use "paper" node and features for training edges=[("paper", "links", "paper")] # use the `paper->links->papers` edge type for training gen_labels=[ # split "paper" nodes into 100 pieces, and uses random 75 pieces (75%) as training dataset ("train", "paper", 100, (0, 75)), # split "paper" nodes into 100 pieces, and uses random 10 pieces (10%) as validation dataset ("val", "paper", 100, (75, 85)), # split "paper" nodes into 100 pieces, and uses random 15 pieces (15%) as test dataset ("test", "paper", 100, (85, 100)), ] ) ``` ```python >>> lg = sess.graphlearn( graph, nodes=[("paper", features)]) # use "paper" node and features for training edges=[("paper", "links", "paper")] # use the `paper->links->papers` edge type for training gen_labels=[ # split "paper" nodes into 100 pieces, and uses all pieces as training dataset ("train", "paper", 100, (0, 100)), ] ) ``` -------------------------------- ### Retrieve Deployment Information via Curl Source: https://graphscope.io/docs/flex/coordinator/restful_api Example of using curl to perform a GET request to the deployment information endpoint. ```bash curl -X GET \ -H "Accept: application/json" \ "http://localhost/api/v1/deployment" ``` -------------------------------- ### Start Service in Java Source: https://graphscope.io/docs/flex/coordinator/restful_api Implementation using the Java OpenAPI client. ```java import org.openapitools.client.*; import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.ServiceApi; import java.io.File; import java.util.*; public class ServiceApiExample { public static void main(String[] args) { // Create an instance of the API class ServiceApi apiInstance = new ServiceApi(); StartServiceRequest startServiceRequest = ; // StartServiceRequest | try { 'String' result = apiInstance.startService(startServiceRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ServiceApi#startService"); e.printStackTrace(); } } } ``` ```java import org.openapitools.client.api.ServiceApi; public class ServiceApiExample { public static void main(String[] args) { ServiceApi apiInstance = new ServiceApi(); StartServiceRequest startServiceRequest = ; // StartServiceRequest | try { 'String' result = apiInstance.startService(startServiceRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ServiceApi#startService"); e.printStackTrace(); } } } ``` -------------------------------- ### Get Procedure Details via SDKs Source: https://graphscope.io/docs/flex/interactive/development/restful_api Examples for retrieving specific procedure details using PHP, Perl, Python, and Rust SDKs. ```php getProcedure($graphId, $procedureId); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdminServiceProcedureManagementApi->getProcedure: ', $e->getMessage(), PHP_EOL; } ?> ``` ```perl use Data::Dumper; use WWW::OPenAPIClient::Configuration; use WWW::OPenAPIClient::AdminServiceProcedureManagementApi; # Create an instance of the API class my $api_instance = WWW::OPenAPIClient::AdminServiceProcedureManagementApi->new(); my $graphId = graphId_example; # String | my $procedureId = procedureId_example; # String | eval { my $result = $api_instance->getProcedure(graphId => $graphId, procedureId => $procedureId); print Dumper($result); }; if ($@) { warn "Exception when calling AdminServiceProcedureManagementApi->getProcedure: $@\n"; } ``` ```python from __future__ import print_statement import time import openapi_client from openapi_client.rest import ApiException from pprint import pprint # Create an instance of the API class api_instance = openapi_client.AdminServiceProcedureManagementApi() graphId = graphId_example # String | (default to null) procedureId = procedureId_example # String | (default to null) try: api_response = api_instance.get_procedure(graphId, procedureId) pprint(api_response) except ApiException as e: print("Exception when calling AdminServiceProcedureManagementApi->getProcedure: %s\n" % e) ``` ```rust extern crate AdminServiceProcedureManagementApi; pub fn main() { let graphId = graphId_example; // String let procedureId = procedureId_example; // String let mut context = AdminServiceProcedureManagementApi::Context::default(); let result = client.getProcedure(graphId, procedureId, &context).wait(); println!("{:?}", result); } ```