-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubClassReasoner-runner.py
More file actions
36 lines (29 loc) · 1.49 KB
/
SubClassReasoner-runner.py
File metadata and controls
36 lines (29 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import click
from src.SubClassReasoner import SubClassReasoner
@click.command()
@click.option('--server', '-s', default="http://localhost:8585/bigdata/sparql",
help='Uri to the sparql endpoint which stores the RDFS SubClass Information.')
@click.option('--user', '-u', default="admin", help='User for the sparql endpoint.')
@click.option('--password', '-p', default="dev98912011", help='Password for the sparql endpoint.')
@click.option('--n-processes', '-x', default="11",
help='Number of processes to spawn simultaneously.')
@click.option('--file', '-f', default=None,
help='Input file to reason about.')
@click.option('--target', '-t', default="./reasoned/",
help='Output folder to save reasoned data to.')
@click.option('--prop-path/--no-prop-path', default=True)
@click.option('--log-level', '-l', default="WARN")
@click.option('--offset', '-o', default="0")
def main(server, user, password, log_level, n_processes, prop_path, file, target, offset):
offset = int(offset)
reasoner = SubClassReasoner(server=server, user=user, password=password,
prop_path=bool(prop_path), n_processes=int(n_processes), log_level=log_level)
if file is None:
reasoner.reason(in_file=None, target=target, offset=offset)
elif type(file) is list:
for f in file:
reasoner.reason(f, target, offset=offset)
else:
reasoner.reason(file, target, offset=offset)
if __name__ == '__main__':
main()