Skip to content

Commit 3a8d1de

Browse files
committed
Get a minimal bootstrapping procedure started
1 parent 5aab39e commit 3a8d1de

File tree

3 files changed

+2454
-3
lines changed

3 files changed

+2454
-3
lines changed

alzkb/build.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env python
2+
3+
from argparse import ArgumentError
4+
import warnings
5+
import os, sys
6+
7+
def confirm_y_n():
8+
while True:
9+
resp = str(input("Continue with operation? (Y/n): ")).lower().strip()
10+
if resp[0] == 'y':
11+
return True
12+
if resp[0] == 'n':
13+
print("Exiting application...")
14+
sys.exit(0)
15+
print("Please enter y or n.")
16+
17+
18+
def bootstrap():
19+
"""
20+
Retrieve data files needed to build AlzKB from scratch and organize them
21+
into the required directory structure.
22+
"""
23+
pass
24+
25+
def build():
26+
"""
27+
Populate the AlzKB ontology using the local copies of the source databases.
28+
"""
29+
pass
30+
31+
def install():
32+
"""
33+
Import the contents of the AlzKB populated ontology into Neoj4.
34+
"""
35+
pass
36+
37+
def main():
38+
args = sys.argv
39+
40+
try:
41+
assert len(args) > 1
42+
except AssertionError:
43+
raise ArgumentError("Error - must provide one of `bootstrap`, `build`, or `install` as an argument to `alzkb`. See the README for more information.")
44+
45+
if len(args) > 2:
46+
warnings.warn("Multiple arguments provided - only the first will be used.")
47+
48+
op_arg = args[1].lower()
49+
50+
if op_arg == 'bootstrap':
51+
bootstrap()
52+
elif op_arg == 'build':
53+
build()
54+
elif op_arg == 'install':
55+
install()
56+
else:
57+
raise ArgumentError("Error - must provide one of `bootstrap`, `build`, or `install` as an argument to `alzkb`. See the README for more information.")

0 commit comments

Comments
 (0)