Destutter graph/...
This commit is contained in:
parent
913d567ae1
commit
40f3363cde
20 changed files with 188 additions and 189 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue