Destutter graph/...

This commit is contained in:
kortschak 2014-06-28 13:29:16 +09:30
parent 913d567ae1
commit 40f3363cde
20 changed files with 188 additions and 189 deletions

View file

@ -29,7 +29,7 @@ func Load(ts graph.TripleStore, cfg *config.Config, triplePath string, firstTime
switch cfg.DatabaseType {
case "mongo", "mongodb":
if firstTime {
loadMongo(ts.(*mongo.MongoTripleStore), triplePath)
loadMongo(ts.(*mongo.TripleStore), triplePath)
} else {
LoadTriplesFromFileInto(ts, triplePath, cfg.LoadSize)
}
@ -43,7 +43,7 @@ func Load(ts graph.TripleStore, cfg *config.Config, triplePath string, firstTime
}
func loadMongo(ts *mongo.MongoTripleStore, path string) {
func loadMongo(ts *mongo.TripleStore, path string) {
tChan := make(chan *graph.Triple)
go ReadTriplesFromFile(tChan, path)
ts.BulkLoad(tChan)

View file

@ -28,11 +28,11 @@ func OpenTSFrom(cfg *config.Config) graph.TripleStore {
glog.Infof("Opening database \"%s\" at %s", cfg.DatabaseType, cfg.DatabasePath)
switch cfg.DatabaseType {
case "mongo", "mongodb":
return mongo.NewMongoTripleStore(cfg.DatabasePath, cfg.DatabaseOptions)
return mongo.NewTripleStore(cfg.DatabasePath, cfg.DatabaseOptions)
case "leveldb":
return leveldb.NewDefaultLevelDBTripleStore(cfg.DatabasePath, cfg.DatabaseOptions)
return leveldb.NewTripleStore(cfg.DatabasePath, cfg.DatabaseOptions)
case "mem":
ts := memstore.NewMemTripleStore()
ts := memstore.NewTripleStore()
Load(ts, cfg, cfg.DatabasePath, true)
return ts
}

View file

@ -64,7 +64,7 @@ func Repl(ts graph.TripleStore, queryLanguage string, cfg *config.Config) {
var ses graph.Session
switch queryLanguage {
case "sexp":
ses = sexp.NewSexpSession(ts)
ses = sexp.NewSession(ts)
case "mql":
ses = mql.NewSession(ts)
case "gremlin":