func Init(cfg *config.Config) error { if !graph.IsPersistent(cfg.DatabaseType) { return fmt.Errorf("ignoring unproductive database initialization request: %v", ErrNotPersistent) } return graph.InitTripleStore(cfg.DatabaseType, cfg.DatabasePath, cfg.DatabaseOptions) }
func Init(cfg *config.Config, triplePath string) bool { err := graph.InitTripleStore(cfg.DatabaseType, cfg.DatabasePath, cfg.DatabaseOptions) if err != nil { return false } if triplePath != "" { ts := Open(cfg) Load(ts, cfg, triplePath) ts.Close() } return true }
func Init(cfg *config.Config, triplePath string) error { err := graph.InitTripleStore(cfg.DatabaseType, cfg.DatabasePath, cfg.DatabaseOptions) if err != nil { return err } if triplePath != "" { ts, err := Open(cfg) if err != nil { return err } err = Load(ts, cfg, triplePath) if err != nil { return err } ts.Close() } return err }