会话¶
会话接口¶
DefaultSession 类¶
- class gs_interactive.client.session.DefaultSession(admin_uri: str, stored_proc_uri: str | None = None)[源代码]¶
Interactive SDK的默认会话实现。 它提供了所有服务API的实现。
- __init__(admin_uri: str, stored_proc_uri: str | None = None)[源代码]¶
使用指定的admin_uri和stored_proc_uri构建一个新的会话。
- Parameters:
admin_uri (str) – 管理服务的URI地址。
stored_proc_uri (str, optional) – 存储过程服务的URI地址。 如果未提供,将从服务状态中读取该URI。
- add_vertex(graph_id: str[str], vertex_edge_request: VertexEdgeRequest) 结果[str[str]][源代码]¶
向指定图添加一个顶点。
- create_procedure(graph_id: str[str], procedure: CreateProcedureRequest) 结果[CreateProcedureResponse][源代码]¶
在指定图中创建一个新的存储过程。
- get_edge(graph_id: str[str], edge_label: str[str], src_label: str[str], src_primary_key_value: Any[Any], dst_label: str[str], dst_primary_key_value: Any[Any]) 结果[None | EdgeRequest][源代码]¶
从指定图中获取具有主键值的边。
- get_graph_schema(graph_id: str[str]) 结果[GetGraphSchemaResponse][源代码]¶
获取指定图的结构模式。
- Parameters:
graph_id (str) – 要获取其schema的图的ID。
- Returns:
- 包含以下内容的结果
指定图的模式结构。
- Return type:
Result[GetGraphSchemaResponse]
- get_procedure(graph_id: str[str], procedure_id: str[str]) 结果[GetProcedureResponse][源代码]¶
获取指定图中的存储过程。
- get_vertex(graph_id: str[str], label: str[str], primary_key_value: Any[Any]) 结果[VertexData][源代码]¶
从指定图中根据主键值获取一个顶点。
- start_service(start_service_request: StartServiceRequest | None[StartServiceRequest | None] | None = None) 结果[str][源代码]¶
在指定图上启动服务。
- try_upload_files(schema_mapping: SchemaMapping) 结果[SchemaMapping][源代码]¶
如果输入文件在schema_mapping中以@开头指定,请尝试上传这些输入文件。将上传文件的路径替换为服务器返回的路径。
可以在schema_mapping.loading_config中的data_source.location开头添加@符号,或者在vertex_mappings和edge_mappings中的每个文件前添加@符号。
- location: @/path/to/dir
- inputs:
@/path/to/file1
@/path/to/file2
- location: /path/to/dir
- inputs:
@/path/to/file1
@/path/to/file2
- location: @/path/to/dir
- inputs:
/path/to/file1
/path/to/file2
- location: /path/to/dir
- inputs:
/path/to/file1
/path/to/file2
- location: None
- inputs:
@/path/to/file1
@/path/to/file2
在上述4种情况中,只有第1、3、5种情况是有效的,对于第2、4种情况文件将不会被上传
- update_procedure(graph_id: str[str], proc_id: str[str], procedure: UpdateProcedureRequest) 结果[str][源代码]¶
在指定图中更新一个存储过程。