This repository has been archived by the owner on Nov 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdodo.py
68 lines (56 loc) · 2.04 KB
/
dodo.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# encoding=utf8
from doit import get_var
import os
import logging
import logging.config
logging.config.fileConfig('logging.cfg', )
logger = logging.getLogger(__name__)
logging.getLogger('requests').setLevel(logging.WARNING)
logging.getLogger('rdflib').setLevel(logging.WARNING)
logging.getLogger('urllib3').setLevel(logging.WARNING)
import data_ub_tasks
config = {
'dumps_dir': get_var('dumps_dir', '/opt/data.ub/www/default/dumps'),
'dumps_dir_url': get_var('dumps_dir_url', 'http://data.ub.uio.no/dumps'),
'graph': 'http://data.ub.uio.no/msc-ubo',
'fuseki': 'http://localhost:3031/ds',
'basename': 'msc-ubo',
'git_user': 'ubo-bot',
'git_email': '[email protected]',
}
def task_build():
return {
'doc': 'Run skosify',
'actions': [
'mkdir -p dist',
'skosify -c skosify.cfg -F turtle src/%(basename)s.scheme.ttl src/%(basename)s.ttl -o dist/%(basename)s.ttl' % config,
'skosify -c skosify.cfg -F nt dist/%(basename)s.ttl -o dist/%(basename)s.nt' % config,
'skosify -c skosify.cfg -F xml dist/%(basename)s.ttl -o dist/%(basename)s.rdf.xml' % config,
],
'file_dep': [
'src/%(basename)s.ttl' % config
],
'targets': [
'dist/%(basename)s.ttl' % config,
'dist/%(basename)s.nt' % config,
'dist/%(basename)s.rdf.xml' % config,
]
}
def task_build_mappings():
return data_ub_tasks.build_mappings_gen(
['src/%(basename)s.ttl' % config],
'dist/%(basename)s.mappings.nt' % config,
'http://data.ub.uio.no/msc-ubo'
)
def task_publish_dumps():
return data_ub_tasks.publish_dumps_task_gen(config['dumps_dir'], [
'%s.rdf.xml' % config['basename'],
'%s.ttl' % config['basename'],
'%s.nt' % config['basename'],
'%s.mappings.nt' % config['basename'],
])
def task_fuseki():
return data_ub_tasks.fuseki_task_gen(config, [
'dist/%(basename)s.ttl' % config,
'dist/%(basename)s.mappings.nt' % config,
])