-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdatasets.py
31 lines (26 loc) · 975 Bytes
/
datasets.py
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
import os
import shutil
from lxltools.datacompiler import Compiler
import syscore
import common
import docs
SCRIPT_DIR = os.path.dirname(__file__) or '.'
BASE = "https://id.kb.se/"
compiler = Compiler(base_dir=SCRIPT_DIR,
dataset_id=BASE + 'dataset/definitions',
created='2013-10-17T14:07:48.000Z',
tool_id=BASE + 'generator/definitions',
context='sys/context/base.jsonld',
record_thing_link='mainEntity',
system_base_iri='',
union='definitions.jsonld.lines')
if __name__ == '__main__':
compiler.main()
syscore.compiler.main()
common.compiler.main()
docs.compiler.main()
out_dir = compiler.outdir
with (out_dir / compiler.union).open('ab') as defs_f:
for mod in [syscore, common, docs]:
with (out_dir / mod.compiler.union).open('rb') as f:
shutil.copyfileobj(f, defs_f)