kraph 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.
- kraph-0.1.0/.gitignore +147 -0
- kraph-0.1.0/PKG-INFO +28 -0
- kraph-0.1.0/README.md +17 -0
- kraph-0.1.0/kraph/__init__.py +23 -0
- kraph-0.1.0/kraph/api/project.json +217 -0
- kraph-0.1.0/kraph/api/schema.graphql +3181 -0
- kraph-0.1.0/kraph/api/schema.py +11771 -0
- kraph-0.1.0/kraph/arkitekt.py +89 -0
- kraph-0.1.0/kraph/contrib/fakts/__init__.py +0 -0
- kraph-0.1.0/kraph/contrib/fakts/datalayer.py +39 -0
- kraph-0.1.0/kraph/datalayer.py +66 -0
- kraph-0.1.0/kraph/errors.py +2 -0
- kraph-0.1.0/kraph/funcs.py +37 -0
- kraph-0.1.0/kraph/io.py +31 -0
- kraph-0.1.0/kraph/kraph.py +10 -0
- kraph-0.1.0/kraph/links/__init__.py +6 -0
- kraph-0.1.0/kraph/links/errors.py +0 -0
- kraph-0.1.0/kraph/links/upload.py +162 -0
- kraph-0.1.0/kraph/rath.py +38 -0
- kraph-0.1.0/kraph/rekuest.py +122 -0
- kraph-0.1.0/kraph/scalars.py +189 -0
- kraph-0.1.0/kraph/traits.py +935 -0
- kraph-0.1.0/kraph/utils.py +62 -0
- kraph-0.1.0/kraph/vars.py +6 -0
- kraph-0.1.0/kraph/widgets.py +47 -0
- kraph-0.1.0/pyproject.toml +91 -0
kraph-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
**/__pycache__
|
|
4
|
+
*.py[cod]
|
|
5
|
+
*$py.class
|
|
6
|
+
*.pyc
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
pip-wheel-metadata/
|
|
26
|
+
share/python-wheels/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg
|
|
30
|
+
MANIFEST
|
|
31
|
+
|
|
32
|
+
# PyInstaller
|
|
33
|
+
# Usually these files are written by a python script from a template
|
|
34
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
35
|
+
*.manifest
|
|
36
|
+
*.spec
|
|
37
|
+
|
|
38
|
+
# Installer logs
|
|
39
|
+
pip-log.txt
|
|
40
|
+
pip-delete-this-directory.txt
|
|
41
|
+
|
|
42
|
+
# Unit test / coverage reports
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.nox/
|
|
46
|
+
.coverage
|
|
47
|
+
.coverage.*
|
|
48
|
+
.cache
|
|
49
|
+
nosetests.xml
|
|
50
|
+
coverage.xml
|
|
51
|
+
*.cover
|
|
52
|
+
*.py,cover
|
|
53
|
+
.hypothesis/
|
|
54
|
+
.pytest_cache/
|
|
55
|
+
cover/
|
|
56
|
+
|
|
57
|
+
# Translations
|
|
58
|
+
*.mo
|
|
59
|
+
*.pot
|
|
60
|
+
|
|
61
|
+
# Django stuff:
|
|
62
|
+
*.log
|
|
63
|
+
local_settings.py
|
|
64
|
+
db.sqlite3
|
|
65
|
+
db.sqlite3-journal
|
|
66
|
+
|
|
67
|
+
# Flask stuff:
|
|
68
|
+
instance/
|
|
69
|
+
.webassets-cache
|
|
70
|
+
|
|
71
|
+
# Scrapy stuff:
|
|
72
|
+
.scrapy
|
|
73
|
+
|
|
74
|
+
# Sphinx documentation
|
|
75
|
+
docs/_build/
|
|
76
|
+
|
|
77
|
+
# PyBuilder
|
|
78
|
+
.pybuilder/
|
|
79
|
+
target/
|
|
80
|
+
|
|
81
|
+
# Jupyter Notebook
|
|
82
|
+
.ipynb_checkpoints
|
|
83
|
+
|
|
84
|
+
# IPython
|
|
85
|
+
profile_default/
|
|
86
|
+
ipython_config.py
|
|
87
|
+
|
|
88
|
+
# pyenv
|
|
89
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
90
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
91
|
+
# .python-version
|
|
92
|
+
|
|
93
|
+
# pipenv
|
|
94
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
95
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
96
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
97
|
+
# install all needed dependencies.
|
|
98
|
+
#Pipfile.lock
|
|
99
|
+
|
|
100
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
101
|
+
__pypackages__/
|
|
102
|
+
|
|
103
|
+
# Celery stuff
|
|
104
|
+
celerybeat-schedule
|
|
105
|
+
celerybeat.pid
|
|
106
|
+
|
|
107
|
+
# SageMath parsed files
|
|
108
|
+
*.sage.py
|
|
109
|
+
|
|
110
|
+
# Environments
|
|
111
|
+
.env
|
|
112
|
+
.venv
|
|
113
|
+
env/
|
|
114
|
+
venv/
|
|
115
|
+
ENV/
|
|
116
|
+
env.bak/
|
|
117
|
+
venv.bak/
|
|
118
|
+
|
|
119
|
+
# Spyder project settings
|
|
120
|
+
.spyderproject
|
|
121
|
+
.spyproject
|
|
122
|
+
|
|
123
|
+
# Rope project settings
|
|
124
|
+
.ropeproject
|
|
125
|
+
|
|
126
|
+
# mkdocs documentation
|
|
127
|
+
/site
|
|
128
|
+
|
|
129
|
+
# mypy
|
|
130
|
+
.mypy_cache/
|
|
131
|
+
.dmypy.json
|
|
132
|
+
dmypy.json
|
|
133
|
+
|
|
134
|
+
# Pyre type checker
|
|
135
|
+
.pyre/
|
|
136
|
+
|
|
137
|
+
# pytype static type analyzer
|
|
138
|
+
.pytype/
|
|
139
|
+
|
|
140
|
+
# Cython debug symbols
|
|
141
|
+
cython_debug/
|
|
142
|
+
|
|
143
|
+
# static files generated from Django application using `collectstatic`
|
|
144
|
+
media
|
|
145
|
+
export
|
|
146
|
+
static_collected
|
|
147
|
+
data
|
kraph-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kraph
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: the arkitekt knowledge graph
|
|
5
|
+
Author-email: jhnnsrs <jhnnsrs@gmail.com>
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
Requires-Python: <4.0,>=3.11
|
|
8
|
+
Requires-Dist: rath>=3.2
|
|
9
|
+
Requires-Dist: websockets>=15.0.1
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# kraph
|
|
13
|
+
|
|
14
|
+
Kraph is a Python library for creating and manipulating knowledge graphs build around apache AGE.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- Create and manipulate knowledge graphs
|
|
19
|
+
- Query knowledge graphs using Cypher
|
|
20
|
+
- Ontology support (custom entities and relationships)
|
|
21
|
+
- GraphQL API for adding and querying data
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install kraph
|
|
28
|
+
```
|
kraph-0.1.0/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# kraph
|
|
2
|
+
|
|
3
|
+
Kraph is a Python library for creating and manipulating knowledge graphs build around apache AGE.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Create and manipulate knowledge graphs
|
|
8
|
+
- Query knowledge graphs using Cypher
|
|
9
|
+
- Ontology support (custom entities and relationships)
|
|
10
|
+
- GraphQL API for adding and querying data
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install kraph
|
|
17
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from .kraph import Kraph
|
|
2
|
+
from .utils import *
|
|
3
|
+
|
|
4
|
+
try:
|
|
5
|
+
from .arkitekt import KraphService
|
|
6
|
+
except ImportError as e:
|
|
7
|
+
try:
|
|
8
|
+
import arkitekt_next
|
|
9
|
+
except ImportError:
|
|
10
|
+
pass
|
|
11
|
+
else:
|
|
12
|
+
raise e
|
|
13
|
+
try:
|
|
14
|
+
from .rekuest import structure_reg
|
|
15
|
+
except ImportError as e:
|
|
16
|
+
try:
|
|
17
|
+
import rekuest_next
|
|
18
|
+
except ImportError:
|
|
19
|
+
pass
|
|
20
|
+
else:
|
|
21
|
+
raise e
|
|
22
|
+
|
|
23
|
+
__all__ = ["Kraph", "structure_reg", "KraphService"]
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_url": "http://jhnnsrs-lab/kraph/graphql",
|
|
3
|
+
"documents": "graphql/kraph/*/**.graphql",
|
|
4
|
+
"extensions": {
|
|
5
|
+
"turms": {
|
|
6
|
+
"pydantic_version": "v2",
|
|
7
|
+
"domain": null,
|
|
8
|
+
"out_dir": "kraph/api",
|
|
9
|
+
"dump_configuration": true,
|
|
10
|
+
"configuration_name": "project.json",
|
|
11
|
+
"dump_schema": true,
|
|
12
|
+
"schema_name": "schema.graphql",
|
|
13
|
+
"generated_name": "schema.py",
|
|
14
|
+
"documents": "graphql/kraph/*/**.graphql",
|
|
15
|
+
"verbose": false,
|
|
16
|
+
"exit_on_error": true,
|
|
17
|
+
"allow_introspection": true,
|
|
18
|
+
"object_bases": [
|
|
19
|
+
"pydantic.BaseModel"
|
|
20
|
+
],
|
|
21
|
+
"interface_bases": null,
|
|
22
|
+
"always_resolve_interfaces": true,
|
|
23
|
+
"exclude_typenames": true,
|
|
24
|
+
"scalar_definitions": {
|
|
25
|
+
"StructureString": "kraph.scalars.StructureString",
|
|
26
|
+
"StructureIdentifier": "kraph.scalars.StructureIdentifier",
|
|
27
|
+
"UntypedPlateChild": "typing.Any",
|
|
28
|
+
"Cypher": "kraph.scalars.Cypher",
|
|
29
|
+
"Any": "typing.Any",
|
|
30
|
+
"NodeID": "kraph.scalars.NodeID",
|
|
31
|
+
"ArrayLike": "kraph.scalars.ArrayLike",
|
|
32
|
+
"ParquetLike": "kraph.scalars.ParquetLike",
|
|
33
|
+
"FileLike": "kraph.scalars.FileLike",
|
|
34
|
+
"Vector": "kraph.scalars.Vector",
|
|
35
|
+
"TwoDVector": "kraph.scalars.TwoDVector",
|
|
36
|
+
"ThreeDVector": "kraph.scalars.ThreeDVector",
|
|
37
|
+
"FourDVector": "kraph.scalars.FourDVector",
|
|
38
|
+
"FiveDVector": "kraph.scalars.FiveDVector",
|
|
39
|
+
"Matrix": "kraph.scalars.Matrix",
|
|
40
|
+
"Metric": "typing.Any",
|
|
41
|
+
"Milliseconds": "kraph.scalars.Milliseconds",
|
|
42
|
+
"Micrometers": "kraph.scalars.Micrometers",
|
|
43
|
+
"MikroStore": "kraph.scalars.MikroStore",
|
|
44
|
+
"Micrograms": "kraph.scalars.Micrograms",
|
|
45
|
+
"Microliters": "kraph.scalars.Microliters",
|
|
46
|
+
"FourByFourMatrix": "kraph.scalars.FourByFourMatrix",
|
|
47
|
+
"ID": "rath.scalars.ID",
|
|
48
|
+
"RGBAColor": "kraph.scalars.RGBAColor",
|
|
49
|
+
"RemoteUpload": "kraph.scalars.RemoteUpload"
|
|
50
|
+
},
|
|
51
|
+
"freeze": {
|
|
52
|
+
"enabled": true,
|
|
53
|
+
"types": [
|
|
54
|
+
"input",
|
|
55
|
+
"fragment",
|
|
56
|
+
"object"
|
|
57
|
+
],
|
|
58
|
+
"exclude": null,
|
|
59
|
+
"include": null,
|
|
60
|
+
"exclude_fields": [],
|
|
61
|
+
"include_fields": [],
|
|
62
|
+
"convert_list_to_tuple": true
|
|
63
|
+
},
|
|
64
|
+
"create_catchall": true,
|
|
65
|
+
"options": {
|
|
66
|
+
"enabled": true,
|
|
67
|
+
"extra": "forbid",
|
|
68
|
+
"allow_mutation": null,
|
|
69
|
+
"allow_population_by_field_name": true,
|
|
70
|
+
"orm_mode": null,
|
|
71
|
+
"use_enum_values": true,
|
|
72
|
+
"validate_assignment": null,
|
|
73
|
+
"types": [
|
|
74
|
+
"input"
|
|
75
|
+
],
|
|
76
|
+
"exclude": null,
|
|
77
|
+
"include": null
|
|
78
|
+
},
|
|
79
|
+
"skip_forwards": false,
|
|
80
|
+
"additional_bases": {
|
|
81
|
+
"Ontology": [
|
|
82
|
+
"kraph.traits.OntologyTrait"
|
|
83
|
+
],
|
|
84
|
+
"Graph": [
|
|
85
|
+
"kraph.traits.GraphTrait"
|
|
86
|
+
],
|
|
87
|
+
"StructureCategory": [
|
|
88
|
+
"kraph.traits.StructureCategoryTrait"
|
|
89
|
+
],
|
|
90
|
+
"EntityCategory": [
|
|
91
|
+
"kraph.traits.EntityCategoryTrait"
|
|
92
|
+
],
|
|
93
|
+
"MetricCategory": [
|
|
94
|
+
"kraph.traits.MetricCategoryTrait"
|
|
95
|
+
],
|
|
96
|
+
"MeasurementCategory": [
|
|
97
|
+
"kraph.traits.MeasurementCategoryTrait"
|
|
98
|
+
],
|
|
99
|
+
"ProtocolEventCategory": [
|
|
100
|
+
"kraph.traits.ProtocolEventCategoryTrait"
|
|
101
|
+
],
|
|
102
|
+
"NaturalEventCategory": [
|
|
103
|
+
"kraph.traits.NaturalEventCategoryTrait"
|
|
104
|
+
],
|
|
105
|
+
"ReagentCategory": [
|
|
106
|
+
"kraph.traits.ReagentCategoryTrait"
|
|
107
|
+
],
|
|
108
|
+
"RelationCategory": [
|
|
109
|
+
"kraph.traits.RelationCategoryTrait"
|
|
110
|
+
],
|
|
111
|
+
"EntityRoleDefinitionInput": [
|
|
112
|
+
"kraph.traits.EntityRoleDefinitionInputTrait"
|
|
113
|
+
],
|
|
114
|
+
"ReagentRoleDefinitionInput": [
|
|
115
|
+
"kraph.traits.ReagentRoleDefinitionInputTrait"
|
|
116
|
+
],
|
|
117
|
+
"Entity": [
|
|
118
|
+
"kraph.traits.EntityTrait"
|
|
119
|
+
],
|
|
120
|
+
"Structure": [
|
|
121
|
+
"kraph.traits.StructureTrait"
|
|
122
|
+
],
|
|
123
|
+
"Metric": [
|
|
124
|
+
"kraph.traits.MetricTrait"
|
|
125
|
+
],
|
|
126
|
+
"EntityRelation": [
|
|
127
|
+
"kraph.traits.EntityRelationTrait"
|
|
128
|
+
],
|
|
129
|
+
"MediaStore": [
|
|
130
|
+
"kraph.traits.HasPresignedDownloadAccessor"
|
|
131
|
+
],
|
|
132
|
+
"RelationCategoryInput": [
|
|
133
|
+
"kraph.traits.RelationCategoryInputTrait"
|
|
134
|
+
],
|
|
135
|
+
"MeasurementCategoryInput": [
|
|
136
|
+
"kraph.traits.MeasurementCategoryInputTrait"
|
|
137
|
+
],
|
|
138
|
+
"MetricCategoryInput": [
|
|
139
|
+
"kraph.traits.MetricCategoryInputTrait"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"additional_config": {},
|
|
143
|
+
"force_plugin_order": true,
|
|
144
|
+
"parsers": [],
|
|
145
|
+
"plugins": [
|
|
146
|
+
{
|
|
147
|
+
"type": "turms.plugins.enums.EnumsPlugin"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"type": "turms.plugins.inputs.InputsPlugin"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"type": "turms.plugins.fragments.FragmentsPlugin"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"type": "turms.plugins.operations.OperationsPlugin"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"type": "turms.plugins.funcs.FuncsPlugin",
|
|
160
|
+
"expand_input_types": [
|
|
161
|
+
"input"
|
|
162
|
+
],
|
|
163
|
+
"global_kwargs": [
|
|
164
|
+
{
|
|
165
|
+
"type": "kraph.rath.KraphRath",
|
|
166
|
+
"key": "rath",
|
|
167
|
+
"description": "The mikro rath client"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"definitions": [
|
|
171
|
+
{
|
|
172
|
+
"type": "subscription",
|
|
173
|
+
"is_async": true,
|
|
174
|
+
"use": "kraph.funcs.asubscribe"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"type": "query",
|
|
178
|
+
"is_async": true,
|
|
179
|
+
"use": "kraph.funcs.aexecute"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"type": "mutation",
|
|
183
|
+
"is_async": true,
|
|
184
|
+
"use": "kraph.funcs.aexecute"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"type": "subscription",
|
|
188
|
+
"use": "kraph.funcs.subscribe"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"type": "query",
|
|
192
|
+
"use": "kraph.funcs.execute"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"type": "mutation",
|
|
196
|
+
"use": "kraph.funcs.execute"
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"processors": [
|
|
202
|
+
{
|
|
203
|
+
"type": "turms.processors.black.BlackProcessor"
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
"stylers": [
|
|
207
|
+
{
|
|
208
|
+
"type": "turms.stylers.default.DefaultStyler"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"type": "turms.stylers.appender.AppenderStyler",
|
|
212
|
+
"append_fragment": ""
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|