@@ -29,8 +29,8 @@ export class Generator {
29
29
private readonly enhancementConfig : string ;
30
30
private readonly fragmentConfig : string ;
31
31
private readonly queryConfig : string ;
32
- private readonly validationParams : string ;
33
- private readonly validationConfig : string ;
32
+ private readonly validationParams : string | undefined ;
33
+ private readonly validationConfig : string | undefined ;
34
34
private readonly hadoopMemory : string ;
35
35
private readonly mainModulePath : string ;
36
36
@@ -82,8 +82,10 @@ export class Generator {
82
82
await this . runPhase ( 'SNB dataset enhancer' , 'out-enhanced' , ( ) => this . enhanceSnbDataset ( ) ) ;
83
83
await this . runPhase ( 'SNB dataset fragmenter' , 'out-fragments' , ( ) => this . fragmentSnbDataset ( ) ) ;
84
84
await this . runPhase ( 'SPARQL query instantiator' , 'out-queries' , ( ) => this . instantiateQueries ( ) ) ;
85
- await this . runPhase ( 'SNB validation downloader' , 'out-validate-params' , ( ) => this . downloadValidationParams ( ) ) ;
86
- await this . runPhase ( 'SNB validation generator' , 'out-validate' , ( ) => this . generateValidation ( ) ) ;
85
+ if ( this . validationParams && this . validationConfig ) {
86
+ await this . runPhase ( 'SNB validation downloader' , 'out-validate-params' , ( ) => this . downloadValidationParams ( ) ) ;
87
+ await this . runPhase ( 'SNB validation generator' , 'out-validate' , ( ) => this . generateValidation ( ) ) ;
88
+ }
87
89
const timeEnd = process . hrtime ( timeStart ) ;
88
90
this . log ( 'All' , `Done in ${ timeEnd [ 0 ] + ( timeEnd [ 1 ] / 1_000_000_000 ) } seconds` ) ;
89
91
}
@@ -210,7 +212,7 @@ export class Generator {
210
212
211
213
// Download and extract zip file
212
214
return new Promise ( ( resolve , reject ) => {
213
- request ( this . validationParams , ( res ) => {
215
+ request ( this . validationParams ! , ( res ) => {
214
216
res
215
217
. on ( 'error' , reject )
216
218
. pipe ( Extract ( { path : target } ) )
@@ -230,7 +232,7 @@ export class Generator {
230
232
// Run generator
231
233
const oldCwd = process . cwd ( ) ;
232
234
process . chdir ( this . cwd ) ;
233
- await runValidationGenerator ( this . validationConfig , { mainModulePath : this . mainModulePath } , {
235
+ await runValidationGenerator ( this . validationConfig ! , { mainModulePath : this . mainModulePath } , {
234
236
variables : await this . generateVariables ( ) ,
235
237
} ) ;
236
238
process . chdir ( oldCwd ) ;
@@ -259,7 +261,7 @@ export interface IGeneratorOptions {
259
261
enhancementConfig : string ;
260
262
fragmentConfig : string ;
261
263
queryConfig : string ;
262
- validationParams : string ;
263
- validationConfig : string ;
264
+ validationParams ? : string ;
265
+ validationConfig ? : string ;
264
266
hadoopMemory : string ;
265
267
}
0 commit comments