typedb-driver 2.26.5__py38-none-win_amd64.whl
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.
- typedb/__init__.py +0 -0
- typedb/api/__init__.py +0 -0
- typedb/api/answer/__init__.py +0 -0
- typedb/api/answer/concept_map.py +245 -0
- typedb/api/answer/concept_map_group.py +65 -0
- typedb/api/answer/value_group.py +65 -0
- typedb/api/concept/__init__.py +0 -0
- typedb/api/concept/concept.py +352 -0
- typedb/api/concept/concept_manager.py +251 -0
- typedb/api/concept/thing/__init__.py +0 -0
- typedb/api/concept/thing/attribute.py +295 -0
- typedb/api/concept/thing/entity.py +83 -0
- typedb/api/concept/thing/relation.py +171 -0
- typedb/api/concept/thing/thing.py +247 -0
- typedb/api/concept/type/__init__.py +0 -0
- typedb/api/concept/type/annotation.py +108 -0
- typedb/api/concept/type/attribute_type.py +362 -0
- typedb/api/concept/type/entity_type.py +150 -0
- typedb/api/concept/type/relation_type.py +244 -0
- typedb/api/concept/type/role_type.py +233 -0
- typedb/api/concept/type/thing_type.py +371 -0
- typedb/api/concept/type/type.py +183 -0
- typedb/api/concept/value/__init__.py +0 -0
- typedb/api/concept/value/value.py +301 -0
- typedb/api/connection/__init__.py +0 -0
- typedb/api/connection/credential.py +56 -0
- typedb/api/connection/database.py +265 -0
- typedb/api/connection/driver.py +124 -0
- typedb/api/connection/options.py +225 -0
- typedb/api/connection/session.py +176 -0
- typedb/api/connection/transaction.py +181 -0
- typedb/api/logic/__init__.py +0 -0
- typedb/api/logic/explanation.py +112 -0
- typedb/api/logic/logic_manager.py +84 -0
- typedb/api/logic/rule.py +110 -0
- typedb/api/query/__init__.py +0 -0
- typedb/api/query/query_manager.py +228 -0
- typedb/api/user/__init__.py +0 -0
- typedb/api/user/user.py +160 -0
- typedb/common/__init__.py +0 -0
- typedb/common/exception.py +166 -0
- typedb/common/iterator_wrapper.py +43 -0
- typedb/common/label.py +96 -0
- typedb/common/native_wrapper.py +47 -0
- typedb/common/promise.py +68 -0
- typedb/common/transitivity.py +40 -0
- typedb/concept/__init__.py +0 -0
- typedb/concept/answer/__init__.py +0 -0
- typedb/concept/answer/concept_map.py +184 -0
- typedb/concept/answer/concept_map_group.py +71 -0
- typedb/concept/answer/value_group.py +68 -0
- typedb/concept/concept.py +52 -0
- typedb/concept/concept_factory.py +159 -0
- typedb/concept/concept_manager.py +125 -0
- typedb/concept/thing/__init__.py +0 -0
- typedb/concept/thing/attribute.py +98 -0
- typedb/concept/thing/entity.py +39 -0
- typedb/concept/thing/relation.py +95 -0
- typedb/concept/thing/thing.py +129 -0
- typedb/concept/type/__init__.py +0 -0
- typedb/concept/type/attribute_type.py +177 -0
- typedb/concept/type/entity_type.py +91 -0
- typedb/concept/type/relation_type.py +134 -0
- typedb/concept/type/role_type.py +160 -0
- typedb/concept/type/thing_type.py +222 -0
- typedb/concept/type/type.py +63 -0
- typedb/concept/value/__init__.py +0 -0
- typedb/concept/value/value.py +135 -0
- typedb/connection/__init__.py +0 -0
- typedb/connection/database.py +122 -0
- typedb/connection/database_manager.py +78 -0
- typedb/connection/driver.py +95 -0
- typedb/connection/session.py +99 -0
- typedb/connection/transaction.py +123 -0
- typedb/driver.py +85 -0
- typedb/logic/__init__.py +0 -0
- typedb/logic/explanation.py +81 -0
- typedb/logic/logic_manager.py +70 -0
- typedb/logic/rule.py +90 -0
- typedb/native_driver_python.pyd +0 -0
- typedb/native_driver_wrapper.py +1391 -0
- typedb/query/__init__.py +0 -0
- typedb/query/query_manager.py +194 -0
- typedb/user/__init__.py +0 -0
- typedb/user/user.py +59 -0
- typedb/user/user_manager.py +92 -0
- typedb_driver-2.26.5.dist-info/METADATA +44 -0
- typedb_driver-2.26.5.dist-info/RECORD +90 -0
- typedb_driver-2.26.5.dist-info/WHEEL +5 -0
- typedb_driver-2.26.5.dist-info/top_level.txt +2 -0
typedb/__init__.py
ADDED
|
File without changes
|
typedb/api/__init__.py
ADDED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (C) 2022 Vaticle
|
|
3
|
+
#
|
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
|
5
|
+
# or more contributor license agreements. See the NOTICE file
|
|
6
|
+
# distributed with this work for additional information
|
|
7
|
+
# regarding copyright ownership. The ASF licenses this file
|
|
8
|
+
# to you under the Apache License, Version 2.0 (the
|
|
9
|
+
# "License"); you may not use this file except in compliance
|
|
10
|
+
# with the License. You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing,
|
|
15
|
+
# software distributed under the License is distributed on an
|
|
16
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
17
|
+
# KIND, either express or implied. See the License for the
|
|
18
|
+
# specific language governing permissions and limitations
|
|
19
|
+
# under the License.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
from abc import ABC, abstractmethod
|
|
25
|
+
from typing import Mapping, Iterator, TYPE_CHECKING
|
|
26
|
+
|
|
27
|
+
if TYPE_CHECKING:
|
|
28
|
+
from typedb.api.concept.concept import Concept
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ConceptMap(ABC):
|
|
32
|
+
"""
|
|
33
|
+
Contains a mapping of variables to concepts.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
@abstractmethod
|
|
37
|
+
def variables(self) -> Iterator[str]:
|
|
38
|
+
"""
|
|
39
|
+
Produces an iterator over all variables in this ``ConceptMap``.
|
|
40
|
+
|
|
41
|
+
:return:
|
|
42
|
+
|
|
43
|
+
Examples
|
|
44
|
+
--------
|
|
45
|
+
::
|
|
46
|
+
|
|
47
|
+
concept_map.variables()
|
|
48
|
+
"""
|
|
49
|
+
pass
|
|
50
|
+
|
|
51
|
+
@abstractmethod
|
|
52
|
+
def concepts(self) -> Iterator[Concept]:
|
|
53
|
+
"""
|
|
54
|
+
Produces an iterator over all concepts in this ``ConceptMap``.
|
|
55
|
+
|
|
56
|
+
:return:
|
|
57
|
+
|
|
58
|
+
Examples
|
|
59
|
+
--------
|
|
60
|
+
::
|
|
61
|
+
|
|
62
|
+
concept_map.concepts()
|
|
63
|
+
"""
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
@abstractmethod
|
|
67
|
+
def map(self) -> Mapping[str, Concept]:
|
|
68
|
+
"""
|
|
69
|
+
Returns the inner ``Mapping`` where keys are query variables, and values are concepts.
|
|
70
|
+
|
|
71
|
+
:return:
|
|
72
|
+
|
|
73
|
+
Examples
|
|
74
|
+
--------
|
|
75
|
+
::
|
|
76
|
+
|
|
77
|
+
concept_map.concepts()
|
|
78
|
+
"""
|
|
79
|
+
pass
|
|
80
|
+
|
|
81
|
+
@abstractmethod
|
|
82
|
+
def get(self, variable: str) -> Concept:
|
|
83
|
+
"""
|
|
84
|
+
Retrieves a concept for a given variable name.
|
|
85
|
+
|
|
86
|
+
:param variable: The string representation of a variable
|
|
87
|
+
:return:
|
|
88
|
+
|
|
89
|
+
Examples
|
|
90
|
+
--------
|
|
91
|
+
::
|
|
92
|
+
|
|
93
|
+
concept_map.get(variable)
|
|
94
|
+
"""
|
|
95
|
+
pass
|
|
96
|
+
|
|
97
|
+
@abstractmethod
|
|
98
|
+
def explainables(self) -> Explainables:
|
|
99
|
+
"""
|
|
100
|
+
Gets the ``Explainables`` object for this ``ConceptMap``, exposing
|
|
101
|
+
which of the concepts in this ``ConceptMap`` are explainable.
|
|
102
|
+
|
|
103
|
+
:return:
|
|
104
|
+
|
|
105
|
+
Examples
|
|
106
|
+
--------
|
|
107
|
+
::
|
|
108
|
+
|
|
109
|
+
concept_map.explainables()
|
|
110
|
+
"""
|
|
111
|
+
pass
|
|
112
|
+
|
|
113
|
+
class Explainables(ABC):
|
|
114
|
+
"""
|
|
115
|
+
Contains explainable objects.
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
@abstractmethod
|
|
119
|
+
def relation(self, variable: str) -> ConceptMap.Explainable:
|
|
120
|
+
"""
|
|
121
|
+
Retrieves the explainable relation with the given variable name.
|
|
122
|
+
|
|
123
|
+
:param variable: The string representation of a variable
|
|
124
|
+
:return:
|
|
125
|
+
|
|
126
|
+
Examples
|
|
127
|
+
--------
|
|
128
|
+
::
|
|
129
|
+
|
|
130
|
+
concept_map.explainables().relation(variable)
|
|
131
|
+
"""
|
|
132
|
+
pass
|
|
133
|
+
|
|
134
|
+
@abstractmethod
|
|
135
|
+
def attribute(self, variable: str) -> ConceptMap.Explainable:
|
|
136
|
+
"""
|
|
137
|
+
Retrieves the explainable attribute with the given variable name.
|
|
138
|
+
|
|
139
|
+
:param variable: The string representation of a variable
|
|
140
|
+
:return:
|
|
141
|
+
|
|
142
|
+
Examples
|
|
143
|
+
--------
|
|
144
|
+
::
|
|
145
|
+
|
|
146
|
+
concept_map.explainables().attribute(variable)
|
|
147
|
+
"""
|
|
148
|
+
pass
|
|
149
|
+
|
|
150
|
+
@abstractmethod
|
|
151
|
+
def ownership(self, owner: str, attribute: str) -> ConceptMap.Explainable:
|
|
152
|
+
"""
|
|
153
|
+
Retrieves the explainable attribute ownership with the pair of (owner, attribute) variable names.
|
|
154
|
+
|
|
155
|
+
:param owner: The string representation of the owner variable
|
|
156
|
+
:param attribute: The string representation of the attribute variable
|
|
157
|
+
:return:
|
|
158
|
+
|
|
159
|
+
Examples
|
|
160
|
+
--------
|
|
161
|
+
::
|
|
162
|
+
|
|
163
|
+
concept_map.explainables().ownership(owner, attribute)
|
|
164
|
+
"""
|
|
165
|
+
pass
|
|
166
|
+
|
|
167
|
+
@abstractmethod
|
|
168
|
+
def relations(self) -> Mapping[str, ConceptMap.Explainable]:
|
|
169
|
+
"""
|
|
170
|
+
Retrieves all of this ``ConceptMap``’s explainable relations.
|
|
171
|
+
|
|
172
|
+
:return:
|
|
173
|
+
|
|
174
|
+
Examples
|
|
175
|
+
--------
|
|
176
|
+
::
|
|
177
|
+
|
|
178
|
+
concept_map.explainables().relations()
|
|
179
|
+
"""
|
|
180
|
+
pass
|
|
181
|
+
|
|
182
|
+
@abstractmethod
|
|
183
|
+
def attributes(self) -> Mapping[str, ConceptMap.Explainable]:
|
|
184
|
+
"""
|
|
185
|
+
Retrieves all of this ``ConceptMap``’s explainable attributes.
|
|
186
|
+
|
|
187
|
+
:return:
|
|
188
|
+
|
|
189
|
+
Examples
|
|
190
|
+
--------
|
|
191
|
+
::
|
|
192
|
+
|
|
193
|
+
concept_map.explainables().attributes()
|
|
194
|
+
"""
|
|
195
|
+
pass
|
|
196
|
+
|
|
197
|
+
@abstractmethod
|
|
198
|
+
def ownerships(self) -> Mapping[tuple[str, str], ConceptMap.Explainable]:
|
|
199
|
+
"""
|
|
200
|
+
Retrieves all of this ``ConceptMap``’s explainable ownerships.
|
|
201
|
+
|
|
202
|
+
:return:
|
|
203
|
+
|
|
204
|
+
Examples
|
|
205
|
+
--------
|
|
206
|
+
::
|
|
207
|
+
|
|
208
|
+
concept_map.explainables().ownerships()
|
|
209
|
+
"""
|
|
210
|
+
pass
|
|
211
|
+
|
|
212
|
+
class Explainable(ABC):
|
|
213
|
+
"""
|
|
214
|
+
Contains an explainable object.
|
|
215
|
+
"""
|
|
216
|
+
|
|
217
|
+
@abstractmethod
|
|
218
|
+
def conjunction(self) -> str:
|
|
219
|
+
"""
|
|
220
|
+
Retrieves the subquery of the original query that is actually being explained.
|
|
221
|
+
|
|
222
|
+
:return:
|
|
223
|
+
|
|
224
|
+
Examples
|
|
225
|
+
--------
|
|
226
|
+
::
|
|
227
|
+
|
|
228
|
+
explainable.conjunction()
|
|
229
|
+
"""
|
|
230
|
+
pass
|
|
231
|
+
|
|
232
|
+
@abstractmethod
|
|
233
|
+
def id(self) -> int:
|
|
234
|
+
"""
|
|
235
|
+
Retrieves the unique ID that identifies this ``Explainable``.
|
|
236
|
+
|
|
237
|
+
:return:
|
|
238
|
+
|
|
239
|
+
Examples
|
|
240
|
+
--------
|
|
241
|
+
::
|
|
242
|
+
|
|
243
|
+
explainable.id()
|
|
244
|
+
"""
|
|
245
|
+
pass
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (C) 2022 Vaticle
|
|
3
|
+
#
|
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
|
5
|
+
# or more contributor license agreements. See the NOTICE file
|
|
6
|
+
# distributed with this work for additional information
|
|
7
|
+
# regarding copyright ownership. The ASF licenses this file
|
|
8
|
+
# to you under the Apache License, Version 2.0 (the
|
|
9
|
+
# "License"); you may not use this file except in compliance
|
|
10
|
+
# with the License. You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing,
|
|
15
|
+
# software distributed under the License is distributed on an
|
|
16
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
17
|
+
# KIND, either express or implied. See the License for the
|
|
18
|
+
# specific language governing permissions and limitations
|
|
19
|
+
# under the License.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
from abc import ABC, abstractmethod
|
|
25
|
+
from typing import Iterator, TYPE_CHECKING
|
|
26
|
+
|
|
27
|
+
if TYPE_CHECKING:
|
|
28
|
+
from typedb.api.answer.concept_map import ConceptMap
|
|
29
|
+
from typedb.api.concept.concept import Concept
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ConceptMapGroup(ABC):
|
|
33
|
+
"""
|
|
34
|
+
Contains an element of the group query result.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
@abstractmethod
|
|
38
|
+
def owner(self) -> Concept:
|
|
39
|
+
"""
|
|
40
|
+
Retrieves the concept that is the group owner.
|
|
41
|
+
|
|
42
|
+
:return:
|
|
43
|
+
|
|
44
|
+
Examples:
|
|
45
|
+
---------
|
|
46
|
+
::
|
|
47
|
+
|
|
48
|
+
concept_map_group.owner()
|
|
49
|
+
"""
|
|
50
|
+
pass
|
|
51
|
+
|
|
52
|
+
@abstractmethod
|
|
53
|
+
def concept_maps(self) -> Iterator[ConceptMap]:
|
|
54
|
+
"""
|
|
55
|
+
Retrieves the ConceptMaps of the group.
|
|
56
|
+
|
|
57
|
+
:return:
|
|
58
|
+
|
|
59
|
+
Examples:
|
|
60
|
+
---------
|
|
61
|
+
::
|
|
62
|
+
|
|
63
|
+
concept_map_group.concept_maps()
|
|
64
|
+
"""
|
|
65
|
+
pass
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (C) 2022 Vaticle
|
|
3
|
+
#
|
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
|
5
|
+
# or more contributor license agreements. See the NOTICE file
|
|
6
|
+
# distributed with this work for additional information
|
|
7
|
+
# regarding copyright ownership. The ASF licenses this file
|
|
8
|
+
# to you under the Apache License, Version 2.0 (the
|
|
9
|
+
# "License"); you may not use this file except in compliance
|
|
10
|
+
# with the License. You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing,
|
|
15
|
+
# software distributed under the License is distributed on an
|
|
16
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
17
|
+
# KIND, either express or implied. See the License for the
|
|
18
|
+
# specific language governing permissions and limitations
|
|
19
|
+
# under the License.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
from abc import ABC, abstractmethod
|
|
25
|
+
from typing import TYPE_CHECKING, Optional
|
|
26
|
+
|
|
27
|
+
if TYPE_CHECKING:
|
|
28
|
+
from typedb.api.concept.concept import Concept
|
|
29
|
+
from typedb.api.concept.value.value import Value
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ValueGroup(ABC):
|
|
33
|
+
"""
|
|
34
|
+
Contains an element of the group aggregate query result.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
@abstractmethod
|
|
38
|
+
def owner(self) -> Concept:
|
|
39
|
+
"""
|
|
40
|
+
Retrieves the concept that is the group owner.
|
|
41
|
+
|
|
42
|
+
:return:
|
|
43
|
+
|
|
44
|
+
Examples
|
|
45
|
+
--------
|
|
46
|
+
::
|
|
47
|
+
|
|
48
|
+
value_group.owner()
|
|
49
|
+
"""
|
|
50
|
+
pass
|
|
51
|
+
|
|
52
|
+
@abstractmethod
|
|
53
|
+
def value(self) -> Optional[Value]:
|
|
54
|
+
"""
|
|
55
|
+
Retrieves the ``Value`` answer of the group.
|
|
56
|
+
|
|
57
|
+
:return:
|
|
58
|
+
|
|
59
|
+
Examples
|
|
60
|
+
--------
|
|
61
|
+
::
|
|
62
|
+
|
|
63
|
+
value_group.value()
|
|
64
|
+
"""
|
|
65
|
+
pass
|
|
File without changes
|