cortexdb-client 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cortexdb_client-0.1.0/.gitignore +4 -0
- cortexdb_client-0.1.0/PKG-INFO +86 -0
- cortexdb_client-0.1.0/README.md +64 -0
- cortexdb_client-0.1.0/cortexdb_client/__init__.py +25 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/__init__.py +0 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/__init__.py +0 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/__init__.py +0 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/admin_pb2.py +45 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/admin_pb2_grpc.py +140 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/common_pb2.py +55 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/common_pb2_grpc.py +24 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/graph_pb2.py +154 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/graph_pb2_grpc.py +785 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/graphrag_pb2.py +84 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/graphrag_pb2_grpc.py +312 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/knowledge_pb2.py +77 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/knowledge_pb2_grpc.py +269 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/memory_pb2.py +62 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/memory_pb2_grpc.py +269 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/tools_pb2.py +47 -0
- cortexdb_client-0.1.0/cortexdb_client/_pb/cortexdb/v1/tools_pb2_grpc.py +140 -0
- cortexdb_client-0.1.0/cortexdb_client/client.py +80 -0
- cortexdb_client-0.1.0/cortexdb_client/proto.py +24 -0
- cortexdb_client-0.1.0/examples/agent_memory.py +44 -0
- cortexdb_client-0.1.0/gen.sh +24 -0
- cortexdb_client-0.1.0/pyproject.toml +33 -0
- cortexdb_client-0.1.0/tests/test_integration.py +112 -0
- cortexdb_client-0.1.0/uv.lock +1284 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cortexdb-client
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Typed gRPC client for CortexDB (AI memory + knowledge graph sidecar)
|
|
5
|
+
Project-URL: Homepage, https://github.com/liliang-cn/cortexdb
|
|
6
|
+
Project-URL: Repository, https://github.com/liliang-cn/cortexdb
|
|
7
|
+
Author: Liang Li
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: agent-memory,ai,cortexdb,grpc,knowledge-graph,rag
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Topic :: Database
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Requires-Dist: grpcio>=1.60
|
|
16
|
+
Requires-Dist: protobuf>=4.25
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: build; extra == 'dev'
|
|
19
|
+
Requires-Dist: grpcio-tools>=1.60; extra == 'dev'
|
|
20
|
+
Requires-Dist: twine; extra == 'dev'
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# cortexdb-client (Python)
|
|
24
|
+
|
|
25
|
+
Typed gRPC client for [CortexDB](https://github.com/liliang-cn/cortexdb) — a
|
|
26
|
+
pure-Go, single-file AI memory and knowledge graph database, served as a
|
|
27
|
+
sidecar (`cortexdb-grpc`). Give your Python agent (e.g. **Hermes**) durable
|
|
28
|
+
memory **and** a queryable knowledge graph.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install cortexdb-client # or: uv add cortexdb-client
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Start the sidecar (one binary, one SQLite file):
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
go install github.com/liliang-cn/cortexdb/v2/cmd/cortexdb-grpc@latest
|
|
40
|
+
CORTEXDB_PATH=agent.db CORTEXDB_GRPC_TOKEN=s3cret cortexdb-grpc
|
|
41
|
+
# listening on 127.0.0.1:47821
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Quick start
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from cortexdb_client import CortexClient, proto
|
|
48
|
+
|
|
49
|
+
with CortexClient.connect("127.0.0.1:47821", token="s3cret") as client:
|
|
50
|
+
client.knowledge.SaveKnowledge(proto.SaveKnowledgeRequest(
|
|
51
|
+
knowledge_id="note-1",
|
|
52
|
+
content="The user is building an autonomous research agent in Python.",
|
|
53
|
+
))
|
|
54
|
+
hits = client.knowledge.SearchKnowledge(proto.SearchKnowledgeRequest(
|
|
55
|
+
query="what is the user building?", top_k=3,
|
|
56
|
+
))
|
|
57
|
+
for h in hits.results:
|
|
58
|
+
print(h.knowledge_id, h.score, h.snippet)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Sub-clients mirror the Rust crate: `client.knowledge`, `client.memory`,
|
|
62
|
+
`client.graph` (SPARQL/RDF/SHACL/inference/ontology), `client.graphrag`,
|
|
63
|
+
`client.tools` (generic tool dispatch, same surface as MCP), `client.admin`.
|
|
64
|
+
|
|
65
|
+
## Why a knowledge graph, not just vectors
|
|
66
|
+
|
|
67
|
+
Beyond semantic recall, the `graph` service lets an agent store and traverse
|
|
68
|
+
**entities and relations** — multi-hop questions like "who, among the people
|
|
69
|
+
Alice knows, works on X" — with SPARQL, RDFS-lite inference, and SHACL-lite
|
|
70
|
+
validation. That is the capability most agent-memory layers lack.
|
|
71
|
+
|
|
72
|
+
## Embeddings
|
|
73
|
+
|
|
74
|
+
Lexical mode needs no keys. Point the sidecar at any OpenAI-compatible
|
|
75
|
+
embeddings endpoint (e.g. Ollama) to enable vector retrieval:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
OPENAI_BASE_URL=http://localhost:11434/v1 \
|
|
79
|
+
CORTEXDB_EMBED_MODEL=embeddinggemma CORTEXDB_EMBED_DIM=768 \
|
|
80
|
+
cortexdb-grpc
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Regenerating the protobuf code
|
|
84
|
+
|
|
85
|
+
Generated code is committed under `cortexdb_client/_pb`. To regenerate after a
|
|
86
|
+
proto change: `uv run --extra dev ./gen.sh`.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# cortexdb-client (Python)
|
|
2
|
+
|
|
3
|
+
Typed gRPC client for [CortexDB](https://github.com/liliang-cn/cortexdb) — a
|
|
4
|
+
pure-Go, single-file AI memory and knowledge graph database, served as a
|
|
5
|
+
sidecar (`cortexdb-grpc`). Give your Python agent (e.g. **Hermes**) durable
|
|
6
|
+
memory **and** a queryable knowledge graph.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install cortexdb-client # or: uv add cortexdb-client
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Start the sidecar (one binary, one SQLite file):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
go install github.com/liliang-cn/cortexdb/v2/cmd/cortexdb-grpc@latest
|
|
18
|
+
CORTEXDB_PATH=agent.db CORTEXDB_GRPC_TOKEN=s3cret cortexdb-grpc
|
|
19
|
+
# listening on 127.0.0.1:47821
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick start
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from cortexdb_client import CortexClient, proto
|
|
26
|
+
|
|
27
|
+
with CortexClient.connect("127.0.0.1:47821", token="s3cret") as client:
|
|
28
|
+
client.knowledge.SaveKnowledge(proto.SaveKnowledgeRequest(
|
|
29
|
+
knowledge_id="note-1",
|
|
30
|
+
content="The user is building an autonomous research agent in Python.",
|
|
31
|
+
))
|
|
32
|
+
hits = client.knowledge.SearchKnowledge(proto.SearchKnowledgeRequest(
|
|
33
|
+
query="what is the user building?", top_k=3,
|
|
34
|
+
))
|
|
35
|
+
for h in hits.results:
|
|
36
|
+
print(h.knowledge_id, h.score, h.snippet)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Sub-clients mirror the Rust crate: `client.knowledge`, `client.memory`,
|
|
40
|
+
`client.graph` (SPARQL/RDF/SHACL/inference/ontology), `client.graphrag`,
|
|
41
|
+
`client.tools` (generic tool dispatch, same surface as MCP), `client.admin`.
|
|
42
|
+
|
|
43
|
+
## Why a knowledge graph, not just vectors
|
|
44
|
+
|
|
45
|
+
Beyond semantic recall, the `graph` service lets an agent store and traverse
|
|
46
|
+
**entities and relations** — multi-hop questions like "who, among the people
|
|
47
|
+
Alice knows, works on X" — with SPARQL, RDFS-lite inference, and SHACL-lite
|
|
48
|
+
validation. That is the capability most agent-memory layers lack.
|
|
49
|
+
|
|
50
|
+
## Embeddings
|
|
51
|
+
|
|
52
|
+
Lexical mode needs no keys. Point the sidecar at any OpenAI-compatible
|
|
53
|
+
embeddings endpoint (e.g. Ollama) to enable vector retrieval:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
OPENAI_BASE_URL=http://localhost:11434/v1 \
|
|
57
|
+
CORTEXDB_EMBED_MODEL=embeddinggemma CORTEXDB_EMBED_DIM=768 \
|
|
58
|
+
cortexdb-grpc
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Regenerating the protobuf code
|
|
62
|
+
|
|
63
|
+
Generated code is committed under `cortexdb_client/_pb`. To regenerate after a
|
|
64
|
+
proto change: `uv run --extra dev ./gen.sh`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Typed gRPC client for the CortexDB sidecar (``cortexdb-grpc``).
|
|
2
|
+
|
|
3
|
+
Example::
|
|
4
|
+
|
|
5
|
+
from cortexdb_client import CortexClient
|
|
6
|
+
from cortexdb_client import proto
|
|
7
|
+
|
|
8
|
+
with CortexClient.connect("127.0.0.1:47821", token="s3cret") as client:
|
|
9
|
+
client.knowledge.save_knowledge(
|
|
10
|
+
proto.SaveKnowledgeRequest(knowledge_id="k1", content="hello from python")
|
|
11
|
+
)
|
|
12
|
+
hits = client.knowledge.search_knowledge(
|
|
13
|
+
proto.SearchKnowledgeRequest(query="hello", top_k=3)
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
The sub-client accessors mirror the Rust crate: ``client.knowledge``,
|
|
17
|
+
``client.memory``, ``client.graph``, ``client.graphrag``, ``client.tools``,
|
|
18
|
+
``client.admin``.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from .client import CortexClient
|
|
22
|
+
from . import proto
|
|
23
|
+
|
|
24
|
+
__all__ = ["CortexClient", "proto"]
|
|
25
|
+
__version__ = "0.1.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: cortexdb/v1/admin.proto
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
|
+
'',
|
|
18
|
+
'cortexdb/v1/admin.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x63ortexdb/v1/admin.proto\x12\x0b\x63ortexdb.v1\"\x0f\n\rHealthRequest\"\x1c\n\x0eHealthResponse\x12\n\n\x02ok\x18\x01 \x01(\x08\"\r\n\x0bInfoRequest\"F\n\x0cInfoResponse\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x0f\n\x07\x64\x62_path\x18\x02 \x01(\t\x12\x14\n\x0chas_embedder\x18\x03 \x01(\x08\x32\x8e\x01\n\x0c\x41\x64minService\x12\x41\n\x06Health\x12\x1a.cortexdb.v1.HealthRequest\x1a\x1b.cortexdb.v1.HealthResponse\x12;\n\x04Info\x12\x18.cortexdb.v1.InfoRequest\x1a\x19.cortexdb.v1.InfoResponseB4Z2github.com/liliang-cn/cortexdb/v2/pkg/rpc/v1;rpcv1b\x06proto3')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'cortexdb.v1.admin_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
34
|
+
_globals['DESCRIPTOR']._serialized_options = b'Z2github.com/liliang-cn/cortexdb/v2/pkg/rpc/v1;rpcv1'
|
|
35
|
+
_globals['_HEALTHREQUEST']._serialized_start=40
|
|
36
|
+
_globals['_HEALTHREQUEST']._serialized_end=55
|
|
37
|
+
_globals['_HEALTHRESPONSE']._serialized_start=57
|
|
38
|
+
_globals['_HEALTHRESPONSE']._serialized_end=85
|
|
39
|
+
_globals['_INFOREQUEST']._serialized_start=87
|
|
40
|
+
_globals['_INFOREQUEST']._serialized_end=100
|
|
41
|
+
_globals['_INFORESPONSE']._serialized_start=102
|
|
42
|
+
_globals['_INFORESPONSE']._serialized_end=172
|
|
43
|
+
_globals['_ADMINSERVICE']._serialized_start=175
|
|
44
|
+
_globals['_ADMINSERVICE']._serialized_end=317
|
|
45
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
from cortexdb_client._pb.cortexdb.v1 import admin_pb2 as cortexdb_dot_v1_dot_admin__pb2
|
|
7
|
+
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.81.0'
|
|
9
|
+
GRPC_VERSION = grpc.__version__
|
|
10
|
+
_version_not_supported = False
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from grpc._utilities import first_version_is_lower
|
|
14
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
15
|
+
except ImportError:
|
|
16
|
+
_version_not_supported = True
|
|
17
|
+
|
|
18
|
+
if _version_not_supported:
|
|
19
|
+
raise RuntimeError(
|
|
20
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
21
|
+
+ ' but the generated code in cortexdb/v1/admin_pb2_grpc.py depends on'
|
|
22
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
23
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
24
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class AdminServiceStub:
|
|
29
|
+
"""Missing associated documentation comment in .proto file."""
|
|
30
|
+
|
|
31
|
+
def __init__(self, channel):
|
|
32
|
+
"""Constructor.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
channel: A grpc.Channel.
|
|
36
|
+
"""
|
|
37
|
+
self.Health = channel.unary_unary(
|
|
38
|
+
'/cortexdb.v1.AdminService/Health',
|
|
39
|
+
request_serializer=cortexdb_dot_v1_dot_admin__pb2.HealthRequest.SerializeToString,
|
|
40
|
+
response_deserializer=cortexdb_dot_v1_dot_admin__pb2.HealthResponse.FromString,
|
|
41
|
+
_registered_method=True)
|
|
42
|
+
self.Info = channel.unary_unary(
|
|
43
|
+
'/cortexdb.v1.AdminService/Info',
|
|
44
|
+
request_serializer=cortexdb_dot_v1_dot_admin__pb2.InfoRequest.SerializeToString,
|
|
45
|
+
response_deserializer=cortexdb_dot_v1_dot_admin__pb2.InfoResponse.FromString,
|
|
46
|
+
_registered_method=True)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class AdminServiceServicer:
|
|
50
|
+
"""Missing associated documentation comment in .proto file."""
|
|
51
|
+
|
|
52
|
+
def Health(self, request, context):
|
|
53
|
+
"""Missing associated documentation comment in .proto file."""
|
|
54
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
55
|
+
context.set_details('Method not implemented!')
|
|
56
|
+
raise NotImplementedError('Method not implemented!')
|
|
57
|
+
|
|
58
|
+
def Info(self, request, context):
|
|
59
|
+
"""Missing associated documentation comment in .proto file."""
|
|
60
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
61
|
+
context.set_details('Method not implemented!')
|
|
62
|
+
raise NotImplementedError('Method not implemented!')
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def add_AdminServiceServicer_to_server(servicer, server):
|
|
66
|
+
rpc_method_handlers = {
|
|
67
|
+
'Health': grpc.unary_unary_rpc_method_handler(
|
|
68
|
+
servicer.Health,
|
|
69
|
+
request_deserializer=cortexdb_dot_v1_dot_admin__pb2.HealthRequest.FromString,
|
|
70
|
+
response_serializer=cortexdb_dot_v1_dot_admin__pb2.HealthResponse.SerializeToString,
|
|
71
|
+
),
|
|
72
|
+
'Info': grpc.unary_unary_rpc_method_handler(
|
|
73
|
+
servicer.Info,
|
|
74
|
+
request_deserializer=cortexdb_dot_v1_dot_admin__pb2.InfoRequest.FromString,
|
|
75
|
+
response_serializer=cortexdb_dot_v1_dot_admin__pb2.InfoResponse.SerializeToString,
|
|
76
|
+
),
|
|
77
|
+
}
|
|
78
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
79
|
+
'cortexdb.v1.AdminService', rpc_method_handlers)
|
|
80
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
81
|
+
server.add_registered_method_handlers('cortexdb.v1.AdminService', rpc_method_handlers)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# This class is part of an EXPERIMENTAL API.
|
|
85
|
+
class AdminService:
|
|
86
|
+
"""Missing associated documentation comment in .proto file."""
|
|
87
|
+
|
|
88
|
+
@staticmethod
|
|
89
|
+
def Health(request,
|
|
90
|
+
target,
|
|
91
|
+
options=(),
|
|
92
|
+
channel_credentials=None,
|
|
93
|
+
call_credentials=None,
|
|
94
|
+
insecure=False,
|
|
95
|
+
compression=None,
|
|
96
|
+
wait_for_ready=None,
|
|
97
|
+
timeout=None,
|
|
98
|
+
metadata=None):
|
|
99
|
+
return grpc.experimental.unary_unary(
|
|
100
|
+
request,
|
|
101
|
+
target,
|
|
102
|
+
'/cortexdb.v1.AdminService/Health',
|
|
103
|
+
cortexdb_dot_v1_dot_admin__pb2.HealthRequest.SerializeToString,
|
|
104
|
+
cortexdb_dot_v1_dot_admin__pb2.HealthResponse.FromString,
|
|
105
|
+
options,
|
|
106
|
+
channel_credentials,
|
|
107
|
+
insecure,
|
|
108
|
+
call_credentials,
|
|
109
|
+
compression,
|
|
110
|
+
wait_for_ready,
|
|
111
|
+
timeout,
|
|
112
|
+
metadata,
|
|
113
|
+
_registered_method=True)
|
|
114
|
+
|
|
115
|
+
@staticmethod
|
|
116
|
+
def Info(request,
|
|
117
|
+
target,
|
|
118
|
+
options=(),
|
|
119
|
+
channel_credentials=None,
|
|
120
|
+
call_credentials=None,
|
|
121
|
+
insecure=False,
|
|
122
|
+
compression=None,
|
|
123
|
+
wait_for_ready=None,
|
|
124
|
+
timeout=None,
|
|
125
|
+
metadata=None):
|
|
126
|
+
return grpc.experimental.unary_unary(
|
|
127
|
+
request,
|
|
128
|
+
target,
|
|
129
|
+
'/cortexdb.v1.AdminService/Info',
|
|
130
|
+
cortexdb_dot_v1_dot_admin__pb2.InfoRequest.SerializeToString,
|
|
131
|
+
cortexdb_dot_v1_dot_admin__pb2.InfoResponse.FromString,
|
|
132
|
+
options,
|
|
133
|
+
channel_credentials,
|
|
134
|
+
insecure,
|
|
135
|
+
call_credentials,
|
|
136
|
+
compression,
|
|
137
|
+
wait_for_ready,
|
|
138
|
+
timeout,
|
|
139
|
+
metadata,
|
|
140
|
+
_registered_method=True)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: cortexdb/v1/common.proto
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
|
+
'',
|
|
18
|
+
'cortexdb/v1/common.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x63ortexdb/v1/common.proto\x12\x0b\x63ortexdb.v1\"\x83\x01\n\x10RetrievalFilters\x12\x12\n\ncollection\x18\x01 \x01(\t\x12\x14\n\x0c\x64ocument_ids\x18\x02 \x03(\t\x12\x0f\n\x07user_id\x18\x03 \x01(\t\x12\x12\n\nsession_id\x18\x04 \x01(\t\x12\r\n\x05scope\x18\x05 \x01(\t\x12\x11\n\tnamespace\x18\x06 \x01(\t\"\xba\x01\n\rRetrievalPlan\x12\r\n\x05query\x18\x01 \x01(\t\x12\x10\n\x08keywords\x18\x02 \x03(\t\x12\x19\n\x11\x61lternate_queries\x18\x03 \x03(\t\x12\x14\n\x0c\x65ntity_names\x18\x04 \x03(\t\x12\x16\n\x0eretrieval_mode\x18\x05 \x01(\t\x12\x33\n\x07\x66ilters\x18\x06 \x01(\x0b\x32\x1d.cortexdb.v1.RetrievalFiltersH\x00\x88\x01\x01\x42\n\n\x08_filters\"f\n\x11RetrievalDecision\x12\x16\n\x0erequested_mode\x18\x01 \x01(\t\x12\x16\n\x0e\x65\x66\x66\x65\x63tive_mode\x18\x02 \x01(\t\x12\x11\n\tuse_graph\x18\x03 \x01(\x08\x12\x0e\n\x06reason\x18\x04 \x01(\t\"\x92\x01\n\x13GraphRagChunkResult\x12\n\n\x02id\x18\x01 \x01(\t\x12\x13\n\x0b\x64ocument_id\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x01\x12\x12\n\nbase_score\x18\x05 \x01(\x01\x12\x14\n\x0crerank_score\x18\x06 \x01(\x01\x12\x10\n\x08\x65ntities\x18\x07 \x03(\t\"\xd0\x01\n\x0fToolEntityInput\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x11\n\tchunk_ids\x18\x05 \x03(\t\x12<\n\x08metadata\x18\x06 \x03(\x0b\x32*.cortexdb.v1.ToolEntityInput.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa0\x02\n\x11ToolRelationInput\x12\x0c\n\x04\x66rom\x18\x01 \x01(\t\x12\n\n\x02to\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x0e\n\x06weight\x18\x04 \x01(\x01\x12\x11\n\tchunk_ids\x18\x05 \x03(\t\x12>\n\x08metadata\x18\x06 \x03(\x0b\x32,.cortexdb.v1.ToolRelationInput.MetadataEntry\x12\x10\n\x08inferred\x18\x07 \x01(\x08\x12\x12\n\nprovenance\x18\x08 \x01(\t\x12\x0f\n\x07rule_id\x18\t \x01(\t\x12\x18\n\x10support_edge_ids\x18\n \x03(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x34Z2github.com/liliang-cn/cortexdb/v2/pkg/rpc/v1;rpcv1b\x06proto3')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'cortexdb.v1.common_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
34
|
+
_globals['DESCRIPTOR']._serialized_options = b'Z2github.com/liliang-cn/cortexdb/v2/pkg/rpc/v1;rpcv1'
|
|
35
|
+
_globals['_TOOLENTITYINPUT_METADATAENTRY']._loaded_options = None
|
|
36
|
+
_globals['_TOOLENTITYINPUT_METADATAENTRY']._serialized_options = b'8\001'
|
|
37
|
+
_globals['_TOOLRELATIONINPUT_METADATAENTRY']._loaded_options = None
|
|
38
|
+
_globals['_TOOLRELATIONINPUT_METADATAENTRY']._serialized_options = b'8\001'
|
|
39
|
+
_globals['_RETRIEVALFILTERS']._serialized_start=42
|
|
40
|
+
_globals['_RETRIEVALFILTERS']._serialized_end=173
|
|
41
|
+
_globals['_RETRIEVALPLAN']._serialized_start=176
|
|
42
|
+
_globals['_RETRIEVALPLAN']._serialized_end=362
|
|
43
|
+
_globals['_RETRIEVALDECISION']._serialized_start=364
|
|
44
|
+
_globals['_RETRIEVALDECISION']._serialized_end=466
|
|
45
|
+
_globals['_GRAPHRAGCHUNKRESULT']._serialized_start=469
|
|
46
|
+
_globals['_GRAPHRAGCHUNKRESULT']._serialized_end=615
|
|
47
|
+
_globals['_TOOLENTITYINPUT']._serialized_start=618
|
|
48
|
+
_globals['_TOOLENTITYINPUT']._serialized_end=826
|
|
49
|
+
_globals['_TOOLENTITYINPUT_METADATAENTRY']._serialized_start=779
|
|
50
|
+
_globals['_TOOLENTITYINPUT_METADATAENTRY']._serialized_end=826
|
|
51
|
+
_globals['_TOOLRELATIONINPUT']._serialized_start=829
|
|
52
|
+
_globals['_TOOLRELATIONINPUT']._serialized_end=1117
|
|
53
|
+
_globals['_TOOLRELATIONINPUT_METADATAENTRY']._serialized_start=779
|
|
54
|
+
_globals['_TOOLRELATIONINPUT_METADATAENTRY']._serialized_end=826
|
|
55
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
GRPC_GENERATED_VERSION = '1.81.0'
|
|
8
|
+
GRPC_VERSION = grpc.__version__
|
|
9
|
+
_version_not_supported = False
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
from grpc._utilities import first_version_is_lower
|
|
13
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
14
|
+
except ImportError:
|
|
15
|
+
_version_not_supported = True
|
|
16
|
+
|
|
17
|
+
if _version_not_supported:
|
|
18
|
+
raise RuntimeError(
|
|
19
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
20
|
+
+ ' but the generated code in cortexdb/v1/common_pb2_grpc.py depends on'
|
|
21
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
22
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
23
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
24
|
+
)
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: cortexdb/v1/graph.proto
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
|
+
'',
|
|
18
|
+
'cortexdb/v1/graph.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x63ortexdb/v1/graph.proto\x12\x0b\x63ortexdb.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"J\n\x07RdfTerm\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x10\n\x08\x64\x61tatype\x18\x03 \x01(\t\x12\x10\n\x08language\x18\x04 \x01(\t\"\xf6\x01\n\tRdfTriple\x12\n\n\x02id\x18\x01 \x01(\t\x12%\n\x07subject\x18\x02 \x01(\x0b\x32\x14.cortexdb.v1.RdfTerm\x12\'\n\tpredicate\x18\x03 \x01(\x0b\x32\x14.cortexdb.v1.RdfTerm\x12$\n\x06object\x18\x04 \x01(\x0b\x32\x14.cortexdb.v1.RdfTerm\x12(\n\x05graph\x18\x05 \x01(\x0b\x32\x14.cortexdb.v1.RdfTermH\x00\x88\x01\x01\x12\x10\n\x08inferred\x18\x06 \x01(\x08\x12\x0c\n\x04rule\x18\x07 \x01(\t\x12\x13\n\x0bsupport_ids\x18\x08 \x03(\tB\x08\n\x06_graph\"\xa0\x02\n\rTriplePattern\x12*\n\x07subject\x18\x01 \x01(\x0b\x32\x14.cortexdb.v1.RdfTermH\x00\x88\x01\x01\x12,\n\tpredicate\x18\x02 \x01(\x0b\x32\x14.cortexdb.v1.RdfTermH\x01\x88\x01\x01\x12)\n\x06object\x18\x03 \x01(\x0b\x32\x14.cortexdb.v1.RdfTermH\x02\x88\x01\x01\x12(\n\x05graph\x18\x04 \x01(\x0b\x32\x14.cortexdb.v1.RdfTermH\x03\x88\x01\x01\x12\x15\n\x08inferred\x18\x05 \x01(\x08H\x04\x88\x01\x01\x12\r\n\x05limit\x18\x06 \x01(\x05\x42\n\n\x08_subjectB\x0c\n\n_predicateB\t\n\x07_objectB\x08\n\x06_graphB\x0b\n\t_inferred\"-\n\x0eGraphNamespace\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\"5\n\x16UpsertNamespaceRequest\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\"I\n\x17UpsertNamespaceResponse\x12.\n\tnamespace\x18\x01 \x01(\x0b\x32\x1b.cortexdb.v1.GraphNamespace\"\x17\n\x15ListNamespacesRequest\"I\n\x16ListNamespacesResponse\x12/\n\nnamespaces\x18\x01 \x03(\x0b\x32\x1b.cortexdb.v1.GraphNamespace\"F\n\x1bUpsertKnowledgeGraphRequest\x12\'\n\x07triples\x18\x01 \x03(\x0b\x32\x16.cortexdb.v1.RdfTriple\"A\n\x1cUpsertKnowledgeGraphResponse\x12\x12\n\ntriple_ids\x18\x01 \x03(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"H\n\x19\x46indKnowledgeGraphRequest\x12+\n\x07pattern\x18\x01 \x01(\x0b\x32\x1a.cortexdb.v1.TriplePattern\"E\n\x1a\x46indKnowledgeGraphResponse\x12\'\n\x07triples\x18\x01 \x03(\x0b\x32\x16.cortexdb.v1.RdfTriple\"\x98\x01\n\x1b\x44\x65leteKnowledgeGraphRequest\x12\x12\n\ntriple_ids\x18\x01 \x03(\t\x12\'\n\x07triples\x18\x02 \x03(\x0b\x32\x16.cortexdb.v1.RdfTriple\x12\x30\n\x07pattern\x18\x03 \x01(\x0b\x32\x1a.cortexdb.v1.TriplePatternH\x00\x88\x01\x01\x42\n\n\x08_pattern\"/\n\x1c\x44\x65leteKnowledgeGraphResponse\x12\x0f\n\x07\x64\x65leted\x18\x01 \x01(\x05\">\n\x1bImportKnowledgeGraphRequest\x12\x0e\n\x06\x66ormat\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"=\n\x1cImportKnowledgeGraphResponse\x12\x0e\n\x06\x66ormat\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"-\n\x1b\x45xportKnowledgeGraphRequest\x12\x0e\n\x06\x66ormat\x18\x01 \x01(\t\"?\n\x1c\x45xportKnowledgeGraphResponse\x12\x0e\n\x06\x66ormat\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"\x86\x01\n\rSparqlBinding\x12\x32\n\x04vars\x18\x01 \x03(\x0b\x32$.cortexdb.v1.SparqlBinding.VarsEntry\x1a\x41\n\tVarsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.cortexdb.v1.RdfTerm:\x02\x38\x01\"\xa7\x01\n\x0cSparqlResult\x12\x12\n\nquery_type\x18\x01 \x01(\t\x12\x0c\n\x04vars\x18\x02 \x03(\t\x12,\n\x08\x62indings\x18\x03 \x03(\x0b\x32\x1a.cortexdb.v1.SparqlBinding\x12\'\n\x07triples\x18\x04 \x03(\x0b\x32\x16.cortexdb.v1.RdfTriple\x12\x0f\n\x07\x62oolean\x18\x05 \x01(\x08\x12\r\n\x05\x63ount\x18\x06 \x01(\x05\"#\n\x12QuerySparqlRequest\x12\r\n\x05query\x18\x01 \x01(\t\"@\n\x13QuerySparqlResponse\x12)\n\x06result\x18\x01 \x01(\x0b\x32\x19.cortexdb.v1.SparqlResult\"\xd9\x01\n\x15ShaclValidationResult\x12(\n\nfocus_node\x18\x01 \x01(\x0b\x32\x14.cortexdb.v1.RdfTerm\x12\"\n\x04path\x18\x02 \x01(\x0b\x32\x14.cortexdb.v1.RdfTerm\x12#\n\x05value\x18\x03 \x01(\x0b\x32\x14.cortexdb.v1.RdfTerm\x12\x0f\n\x07message\x18\x04 \x01(\t\x12\x10\n\x08severity\x18\x05 \x01(\t\x12*\n\x0csource_shape\x18\x06 \x01(\x0b\x32\x14.cortexdb.v1.RdfTerm\"T\n\x0bShaclReport\x12\x10\n\x08\x63onforms\x18\x01 \x01(\x08\x12\x33\n\x07results\x18\x02 \x03(\x0b\x32\".cortexdb.v1.ShaclValidationResult\">\n\x14ValidateShaclRequest\x12&\n\x06shapes\x18\x01 \x03(\x0b\x32\x16.cortexdb.v1.RdfTriple\"A\n\x15ValidateShaclResponse\x12(\n\x06report\x18\x01 \x01(\x0b\x32\x18.cortexdb.v1.ShaclReport\"\xa2\x01\n\x17RefreshInferenceRequest\x12\x0c\n\x04mode\x18\x01 \x01(\t\x12\x12\n\ntriple_ids\x18\x02 \x03(\t\x12\'\n\x07triples\x18\x03 \x03(\x0b\x32\x16.cortexdb.v1.RdfTriple\x12\x30\n\x07pattern\x18\x04 \x01(\x0b\x32\x1a.cortexdb.v1.TriplePatternH\x00\x88\x01\x01\x42\n\n\x08_pattern\"\x9e\x01\n\x16InferenceRefreshResult\x12\x16\n\x0e\x65xplicit_count\x18\x01 \x01(\x05\x12\x16\n\x0einferred_count\x18\x02 \x01(\x05\x12\x13\n\x0bincremental\x18\x03 \x01(\x08\x12\x1f\n\x17\x61\x66\x66\x65\x63ted_explicit_count\x18\x04 \x01(\x05\x12\x1e\n\x16removed_inferred_count\x18\x05 \x01(\x05\"O\n\x18RefreshInferenceResponse\x12\x33\n\x06result\x18\x01 \x01(\x0b\x32#.cortexdb.v1.InferenceRefreshResult\"\x1b\n\x19SummarizeInferenceRequest\"\xa9\x01\n\x10InferenceSummary\x12\x16\n\x0e\x65xplicit_count\x18\x01 \x01(\x05\x12\x16\n\x0einferred_count\x18\x02 \x01(\x05\x12\x37\n\x05rules\x18\x03 \x03(\x0b\x32(.cortexdb.v1.InferenceSummary.RulesEntry\x1a,\n\nRulesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"K\n\x1aSummarizeInferenceResponse\x12-\n\x06result\x18\x01 \x01(\x0b\x32\x1d.cortexdb.v1.InferenceSummary\"z\n\x14InferenceExplanation\x12&\n\x06triple\x18\x01 \x01(\x0b\x32\x16.cortexdb.v1.RdfTriple\x12\x10\n\x08\x65xplicit\x18\x02 \x01(\x08\x12\x0c\n\x04rule\x18\x03 \x01(\t\x12\x1a\n\x12support_triple_ids\x18\x04 \x03(\t\"\x9c\x01\n\x13InferenceTraceEntry\x12\x11\n\ttriple_id\x18\x01 \x01(\t\x12\x18\n\x10parent_triple_id\x18\x02 \x01(\t\x12\r\n\x05\x64\x65pth\x18\x03 \x01(\x05\x12\x36\n\x0b\x65xplanation\x18\x04 \x01(\x0b\x32!.cortexdb.v1.InferenceExplanation\x12\x11\n\ttruncated\x18\x05 \x01(\x08\";\n\x17\x45xplainInferenceRequest\x12\x11\n\ttriple_id\x18\x01 \x01(\t\x12\r\n\x05\x64\x65pth\x18\x02 \x01(\x05\"\x83\x01\n\x18\x45xplainInferenceResponse\x12\x36\n\x0b\x65xplanation\x18\x01 \x01(\x0b\x32!.cortexdb.v1.InferenceExplanation\x12/\n\x05trace\x18\x02 \x03(\x0b\x32 .cortexdb.v1.InferenceTraceEntry\"\x84\x01\n\x19InferenceMatchExplanation\x12\x36\n\x0b\x65xplanation\x18\x01 \x01(\x0b\x32!.cortexdb.v1.InferenceExplanation\x12/\n\x05trace\x18\x02 \x03(\x0b\x32 .cortexdb.v1.InferenceTraceEntry\"Z\n\x1c\x45xplainInferenceMatchRequest\x12+\n\x07pattern\x18\x01 \x01(\x0b\x32\x1a.cortexdb.v1.TriplePattern\x12\r\n\x05\x64\x65pth\x18\x02 \x01(\x05\"X\n\x1d\x45xplainInferenceMatchResponse\x12\x37\n\x07matches\x18\x01 \x03(\x0b\x32&.cortexdb.v1.InferenceMatchExplanation\"T\n\x12OntologyEntityType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x1b\n\x13required_properties\x18\x03 \x03(\t\"\x8c\x01\n\x14OntologyRelationType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x1a\n\x12\x61llowed_from_types\x18\x03 \x03(\t\x12\x18\n\x10\x61llowed_to_types\x18\x04 \x03(\t\x12\x1b\n\x13required_properties\x18\x05 \x03(\t\"\xa7\x03\n\x0eOntologySchema\x12\x11\n\tschema_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\x05\x12\x0e\n\x06\x61\x63tive\x18\x05 \x01(\x08\x12;\n\x08metadata\x18\x06 \x03(\x0b\x32).cortexdb.v1.OntologySchema.MetadataEntry\x12\x35\n\x0c\x65ntity_types\x18\x07 \x03(\x0b\x32\x1f.cortexdb.v1.OntologyEntityType\x12\x39\n\x0erelation_types\x18\x08 \x03(\x0b\x32!.cortexdb.v1.OntologyRelationType\x12.\n\ncreated_at\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf3\x02\n\x19SaveOntologySchemaRequest\x12\x11\n\tschema_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\x05\x12\x10\n\x08\x61\x63tivate\x18\x05 \x01(\x08\x12\x12\n\ndeactivate\x18\x06 \x01(\x08\x12\x46\n\x08metadata\x18\x07 \x03(\x0b\x32\x34.cortexdb.v1.SaveOntologySchemaRequest.MetadataEntry\x12\x35\n\x0c\x65ntity_types\x18\x08 \x03(\x0b\x32\x1f.cortexdb.v1.OntologyEntityType\x12\x39\n\x0erelation_types\x18\t \x03(\x0b\x32!.cortexdb.v1.OntologyRelationType\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"I\n\x1aSaveOntologySchemaResponse\x12+\n\x06schema\x18\x01 \x01(\x0b\x32\x1b.cortexdb.v1.OntologySchema\"-\n\x18GetOntologySchemaRequest\x12\x11\n\tschema_id\x18\x01 \x01(\t\"H\n\x19GetOntologySchemaResponse\x12+\n\x06schema\x18\x01 \x01(\x0b\x32\x1b.cortexdb.v1.OntologySchema\"1\n\x1aListOntologySchemasRequest\x12\x13\n\x0b\x61\x63tive_only\x18\x01 \x01(\x08\"K\n\x1bListOntologySchemasResponse\x12,\n\x07schemas\x18\x01 \x03(\x0b\x32\x1b.cortexdb.v1.OntologySchema\"0\n\x1b\x44\x65leteOntologySchemaRequest\x12\x11\n\tschema_id\x18\x01 \x01(\t\"B\n\x1c\x44\x65leteOntologySchemaResponse\x12\x11\n\tschema_id\x18\x01 \x01(\t\x12\x0f\n\x07\x64\x65leted\x18\x02 \x01(\x08\x32\xd0\r\n\x15KnowledgeGraphService\x12\\\n\x0fUpsertNamespace\x12#.cortexdb.v1.UpsertNamespaceRequest\x1a$.cortexdb.v1.UpsertNamespaceResponse\x12Y\n\x0eListNamespaces\x12\".cortexdb.v1.ListNamespacesRequest\x1a#.cortexdb.v1.ListNamespacesResponse\x12k\n\x14UpsertKnowledgeGraph\x12(.cortexdb.v1.UpsertKnowledgeGraphRequest\x1a).cortexdb.v1.UpsertKnowledgeGraphResponse\x12\x65\n\x12\x46indKnowledgeGraph\x12&.cortexdb.v1.FindKnowledgeGraphRequest\x1a\'.cortexdb.v1.FindKnowledgeGraphResponse\x12k\n\x14\x44\x65leteKnowledgeGraph\x12(.cortexdb.v1.DeleteKnowledgeGraphRequest\x1a).cortexdb.v1.DeleteKnowledgeGraphResponse\x12k\n\x14ImportKnowledgeGraph\x12(.cortexdb.v1.ImportKnowledgeGraphRequest\x1a).cortexdb.v1.ImportKnowledgeGraphResponse\x12k\n\x14\x45xportKnowledgeGraph\x12(.cortexdb.v1.ExportKnowledgeGraphRequest\x1a).cortexdb.v1.ExportKnowledgeGraphResponse\x12P\n\x0bQuerySparql\x12\x1f.cortexdb.v1.QuerySparqlRequest\x1a .cortexdb.v1.QuerySparqlResponse\x12V\n\rValidateShacl\x12!.cortexdb.v1.ValidateShaclRequest\x1a\".cortexdb.v1.ValidateShaclResponse\x12_\n\x10RefreshInference\x12$.cortexdb.v1.RefreshInferenceRequest\x1a%.cortexdb.v1.RefreshInferenceResponse\x12\x65\n\x12SummarizeInference\x12&.cortexdb.v1.SummarizeInferenceRequest\x1a\'.cortexdb.v1.SummarizeInferenceResponse\x12_\n\x10\x45xplainInference\x12$.cortexdb.v1.ExplainInferenceRequest\x1a%.cortexdb.v1.ExplainInferenceResponse\x12n\n\x15\x45xplainInferenceMatch\x12).cortexdb.v1.ExplainInferenceMatchRequest\x1a*.cortexdb.v1.ExplainInferenceMatchResponse\x12\x65\n\x12SaveOntologySchema\x12&.cortexdb.v1.SaveOntologySchemaRequest\x1a\'.cortexdb.v1.SaveOntologySchemaResponse\x12\x62\n\x11GetOntologySchema\x12%.cortexdb.v1.GetOntologySchemaRequest\x1a&.cortexdb.v1.GetOntologySchemaResponse\x12h\n\x13ListOntologySchemas\x12\'.cortexdb.v1.ListOntologySchemasRequest\x1a(.cortexdb.v1.ListOntologySchemasResponse\x12k\n\x14\x44\x65leteOntologySchema\x12(.cortexdb.v1.DeleteOntologySchemaRequest\x1a).cortexdb.v1.DeleteOntologySchemaResponseB4Z2github.com/liliang-cn/cortexdb/v2/pkg/rpc/v1;rpcv1b\x06proto3')
|
|
29
|
+
|
|
30
|
+
_globals = globals()
|
|
31
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'cortexdb.v1.graph_pb2', _globals)
|
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
35
|
+
_globals['DESCRIPTOR']._serialized_options = b'Z2github.com/liliang-cn/cortexdb/v2/pkg/rpc/v1;rpcv1'
|
|
36
|
+
_globals['_SPARQLBINDING_VARSENTRY']._loaded_options = None
|
|
37
|
+
_globals['_SPARQLBINDING_VARSENTRY']._serialized_options = b'8\001'
|
|
38
|
+
_globals['_INFERENCESUMMARY_RULESENTRY']._loaded_options = None
|
|
39
|
+
_globals['_INFERENCESUMMARY_RULESENTRY']._serialized_options = b'8\001'
|
|
40
|
+
_globals['_ONTOLOGYSCHEMA_METADATAENTRY']._loaded_options = None
|
|
41
|
+
_globals['_ONTOLOGYSCHEMA_METADATAENTRY']._serialized_options = b'8\001'
|
|
42
|
+
_globals['_SAVEONTOLOGYSCHEMAREQUEST_METADATAENTRY']._loaded_options = None
|
|
43
|
+
_globals['_SAVEONTOLOGYSCHEMAREQUEST_METADATAENTRY']._serialized_options = b'8\001'
|
|
44
|
+
_globals['_RDFTERM']._serialized_start=73
|
|
45
|
+
_globals['_RDFTERM']._serialized_end=147
|
|
46
|
+
_globals['_RDFTRIPLE']._serialized_start=150
|
|
47
|
+
_globals['_RDFTRIPLE']._serialized_end=396
|
|
48
|
+
_globals['_TRIPLEPATTERN']._serialized_start=399
|
|
49
|
+
_globals['_TRIPLEPATTERN']._serialized_end=687
|
|
50
|
+
_globals['_GRAPHNAMESPACE']._serialized_start=689
|
|
51
|
+
_globals['_GRAPHNAMESPACE']._serialized_end=734
|
|
52
|
+
_globals['_UPSERTNAMESPACEREQUEST']._serialized_start=736
|
|
53
|
+
_globals['_UPSERTNAMESPACEREQUEST']._serialized_end=789
|
|
54
|
+
_globals['_UPSERTNAMESPACERESPONSE']._serialized_start=791
|
|
55
|
+
_globals['_UPSERTNAMESPACERESPONSE']._serialized_end=864
|
|
56
|
+
_globals['_LISTNAMESPACESREQUEST']._serialized_start=866
|
|
57
|
+
_globals['_LISTNAMESPACESREQUEST']._serialized_end=889
|
|
58
|
+
_globals['_LISTNAMESPACESRESPONSE']._serialized_start=891
|
|
59
|
+
_globals['_LISTNAMESPACESRESPONSE']._serialized_end=964
|
|
60
|
+
_globals['_UPSERTKNOWLEDGEGRAPHREQUEST']._serialized_start=966
|
|
61
|
+
_globals['_UPSERTKNOWLEDGEGRAPHREQUEST']._serialized_end=1036
|
|
62
|
+
_globals['_UPSERTKNOWLEDGEGRAPHRESPONSE']._serialized_start=1038
|
|
63
|
+
_globals['_UPSERTKNOWLEDGEGRAPHRESPONSE']._serialized_end=1103
|
|
64
|
+
_globals['_FINDKNOWLEDGEGRAPHREQUEST']._serialized_start=1105
|
|
65
|
+
_globals['_FINDKNOWLEDGEGRAPHREQUEST']._serialized_end=1177
|
|
66
|
+
_globals['_FINDKNOWLEDGEGRAPHRESPONSE']._serialized_start=1179
|
|
67
|
+
_globals['_FINDKNOWLEDGEGRAPHRESPONSE']._serialized_end=1248
|
|
68
|
+
_globals['_DELETEKNOWLEDGEGRAPHREQUEST']._serialized_start=1251
|
|
69
|
+
_globals['_DELETEKNOWLEDGEGRAPHREQUEST']._serialized_end=1403
|
|
70
|
+
_globals['_DELETEKNOWLEDGEGRAPHRESPONSE']._serialized_start=1405
|
|
71
|
+
_globals['_DELETEKNOWLEDGEGRAPHRESPONSE']._serialized_end=1452
|
|
72
|
+
_globals['_IMPORTKNOWLEDGEGRAPHREQUEST']._serialized_start=1454
|
|
73
|
+
_globals['_IMPORTKNOWLEDGEGRAPHREQUEST']._serialized_end=1516
|
|
74
|
+
_globals['_IMPORTKNOWLEDGEGRAPHRESPONSE']._serialized_start=1518
|
|
75
|
+
_globals['_IMPORTKNOWLEDGEGRAPHRESPONSE']._serialized_end=1579
|
|
76
|
+
_globals['_EXPORTKNOWLEDGEGRAPHREQUEST']._serialized_start=1581
|
|
77
|
+
_globals['_EXPORTKNOWLEDGEGRAPHREQUEST']._serialized_end=1626
|
|
78
|
+
_globals['_EXPORTKNOWLEDGEGRAPHRESPONSE']._serialized_start=1628
|
|
79
|
+
_globals['_EXPORTKNOWLEDGEGRAPHRESPONSE']._serialized_end=1691
|
|
80
|
+
_globals['_SPARQLBINDING']._serialized_start=1694
|
|
81
|
+
_globals['_SPARQLBINDING']._serialized_end=1828
|
|
82
|
+
_globals['_SPARQLBINDING_VARSENTRY']._serialized_start=1763
|
|
83
|
+
_globals['_SPARQLBINDING_VARSENTRY']._serialized_end=1828
|
|
84
|
+
_globals['_SPARQLRESULT']._serialized_start=1831
|
|
85
|
+
_globals['_SPARQLRESULT']._serialized_end=1998
|
|
86
|
+
_globals['_QUERYSPARQLREQUEST']._serialized_start=2000
|
|
87
|
+
_globals['_QUERYSPARQLREQUEST']._serialized_end=2035
|
|
88
|
+
_globals['_QUERYSPARQLRESPONSE']._serialized_start=2037
|
|
89
|
+
_globals['_QUERYSPARQLRESPONSE']._serialized_end=2101
|
|
90
|
+
_globals['_SHACLVALIDATIONRESULT']._serialized_start=2104
|
|
91
|
+
_globals['_SHACLVALIDATIONRESULT']._serialized_end=2321
|
|
92
|
+
_globals['_SHACLREPORT']._serialized_start=2323
|
|
93
|
+
_globals['_SHACLREPORT']._serialized_end=2407
|
|
94
|
+
_globals['_VALIDATESHACLREQUEST']._serialized_start=2409
|
|
95
|
+
_globals['_VALIDATESHACLREQUEST']._serialized_end=2471
|
|
96
|
+
_globals['_VALIDATESHACLRESPONSE']._serialized_start=2473
|
|
97
|
+
_globals['_VALIDATESHACLRESPONSE']._serialized_end=2538
|
|
98
|
+
_globals['_REFRESHINFERENCEREQUEST']._serialized_start=2541
|
|
99
|
+
_globals['_REFRESHINFERENCEREQUEST']._serialized_end=2703
|
|
100
|
+
_globals['_INFERENCEREFRESHRESULT']._serialized_start=2706
|
|
101
|
+
_globals['_INFERENCEREFRESHRESULT']._serialized_end=2864
|
|
102
|
+
_globals['_REFRESHINFERENCERESPONSE']._serialized_start=2866
|
|
103
|
+
_globals['_REFRESHINFERENCERESPONSE']._serialized_end=2945
|
|
104
|
+
_globals['_SUMMARIZEINFERENCEREQUEST']._serialized_start=2947
|
|
105
|
+
_globals['_SUMMARIZEINFERENCEREQUEST']._serialized_end=2974
|
|
106
|
+
_globals['_INFERENCESUMMARY']._serialized_start=2977
|
|
107
|
+
_globals['_INFERENCESUMMARY']._serialized_end=3146
|
|
108
|
+
_globals['_INFERENCESUMMARY_RULESENTRY']._serialized_start=3102
|
|
109
|
+
_globals['_INFERENCESUMMARY_RULESENTRY']._serialized_end=3146
|
|
110
|
+
_globals['_SUMMARIZEINFERENCERESPONSE']._serialized_start=3148
|
|
111
|
+
_globals['_SUMMARIZEINFERENCERESPONSE']._serialized_end=3223
|
|
112
|
+
_globals['_INFERENCEEXPLANATION']._serialized_start=3225
|
|
113
|
+
_globals['_INFERENCEEXPLANATION']._serialized_end=3347
|
|
114
|
+
_globals['_INFERENCETRACEENTRY']._serialized_start=3350
|
|
115
|
+
_globals['_INFERENCETRACEENTRY']._serialized_end=3506
|
|
116
|
+
_globals['_EXPLAININFERENCEREQUEST']._serialized_start=3508
|
|
117
|
+
_globals['_EXPLAININFERENCEREQUEST']._serialized_end=3567
|
|
118
|
+
_globals['_EXPLAININFERENCERESPONSE']._serialized_start=3570
|
|
119
|
+
_globals['_EXPLAININFERENCERESPONSE']._serialized_end=3701
|
|
120
|
+
_globals['_INFERENCEMATCHEXPLANATION']._serialized_start=3704
|
|
121
|
+
_globals['_INFERENCEMATCHEXPLANATION']._serialized_end=3836
|
|
122
|
+
_globals['_EXPLAININFERENCEMATCHREQUEST']._serialized_start=3838
|
|
123
|
+
_globals['_EXPLAININFERENCEMATCHREQUEST']._serialized_end=3928
|
|
124
|
+
_globals['_EXPLAININFERENCEMATCHRESPONSE']._serialized_start=3930
|
|
125
|
+
_globals['_EXPLAININFERENCEMATCHRESPONSE']._serialized_end=4018
|
|
126
|
+
_globals['_ONTOLOGYENTITYTYPE']._serialized_start=4020
|
|
127
|
+
_globals['_ONTOLOGYENTITYTYPE']._serialized_end=4104
|
|
128
|
+
_globals['_ONTOLOGYRELATIONTYPE']._serialized_start=4107
|
|
129
|
+
_globals['_ONTOLOGYRELATIONTYPE']._serialized_end=4247
|
|
130
|
+
_globals['_ONTOLOGYSCHEMA']._serialized_start=4250
|
|
131
|
+
_globals['_ONTOLOGYSCHEMA']._serialized_end=4673
|
|
132
|
+
_globals['_ONTOLOGYSCHEMA_METADATAENTRY']._serialized_start=4626
|
|
133
|
+
_globals['_ONTOLOGYSCHEMA_METADATAENTRY']._serialized_end=4673
|
|
134
|
+
_globals['_SAVEONTOLOGYSCHEMAREQUEST']._serialized_start=4676
|
|
135
|
+
_globals['_SAVEONTOLOGYSCHEMAREQUEST']._serialized_end=5047
|
|
136
|
+
_globals['_SAVEONTOLOGYSCHEMAREQUEST_METADATAENTRY']._serialized_start=4626
|
|
137
|
+
_globals['_SAVEONTOLOGYSCHEMAREQUEST_METADATAENTRY']._serialized_end=4673
|
|
138
|
+
_globals['_SAVEONTOLOGYSCHEMARESPONSE']._serialized_start=5049
|
|
139
|
+
_globals['_SAVEONTOLOGYSCHEMARESPONSE']._serialized_end=5122
|
|
140
|
+
_globals['_GETONTOLOGYSCHEMAREQUEST']._serialized_start=5124
|
|
141
|
+
_globals['_GETONTOLOGYSCHEMAREQUEST']._serialized_end=5169
|
|
142
|
+
_globals['_GETONTOLOGYSCHEMARESPONSE']._serialized_start=5171
|
|
143
|
+
_globals['_GETONTOLOGYSCHEMARESPONSE']._serialized_end=5243
|
|
144
|
+
_globals['_LISTONTOLOGYSCHEMASREQUEST']._serialized_start=5245
|
|
145
|
+
_globals['_LISTONTOLOGYSCHEMASREQUEST']._serialized_end=5294
|
|
146
|
+
_globals['_LISTONTOLOGYSCHEMASRESPONSE']._serialized_start=5296
|
|
147
|
+
_globals['_LISTONTOLOGYSCHEMASRESPONSE']._serialized_end=5371
|
|
148
|
+
_globals['_DELETEONTOLOGYSCHEMAREQUEST']._serialized_start=5373
|
|
149
|
+
_globals['_DELETEONTOLOGYSCHEMAREQUEST']._serialized_end=5421
|
|
150
|
+
_globals['_DELETEONTOLOGYSCHEMARESPONSE']._serialized_start=5423
|
|
151
|
+
_globals['_DELETEONTOLOGYSCHEMARESPONSE']._serialized_end=5489
|
|
152
|
+
_globals['_KNOWLEDGEGRAPHSERVICE']._serialized_start=5492
|
|
153
|
+
_globals['_KNOWLEDGEGRAPHSERVICE']._serialized_end=7236
|
|
154
|
+
# @@protoc_insertion_point(module_scope)
|