-
Notifications
You must be signed in to change notification settings - Fork 1
/
env.js
146 lines (123 loc) · 4.28 KB
/
env.js
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import envvar from 'env-var';
// Environment variables
export const EXPORT_CRON_PATTERN = envvar
.get('EXPORT_CRON_PATTERN')
.required()
.example('0 0 0 * * *')
.default('0 0 */2 * * *')
.asString();
export const RETRY_CRON_PATTERN = envvar
.get('RETRY_CRON_PATTERN')
.required()
.example('0 0 0 * * *')
.default('0 * * * *')
.asString();
export const MU_SPARQL_ENDPOINT = envvar
.get('MU_SPARQL_ENDPOINT')
.required()
.example('http://virtuoso:8890/sparql')
.default('http://virtuoso:8890/sparql')
.asUrlString();
export const EXPORT_TTL_BATCH_SIZE = envvar
.get('EXPORT_TTL_BATCH_SIZE')
.default('1000')
.asIntPositive();
export const MAX_NUMBER_OF_RETRIES = envvar
.get('NUMBER_OF_RETRIES')
.default('3')
.asIntPositive();
export const MU_APPLICATION_GRAPH = envvar
.get('MU_APPLICATION_GRAPH')
.required()
.example('http://mu-semtech/graphs/application')
.asUrlString();
export const EXPORT_FILE_BASE = envvar
.get('EXPORT_FILE_BASE')
.required()
.default('mandaten')
.asString();
export const FILE_OUTPUT_DIR = envvar
.get('FILE_OUTPUT_DIR')
.required()
.default('/share/exports')
.asString();
export const JOBS_GRAPH = envvar
.get('JOBS_GRAPH')
.required()
.default('http://mu.semte.ch/graphs/system/jobs')
.asUrlString();
export const FILES_GRAPH = envvar
.get('FILES_GRAPH')
.required()
.default('http://mu.semte.ch/graphs/system/jobs')
.asUrlString();
export const EXPORT_CLASSIFICATION_URI = envvar
.get('EXPORT_CLASSIFICATION_URI')
.required()
.default('http://redpencil.data.gift/id/exports/concept/GenericExport')
.asUrlString();
export const TASK_OPERATION_URI = envvar
.get('TASK_OPERATION_URI')
.required()
.default(
'http://lblod.data.gift/id/jobs/concept/TaskOperation/exportMandatarissen',
)
.asUrlString();
export const CSV_EXPORT_SPARQL_FILE = envvar
.get('CSV_EXPORT_SPARQL_FILE ')
.default('/config/csv-export.sparql')
.asString();
export const PING_DB_INTERVAL = envvar
.get('PING_DB_INTERVAL')
.default('2000') // 2 seconds
.asIntPositive();
export const SLEEP_INTERVAL = envvar
.get('SLEEP_INTERVAL')
.required()
.default('1000') // 1 second
.asIntPositive();
// Constants
export const STATUS_BUSY =
'http://redpencil.data.gift/id/concept/JobStatus/busy';
export const STATUS_SCHEDULED =
'http://redpencil.data.gift/id/concept/JobStatus/scheduled';
export const STATUS_SUCCESS =
'http://redpencil.data.gift/id/concept/JobStatus/success';
export const STATUS_FAILED =
'http://redpencil.data.gift/id/concept/JobStatus/failed';
export const STATUS_CANCELED =
'http://redpencil.data.gift/id/concept/JobStatus/canceled';
export const JOB_OPERATION_URI =
'http://redpencil.data.gift/id/jobs/concept/JobOperation/DownloadGeneration';
export const JOB_TYPE = 'http://vocab.deri.ie/cogs#Job';
export const TASK_TYPE = 'http://redpencil.data.gift/vocabularies/tasks/Task';
export const EXPORT_TYPE =
'http://redpencil.data.gift/vocabularies/exports/Export';
export const ERROR_TYPE = 'http://open-services.net/ns/core#Error';
export const PREFIXES = `
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
PREFIX task: <http://redpencil.data.gift/vocabularies/tasks/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
PREFIX oslc: <http://open-services.net/ns/core#>
PREFIX cogs: <http://vocab.deri.ie/cogs#>
PREFIX adms: <http://www.w3.org/ns/adms#>
PREFIX export: <http://redpencil.data.gift/vocabularies/exports/>
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
PREFIX dbpedia: <http://dbpedia.org/ontology/>
`;
export const TASK_URI_PREFIX = 'http://redpencil.data.gift/id/task/';
export const JOB_URI_PREFIX = 'http://redpencil.data.gift/id/job/';
export const CONTAINER_URI_PREFIX =
'http://redpencil.data.gift/id/dataContainers/';
export const ERROR_URI_PREFIX = 'http://redpencil.data.gift/id/jobs/error/';
export const JOB_CREATOR_URI =
'http://lblod.data.gift/services/DownloadGeneratorService';
// Sparql connection options for mu-auth-sudo
export const sparqlConnectionOptions = {
sparqlEndpoint: MU_SPARQL_ENDPOINT,
mayRetry: true,
};