@@ -23,8 +23,9 @@ import (
2323
2424const (
2525 envarEngineConfigurationFile = "SENZING_TOOLS_ENGINE_CONFIGURATION_FILE"
26- envarSQLFile string = "SENZING_TOOLS_SQL_FILE"
2726 envarInstallSenzingErConfiguration string = "SENZING_TOOLS_INSTALL_SENZING_ER_CONFIGURATION"
27+ envarLoadTruthset string = "SENZING_TOOLS_LOAD_TRUTHSET"
28+ envarSQLFile string = "SENZING_TOOLS_SQL_FILE"
2829 Short string = "Initialize a database with the Senzing schema and configuration"
2930 Use string = "init-database"
3031)
@@ -35,6 +36,15 @@ var Long = getLong()
3536// Context variables
3637// ----------------------------------------------------------------------------
3738
39+ // Load the TruthSet data found at https://github.com/Senzing/truth-sets.
40+ var OptionLoadTruthset = option.ContextVariable {
41+ Arg : "load-truthset" ,
42+ Default : option .OsLookupEnvBool (envarLoadTruthset , false ),
43+ Envar : envarLoadTruthset ,
44+ Help : "Load the Senzing TruthSet files [%s]" ,
45+ Type : optiontype .Bool ,
46+ }
47+
3848var OptionEngineConfigurationFile = option.ContextVariable {
3949 Arg : "engine-configuration-file" ,
4050 Default : getEngineConfigurationFileDefault (),
@@ -60,7 +70,6 @@ var OptionInstallSenzingErConfiguration = option.ContextVariable{
6070}
6171
6272var ContextVariablesForMultiPlatform = []option.ContextVariable {
63- OptionInstallSenzingErConfiguration ,
6473 option .Configuration ,
6574 option .CoreInstanceName ,
6675 option .CoreLogLevel ,
@@ -71,6 +80,8 @@ var ContextVariablesForMultiPlatform = []option.ContextVariable{
7180 option .LogLevel ,
7281 option .ObserverOrigin ,
7382 option .ObserverURL ,
83+ OptionInstallSenzingErConfiguration ,
84+ OptionLoadTruthset ,
7485}
7586
7687var ContextVariables = append (ContextVariablesForMultiPlatform , ContextVariablesForOsArch ... )
@@ -124,8 +135,10 @@ func RunE(_ *cobra.Command, _ []string) error {
124135 }
125136
126137 initializer := & initializer.BasicInitializer {
127- DataSources : viper .GetStringSlice (option .Datasources .Arg ),
128138 DatabaseURLs : databaseURLs ,
139+ DataSources : viper .GetStringSlice (option .Datasources .Arg ),
140+ InstallSenzingConfiguration : viper .GetBool (OptionInstallSenzingErConfiguration .Arg ),
141+ LoadTruthset : viper .GetBool (OptionLoadTruthset .Arg ),
129142 ObserverOrigin : viper .GetString (option .ObserverOrigin .Arg ),
130143 ObserverURL : viper .GetString (option .ObserverURL .Arg ),
131144 SenzingInstanceName : viper .GetString (option .CoreInstanceName .Arg ),
@@ -134,7 +147,6 @@ func RunE(_ *cobra.Command, _ []string) error {
134147 SenzingSettingsFile : viper .GetString (OptionEngineConfigurationFile .Arg ),
135148 SenzingVerboseLogging : viper .GetInt64 (option .CoreLogLevel .Arg ),
136149 SQLFile : viper .GetString (OptionSQLFile .Arg ),
137- InstallSenzingConfiguration : viper .GetBool (OptionInstallSenzingErConfiguration .Arg ),
138150 }
139151
140152 err = initializer .Initialize (ctx )
0 commit comments