linkml-store 0.1.10__py3-none-any.whl → 0.1.11__py3-none-any.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.
Potentially problematic release.
This version of linkml-store might be problematic. Click here for more details.
- linkml_store/api/client.py +63 -7
- linkml_store/api/collection.py +138 -30
- linkml_store/api/config.py +48 -6
- linkml_store/api/database.py +45 -27
- linkml_store/api/stores/duckdb/duckdb_collection.py +16 -0
- linkml_store/api/stores/duckdb/duckdb_database.py +16 -2
- linkml_store/api/stores/filesystem/filesystem_collection.py +11 -4
- linkml_store/api/stores/filesystem/filesystem_database.py +10 -1
- linkml_store/api/stores/mongodb/mongodb_collection.py +6 -2
- linkml_store/api/stores/mongodb/mongodb_database.py +1 -36
- linkml_store/api/stores/solr/solr_collection.py +4 -4
- linkml_store/cli.py +35 -17
- linkml_store/index/__init__.py +16 -2
- linkml_store/index/implementations/llm_indexer.py +2 -1
- linkml_store/index/indexer.py +13 -2
- linkml_store/utils/file_utils.py +37 -0
- linkml_store/utils/format_utils.py +68 -7
- linkml_store/utils/pandas_utils.py +40 -0
- linkml_store/utils/sql_utils.py +2 -1
- {linkml_store-0.1.10.dist-info → linkml_store-0.1.11.dist-info}/METADATA +36 -3
- {linkml_store-0.1.10.dist-info → linkml_store-0.1.11.dist-info}/RECORD +24 -22
- {linkml_store-0.1.10.dist-info → linkml_store-0.1.11.dist-info}/LICENSE +0 -0
- {linkml_store-0.1.10.dist-info → linkml_store-0.1.11.dist-info}/WHEEL +0 -0
- {linkml_store-0.1.10.dist-info → linkml_store-0.1.11.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from typing import Dict, List, Tuple, Union
|
|
2
|
+
|
|
3
|
+
import pandas as pd
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def facet_summary_to_dataframe_unmelted(
|
|
7
|
+
facet_summary: Dict[Union[str, Tuple[str, ...]], List[Tuple[Union[str, Tuple[str, ...]], int]]]
|
|
8
|
+
) -> pd.DataFrame:
|
|
9
|
+
rows = []
|
|
10
|
+
|
|
11
|
+
for facet_type, facet_data in facet_summary.items():
|
|
12
|
+
if isinstance(facet_type, str):
|
|
13
|
+
# Single facet type
|
|
14
|
+
for category, value in facet_data:
|
|
15
|
+
rows.append({facet_type: category, "Value": value})
|
|
16
|
+
else:
|
|
17
|
+
# Multiple facet types
|
|
18
|
+
for cat_val_tuple in facet_data:
|
|
19
|
+
if len(cat_val_tuple) == 2:
|
|
20
|
+
categories, value = cat_val_tuple
|
|
21
|
+
else:
|
|
22
|
+
categories, value = cat_val_tuple[:-1], cat_val_tuple[-1]
|
|
23
|
+
row = {"Value": value}
|
|
24
|
+
for i, facet in enumerate(facet_type):
|
|
25
|
+
row[facet] = categories[i]
|
|
26
|
+
rows.append(row)
|
|
27
|
+
|
|
28
|
+
df = pd.DataFrame(rows)
|
|
29
|
+
|
|
30
|
+
# Ensure all columns are present, fill with None if missing
|
|
31
|
+
all_columns = set(col for facet in facet_summary.keys() for col in (facet if isinstance(facet, tuple) else [facet]))
|
|
32
|
+
for col in all_columns:
|
|
33
|
+
if col not in df.columns:
|
|
34
|
+
df[col] = None
|
|
35
|
+
|
|
36
|
+
# Move 'Value' to the end
|
|
37
|
+
cols = [col for col in df.columns if col != "Value"] + ["Value"]
|
|
38
|
+
df = df[cols]
|
|
39
|
+
|
|
40
|
+
return df
|
linkml_store/utils/sql_utils.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: linkml-store
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Summary: linkml-store
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Author 1
|
|
@@ -16,6 +16,7 @@ Provides-Extra: analytics
|
|
|
16
16
|
Provides-Extra: app
|
|
17
17
|
Provides-Extra: chromadb
|
|
18
18
|
Provides-Extra: fastapi
|
|
19
|
+
Provides-Extra: frictionless
|
|
19
20
|
Provides-Extra: h5py
|
|
20
21
|
Provides-Extra: llm
|
|
21
22
|
Provides-Extra: map
|
|
@@ -30,11 +31,12 @@ Requires-Dist: click
|
|
|
30
31
|
Requires-Dist: duckdb (>=0.10.1,<0.11.0)
|
|
31
32
|
Requires-Dist: duckdb-engine (>=0.11.2)
|
|
32
33
|
Requires-Dist: fastapi ; extra == "fastapi"
|
|
34
|
+
Requires-Dist: frictionless ; extra == "frictionless"
|
|
33
35
|
Requires-Dist: h5py ; extra == "h5py"
|
|
34
36
|
Requires-Dist: jinja2 (>=3.1.4,<4.0.0)
|
|
35
37
|
Requires-Dist: jsonlines (>=4.0.0,<5.0.0)
|
|
36
|
-
Requires-Dist: linkml ; extra == "validation"
|
|
37
|
-
Requires-Dist: linkml-runtime (>=1.8.
|
|
38
|
+
Requires-Dist: linkml (>=1.8.0) ; extra == "validation"
|
|
39
|
+
Requires-Dist: linkml-runtime (>=1.8.0)
|
|
38
40
|
Requires-Dist: linkml_map ; extra == "map"
|
|
39
41
|
Requires-Dist: linkml_renderer ; extra == "renderer"
|
|
40
42
|
Requires-Dist: llm ; extra == "llm"
|
|
@@ -122,6 +124,10 @@ need to have a vector database to run embedding search!
|
|
|
122
124
|
|
|
123
125
|
See [How to Use-Semantic-Search](https://linkml.io/linkml-store/how-to/Use-Semantic-Search.html)
|
|
124
126
|
|
|
127
|
+
### Use with LLMs
|
|
128
|
+
|
|
129
|
+
TODO - docs
|
|
130
|
+
|
|
125
131
|
### Validation
|
|
126
132
|
|
|
127
133
|
LinkML-Store is backed by [LinkML](https://linkml.io), which allows
|
|
@@ -131,6 +137,33 @@ See [Indexing JSON](https://linkml.io/linkml-store/how-to/Index-Phenopackets.htm
|
|
|
131
137
|
|
|
132
138
|
and [Referential Integrity](https://linkml.io/linkml-store/how-to/Check-Referential-Integrity.html)
|
|
133
139
|
|
|
140
|
+
## Web API
|
|
141
|
+
|
|
142
|
+
There is a preliminary API following HATEOAS principles implemented using FastAPI.
|
|
143
|
+
|
|
144
|
+
To start you should first create a config file, e.g. `db/conf.yaml`:
|
|
145
|
+
|
|
146
|
+
Then run:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
export LINKML_STORE_CONFIG=./db/conf.yaml
|
|
150
|
+
make api
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
The API returns links as well as data objects, it's recommended to use a Chrome plugin for JSON viewing
|
|
154
|
+
for exploring the API. TODO: add docs here.
|
|
155
|
+
|
|
156
|
+
The main endpoints are:
|
|
157
|
+
|
|
158
|
+
* `http://localhost:8000/` - the root of the API
|
|
159
|
+
* `http://localhost:8000/pages/` - browse the API via HTML
|
|
160
|
+
* `http://localhost:8000/docs` - the Swagger UI
|
|
161
|
+
|
|
162
|
+
## Streamlit app
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
make app
|
|
166
|
+
```
|
|
134
167
|
|
|
135
168
|
## Background
|
|
136
169
|
|
|
@@ -1,48 +1,50 @@
|
|
|
1
1
|
linkml_store/__init__.py,sha256=jlU6WOUAn8cKIhzbTULmBTWpW9gZdEt7q_RI6KZN1bY,118
|
|
2
2
|
linkml_store/api/__init__.py,sha256=3CelcFEFz0y3MkQAzhQ9JxHIt1zFk6nYZxSmYTo8YZE,226
|
|
3
|
-
linkml_store/api/client.py,sha256=
|
|
4
|
-
linkml_store/api/collection.py,sha256=
|
|
5
|
-
linkml_store/api/config.py,sha256=
|
|
6
|
-
linkml_store/api/database.py,sha256=
|
|
3
|
+
linkml_store/api/client.py,sha256=8hfO7loCxGbqcmbKXqheRRh5AUbhHvFJxk1WDiYIYik,10890
|
|
4
|
+
linkml_store/api/collection.py,sha256=Z5LoBitii7C8jKN6fGcajaxq63n8ktEh2Da9sAs1UIk,34674
|
|
5
|
+
linkml_store/api/config.py,sha256=wgXmDhViayUOiAlFgu81G3fPlhMNBATfO4GUQ-TcIjk,4665
|
|
6
|
+
linkml_store/api/database.py,sha256=mWF0pAoGZsk0A9WZP-4lUjbB7xs2nCwJYjH7r4rtBNE,26624
|
|
7
7
|
linkml_store/api/queries.py,sha256=w0qnNeCH6pC9WTGoEQYd300MF6o0G3atz2YxN3WecAs,2028
|
|
8
8
|
linkml_store/api/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
linkml_store/api/stores/chromadb/__init__.py,sha256=e9BkOPuPnVQKA5PRKDulag59yGNHDP3U2_DnPSrFAKM,132
|
|
10
10
|
linkml_store/api/stores/chromadb/chromadb_collection.py,sha256=RQUZx5oeotkzNihg-dlSevkiTiKY1d9x0bS63HF80W4,4270
|
|
11
11
|
linkml_store/api/stores/chromadb/chromadb_database.py,sha256=dZA3LQE8-ZMhJQOzsUFyxehnKpFF7adR182aggfkaFY,3205
|
|
12
12
|
linkml_store/api/stores/duckdb/__init__.py,sha256=rbQSDgNg-fdvi6-pHGYkJTST4p1qXUZBf9sFSsO3KPk,387
|
|
13
|
-
linkml_store/api/stores/duckdb/duckdb_collection.py,sha256=
|
|
14
|
-
linkml_store/api/stores/duckdb/duckdb_database.py,sha256=
|
|
13
|
+
linkml_store/api/stores/duckdb/duckdb_collection.py,sha256=d9aYNFt9t8itNmhb6H2PdsxHL1dkYiW0N9wF8SATk1g,6767
|
|
14
|
+
linkml_store/api/stores/duckdb/duckdb_database.py,sha256=WT7fBp2So9ht-JN2D4oFYoy4k_AfSGVgWKA9MTISFTQ,8664
|
|
15
15
|
linkml_store/api/stores/duckdb/mappings.py,sha256=tDce3W1Apwammhf4LS6cRJ0m4NiJ0eB7vOI_4U5ETY8,148
|
|
16
16
|
linkml_store/api/stores/filesystem/__init__.py,sha256=KjvCjdttwqMHNeGyL-gr59zRz0--HFEWWUNNCJ5hITs,347
|
|
17
|
-
linkml_store/api/stores/filesystem/filesystem_collection.py,sha256=
|
|
18
|
-
linkml_store/api/stores/filesystem/filesystem_database.py,sha256=
|
|
17
|
+
linkml_store/api/stores/filesystem/filesystem_collection.py,sha256=9gqY2KRZsn_RWk4eKkxFd3_wcxs5YaXvcBI7GGJBMGE,6751
|
|
18
|
+
linkml_store/api/stores/filesystem/filesystem_database.py,sha256=sV-lueyrh3R6edyWkwN6qKa7yjPc8PIcF1rxgox6oA4,2875
|
|
19
19
|
linkml_store/api/stores/hdf5/__init__.py,sha256=l4cIh3v7P0nPbwGIsfuCMD_serQ8q8c7iuUA9W2Jb4o,97
|
|
20
20
|
linkml_store/api/stores/hdf5/hdf5_collection.py,sha256=mnpLMYehn3PuaIjp2dXrIWu8jh-bdQ84X2Ku83jMdEY,3805
|
|
21
21
|
linkml_store/api/stores/hdf5/hdf5_database.py,sha256=EZbjrpaqiNDEFvoD5dZNcGBXA8z6HRNL81emueTZWNw,2714
|
|
22
22
|
linkml_store/api/stores/mongodb/__init__.py,sha256=OSFCr7RQlDEe-O-Y0P_i912oAMK-L3pC7Cnj7sxlwAk,510
|
|
23
|
-
linkml_store/api/stores/mongodb/mongodb_collection.py,sha256=
|
|
24
|
-
linkml_store/api/stores/mongodb/mongodb_database.py,sha256=
|
|
23
|
+
linkml_store/api/stores/mongodb/mongodb_collection.py,sha256=W-j1tkk8h1-zzjIRe-IYAnAOwlFSwr4fnDtgiu7RsVI,6695
|
|
24
|
+
linkml_store/api/stores/mongodb/mongodb_database.py,sha256=LQ1Tb70pzLPx1HAvc8CGD7affyCJfOtXZnXJceTY97A,2450
|
|
25
25
|
linkml_store/api/stores/solr/__init__.py,sha256=aAfnaN9mZOiIDj1NYz0Ll9fZF2gG7UU_vhP4SNCL2d8,36
|
|
26
|
-
linkml_store/api/stores/solr/solr_collection.py,sha256=
|
|
26
|
+
linkml_store/api/stores/solr/solr_collection.py,sha256=ZlxC3JbVaHfSA4HuTeJTsp6qe48tHS6Fgel5jsqXcsM,4727
|
|
27
27
|
linkml_store/api/stores/solr/solr_database.py,sha256=TFjqbY7jAkdrhAchbNg0E-mChSP7ogNwFExslbvX7Yo,2877
|
|
28
28
|
linkml_store/api/stores/solr/solr_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
29
|
linkml_store/api/types.py,sha256=3aIQtDFMvsSmjuN5qrR2vNK5sHa6yzD_rEOPA6tHwvg,176
|
|
30
|
-
linkml_store/cli.py,sha256=
|
|
30
|
+
linkml_store/cli.py,sha256=4pxdrmN5hlKalNGLQgfkIIjWXfNENpqHoDu0SzJZuLY,20296
|
|
31
31
|
linkml_store/constants.py,sha256=x4ZmDsfE9rZcL5WpA93uTKrRWzCD6GodYXviVzIvR38,112
|
|
32
|
-
linkml_store/index/__init__.py,sha256=
|
|
32
|
+
linkml_store/index/__init__.py,sha256=6SQzDe-WZSSqbGNsbCDfyPTyz0s9ISDKw1dm9xgQuT4,1396
|
|
33
33
|
linkml_store/index/implementations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
-
linkml_store/index/implementations/llm_indexer.py,sha256=
|
|
34
|
+
linkml_store/index/implementations/llm_indexer.py,sha256=LI5f8SLF_rJY5W6wZPLaUqpyoq-VDW_KqlCBNDNm_po,4827
|
|
35
35
|
linkml_store/index/implementations/simple_indexer.py,sha256=KnkFJtXTHnwjhD_D6ZK2rFhBID1dgCedcOVPEWAY2NU,1282
|
|
36
|
-
linkml_store/index/indexer.py,sha256=
|
|
36
|
+
linkml_store/index/indexer.py,sha256=K-TDPzdTyGFo6iG4XI_A_3IpwDbKeiTIbdr85NIL5r8,4918
|
|
37
37
|
linkml_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
linkml_store/utils/change_utils.py,sha256=O2rvSvgTKB60reLLz9mX5OWykAA_m93bwnUh5ZWa0EY,471
|
|
39
|
-
linkml_store/utils/
|
|
39
|
+
linkml_store/utils/file_utils.py,sha256=rQ7-XpmI6_Kx_dhEnI98muFRr0MmgI_kZ_9cgJBf_0I,1411
|
|
40
|
+
linkml_store/utils/format_utils.py,sha256=m9jBeytym1xkuST1iWbvvdEQn0wPu2ODjYDDHF-WfeA,8608
|
|
40
41
|
linkml_store/utils/io.py,sha256=JHUrWDtlZC2jtN_PQZ4ypdGIyYlftZEN3JaCvEPs44w,884
|
|
41
42
|
linkml_store/utils/object_utils.py,sha256=is6T2gruvVKvWD5ZntcAl6Qi3L154FObEho_b_crTuE,2539
|
|
43
|
+
linkml_store/utils/pandas_utils.py,sha256=INL8aZ5v2OeLg-Uzfa8P1cpnMMKA1DumiTB0q175tw8,1389
|
|
42
44
|
linkml_store/utils/patch_utils.py,sha256=q-h_v68okyruzdPTEHCe0WubbQHKpi1qy5bJ9vFWDo8,4823
|
|
43
45
|
linkml_store/utils/query_utils.py,sha256=HWt46BsGWoIGiNBTtvpXGY6onPRWsQky6eu_9cYqbvo,3440
|
|
44
46
|
linkml_store/utils/schema_utils.py,sha256=iJiZxo5NGr7v87h4DV6V9DrDOZHSswMRuf0N4V2rVtg,646
|
|
45
|
-
linkml_store/utils/sql_utils.py,sha256=
|
|
47
|
+
linkml_store/utils/sql_utils.py,sha256=ecnc8GjeGK41AA-aA1dl7Gy9OBpr_xJ7Gbk-V8VKGCM,5728
|
|
46
48
|
linkml_store/webapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
49
|
linkml_store/webapi/html/__init__.py,sha256=hwp5eeBJKH65Bvv1x9Z4vsT1tLSYtb9Dq4I9r1kL1q0,69
|
|
48
50
|
linkml_store/webapi/html/base.html.j2,sha256=hoiV2uaSxxrQp7VuAZBOHueH7czyJMYcPBRN6dZFYhk,693
|
|
@@ -51,8 +53,8 @@ linkml_store/webapi/html/database_details.html.j2,sha256=qtXdavbZb0mohiObI9dvJtk
|
|
|
51
53
|
linkml_store/webapi/html/databases.html.j2,sha256=a9BCWQYfPeFhdUd31CWhB0yWhTIFXQayO08JgjyqKoc,294
|
|
52
54
|
linkml_store/webapi/html/generic.html.j2,sha256=1P5BKExQX5ZI94tUlMHK9BtTIXkP2ZnLAS014bPOgZM,1001
|
|
53
55
|
linkml_store/webapi/main.py,sha256=VurUh7iAFB0pgdevguRgVcsOgFfKZecOLLkDeLUEGIc,20306
|
|
54
|
-
linkml_store-0.1.
|
|
55
|
-
linkml_store-0.1.
|
|
56
|
-
linkml_store-0.1.
|
|
57
|
-
linkml_store-0.1.
|
|
58
|
-
linkml_store-0.1.
|
|
56
|
+
linkml_store-0.1.11.dist-info/LICENSE,sha256=77mDOslUnalYnuq9xQYZKtIoNEzcH9mIjvWHOKjamnE,1086
|
|
57
|
+
linkml_store-0.1.11.dist-info/METADATA,sha256=Ax6ogNmpPOy5OQy2b4T1eGohOJYmDG15gk441ZVUYEM,5471
|
|
58
|
+
linkml_store-0.1.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
59
|
+
linkml_store-0.1.11.dist-info/entry_points.txt,sha256=gWxVsHqx-t-UKWFHFzawQTvs4is4vC1rCF5AeKyqWWk,101
|
|
60
|
+
linkml_store-0.1.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|