Fix #21 and change the MQL semantics slightly to match the original MQL

This commit is contained in:
Barak Michener 2014-06-29 21:20:54 -04:00
parent 18c56be950
commit 18c4c555b5
6 changed files with 42 additions and 23 deletions

View file

@ -24,6 +24,9 @@ func (q *Query) treeifyResult(tags map[string]graph.TSVal) map[ResultPath]string
// Transform the map into something a little more interesting.
results := make(map[Path]string)
for k, v := range tags {
if v == nil {
continue
}
results[Path(k)] = q.ses.ts.GetNameFor(v)
}
resultPaths := make(map[ResultPath]string)
@ -78,7 +81,10 @@ func (q *Query) treeifyResult(tags map[string]graph.TSVal) map[ResultPath]string
// Fill values
for _, path := range paths {
currentPath := path.getPath()
value := resultPaths[path]
value, ok := resultPaths[path]
if !ok {
continue
}
namePath := path.AppendValue(value)
if _, ok := q.queryStructure[currentPath]; ok {
// We're dealing with ids.