nmdc-runtime 1.6.0__py3-none-any.whl → 1.8.0__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 nmdc-runtime might be problematic. Click here for more details.
- nmdc_runtime/site/export/ncbi_xml.py +529 -0
- nmdc_runtime/site/export/ncbi_xml_utils.py +206 -0
- nmdc_runtime/site/export/study_metadata.py +24 -4
- nmdc_runtime/site/graphs.py +29 -11
- nmdc_runtime/site/ops.py +180 -44
- nmdc_runtime/site/repository.py +58 -6
- nmdc_runtime/site/resources.py +30 -40
- nmdc_runtime/site/translation/submission_portal_translator.py +16 -9
- nmdc_runtime/util.py +24 -1
- {nmdc_runtime-1.6.0.dist-info → nmdc_runtime-1.8.0.dist-info}/METADATA +4 -7
- {nmdc_runtime-1.6.0.dist-info → nmdc_runtime-1.8.0.dist-info}/RECORD +15 -17
- {nmdc_runtime-1.6.0.dist-info → nmdc_runtime-1.8.0.dist-info}/WHEEL +1 -1
- {nmdc_runtime-1.6.0.dist-info → nmdc_runtime-1.8.0.dist-info}/entry_points.txt +0 -1
- nmdc_runtime/site/terminusdb/__init__.py +0 -0
- nmdc_runtime/site/terminusdb/generate.py +0 -198
- nmdc_runtime/site/terminusdb/ingest.py +0 -44
- nmdc_runtime/site/terminusdb/schema.py +0 -1671
- {nmdc_runtime-1.6.0.dist-info → nmdc_runtime-1.8.0.dist-info}/LICENSE +0 -0
- {nmdc_runtime-1.6.0.dist-info → nmdc_runtime-1.8.0.dist-info}/top_level.txt +0 -0
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
|
|
4
|
-
from terminusdb_client import WOQLClient
|
|
5
|
-
|
|
6
|
-
team = "admin"
|
|
7
|
-
client = WOQLClient(f"http://localhost:6364/")
|
|
8
|
-
# make sure you have put the token in environment variable
|
|
9
|
-
# https://docs.terminusdb.com/v10.0/#/terminusx/get-your-api-key
|
|
10
|
-
client.connect(user=team, team=team, key="root")
|
|
11
|
-
|
|
12
|
-
dbid = "nmdc"
|
|
13
|
-
label = "NMDC"
|
|
14
|
-
description = "."
|
|
15
|
-
prefixes = {
|
|
16
|
-
"@base": "terminusdb:///data/",
|
|
17
|
-
"@schema": "terminusdb:///schema#",
|
|
18
|
-
"gold": "https://gold.jgi.doe.gov/biosample?id=",
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def import_schema(client):
|
|
23
|
-
# sd = get_nmdc_schema_definition()
|
|
24
|
-
# sd.source_file = f"{REPO_ROOT_DIR.parent}/nmdc-schema/src/schema/nmdc.yaml"
|
|
25
|
-
# print(sd.source_file)
|
|
26
|
-
with open(Path(__file__).parent.joinpath("nmdc.schema.terminusdb.json")) as f:
|
|
27
|
-
schema_objects = json.load(f)
|
|
28
|
-
|
|
29
|
-
client.message = "Adding NMDC Schema"
|
|
30
|
-
results = client.insert_document(schema_objects, graph_type="schema")
|
|
31
|
-
print(f"Added schema: {results}")
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if __name__ == "__main__":
|
|
35
|
-
exists = client.get_database(dbid)
|
|
36
|
-
|
|
37
|
-
if exists:
|
|
38
|
-
client.delete_database(dbid, team=team, force=True)
|
|
39
|
-
|
|
40
|
-
client.create_database(
|
|
41
|
-
dbid, team, label=label, description=description, prefixes=prefixes
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
import_schema(client)
|