Example #1
0
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)
}
Example #2
0
File: init.go Project: ZSIT/cayley
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
}
Example #3
0
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
}