ContainsAt returns true if the atom is valid at the given time.
(atom ast.Atom, t time.Time)
| 260 | |
| 261 | // ContainsAt returns true if the atom is valid at the given time. |
| 262 | func (s *TemporalStore) ContainsAt(atom ast.Atom, t time.Time) bool { |
| 263 | predMap, ok := s.facts[atom.Predicate] |
| 264 | if !ok { |
| 265 | return false |
| 266 | } |
| 267 | |
| 268 | tree, ok := predMap[atom.Hash()] |
| 269 | if !ok { |
| 270 | return false |
| 271 | } |
| 272 | |
| 273 | found := false |
| 274 | timestamp := t.UnixNano() |
| 275 | tree.QueryPoint(timestamp, func(interval ast.Interval) error { |
| 276 | found = true |
| 277 | return nil |
| 278 | }) |
| 279 | return found |
| 280 | } |
| 281 | |
| 282 | // ListPredicates returns all predicates in the store. |
| 283 | func (s *TemporalStore) ListPredicates() []ast.PredicateSym { |