Merge branch 'declassify' into tip
Conflicts: graph/iterator/hasa_iterator.go graph/iterator/linksto_iterator.go graph/iterator/query_shape_test.go graph/leveldb/all_iterator.go graph/leveldb/iterator.go graph/leveldb/leveldb_test.go graph/memstore/triplestore_test.go graph/mongo/iterator.go
This commit is contained in:
commit
2dbbd17fe1
34 changed files with 823 additions and 457 deletions
|
|
@ -136,7 +136,7 @@ func buildInOutIterator(obj *otto.Object, ts graph.TripleStore, base graph.Itera
|
|||
tags = makeListOfStringsFromArrayValue(one.Object())
|
||||
}
|
||||
for _, tag := range tags {
|
||||
predicateNodeIterator.AddTag(tag)
|
||||
predicateNodeIterator.Tagger().Add(tag)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ func buildIteratorTreeHelper(obj *otto.Object, ts graph.TripleStore, base graph.
|
|||
case "tag":
|
||||
it = subIt
|
||||
for _, tag := range stringArgs {
|
||||
it.AddTag(tag)
|
||||
it.Tagger().Add(tag)
|
||||
}
|
||||
case "save":
|
||||
all := ts.NodesAllIterator()
|
||||
|
|
@ -188,9 +188,9 @@ func buildIteratorTreeHelper(obj *otto.Object, ts graph.TripleStore, base graph.
|
|||
return iterator.NewNull()
|
||||
}
|
||||
if len(stringArgs) == 2 {
|
||||
all.AddTag(stringArgs[1])
|
||||
all.Tagger().Add(stringArgs[1])
|
||||
} else {
|
||||
all.AddTag(stringArgs[0])
|
||||
all.Tagger().Add(stringArgs[0])
|
||||
}
|
||||
predFixed := ts.FixedIterator()
|
||||
predFixed.Add(ts.ValueOf(stringArgs[0]))
|
||||
|
|
@ -208,9 +208,9 @@ func buildIteratorTreeHelper(obj *otto.Object, ts graph.TripleStore, base graph.
|
|||
return iterator.NewNull()
|
||||
}
|
||||
if len(stringArgs) == 2 {
|
||||
all.AddTag(stringArgs[1])
|
||||
all.Tagger().Add(stringArgs[1])
|
||||
} else {
|
||||
all.AddTag(stringArgs[0])
|
||||
all.Tagger().Add(stringArgs[0])
|
||||
}
|
||||
predFixed := ts.FixedIterator()
|
||||
predFixed.Add(ts.ValueOf(stringArgs[0]))
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ func embedFinals(env *otto.Otto, ses *Session, obj *otto.Object) {
|
|||
func allFunc(env *otto.Otto, ses *Session, obj *otto.Object) func(otto.FunctionCall) otto.Value {
|
||||
return func(call otto.FunctionCall) otto.Value {
|
||||
it := buildIteratorTree(obj, ses.ts)
|
||||
it.AddTag(TopResultTag)
|
||||
it.Tagger().Add(TopResultTag)
|
||||
ses.limit = -1
|
||||
ses.count = 0
|
||||
runIteratorOnSession(it, ses)
|
||||
|
|
@ -51,7 +51,7 @@ func limitFunc(env *otto.Otto, ses *Session, obj *otto.Object) func(otto.Functio
|
|||
if len(call.ArgumentList) > 0 {
|
||||
limitVal, _ := call.Argument(0).ToInteger()
|
||||
it := buildIteratorTree(obj, ses.ts)
|
||||
it.AddTag(TopResultTag)
|
||||
it.Tagger().Add(TopResultTag)
|
||||
ses.limit = int(limitVal)
|
||||
ses.count = 0
|
||||
runIteratorOnSession(it, ses)
|
||||
|
|
@ -63,7 +63,7 @@ func limitFunc(env *otto.Otto, ses *Session, obj *otto.Object) func(otto.Functio
|
|||
func toArrayFunc(env *otto.Otto, ses *Session, obj *otto.Object, withTags bool) func(otto.FunctionCall) otto.Value {
|
||||
return func(call otto.FunctionCall) otto.Value {
|
||||
it := buildIteratorTree(obj, ses.ts)
|
||||
it.AddTag(TopResultTag)
|
||||
it.Tagger().Add(TopResultTag)
|
||||
limit := -1
|
||||
if len(call.ArgumentList) > 0 {
|
||||
limitParsed, _ := call.Argument(0).ToInteger()
|
||||
|
|
@ -90,7 +90,7 @@ func toArrayFunc(env *otto.Otto, ses *Session, obj *otto.Object, withTags bool)
|
|||
func toValueFunc(env *otto.Otto, ses *Session, obj *otto.Object, withTags bool) func(otto.FunctionCall) otto.Value {
|
||||
return func(call otto.FunctionCall) otto.Value {
|
||||
it := buildIteratorTree(obj, ses.ts)
|
||||
it.AddTag(TopResultTag)
|
||||
it.Tagger().Add(TopResultTag)
|
||||
limit := 1
|
||||
var val otto.Value
|
||||
var err error
|
||||
|
|
@ -120,7 +120,7 @@ func toValueFunc(env *otto.Otto, ses *Session, obj *otto.Object, withTags bool)
|
|||
func mapFunc(env *otto.Otto, ses *Session, obj *otto.Object) func(otto.FunctionCall) otto.Value {
|
||||
return func(call otto.FunctionCall) otto.Value {
|
||||
it := buildIteratorTree(obj, ses.ts)
|
||||
it.AddTag(TopResultTag)
|
||||
it.Tagger().Add(TopResultTag)
|
||||
limit := -1
|
||||
if len(call.ArgumentList) == 0 {
|
||||
return otto.NullValue()
|
||||
|
|
@ -151,7 +151,7 @@ func runIteratorToArray(it graph.Iterator, ses *Session, limit int) []map[string
|
|||
if ses.doHalt {
|
||||
return nil
|
||||
}
|
||||
_, ok := it.Next()
|
||||
_, ok := graph.Next(it)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
|
|
@ -187,7 +187,7 @@ func runIteratorToArrayNoTags(it graph.Iterator, ses *Session, limit int) []stri
|
|||
if ses.doHalt {
|
||||
return nil
|
||||
}
|
||||
val, ok := it.Next()
|
||||
val, ok := graph.Next(it)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
|
|
@ -208,7 +208,7 @@ func runIteratorWithCallback(it graph.Iterator, ses *Session, callback otto.Valu
|
|||
if ses.doHalt {
|
||||
return
|
||||
}
|
||||
_, ok := it.Next()
|
||||
_, ok := graph.Next(it)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
|
|
@ -249,7 +249,7 @@ func runIteratorOnSession(it graph.Iterator, ses *Session) {
|
|||
if ses.doHalt {
|
||||
return
|
||||
}
|
||||
_, ok := it.Next()
|
||||
_, ok := graph.Next(it)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ func (q *Query) buildFixed(s string) graph.Iterator {
|
|||
|
||||
func (q *Query) buildResultIterator(path Path) graph.Iterator {
|
||||
all := q.ses.ts.NodesAllIterator()
|
||||
all.AddTag(string(path))
|
||||
all.Tagger().Add(string(path))
|
||||
return all
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ func (q *Query) buildIteratorTreeInternal(query interface{}, path Path) (it grap
|
|||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
it.AddTag(string(path))
|
||||
it.Tagger().Add(string(path))
|
||||
return it, optional, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ func (s *Session) ExecInput(input string, c chan interface{}, limit int) {
|
|||
glog.V(2).Infoln(it.DebugString(0))
|
||||
}
|
||||
for {
|
||||
_, ok := it.Next()
|
||||
_, ok := graph.Next(it)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue