TypeOf returns the schema type of predicate
(pred string)
| 273 | |
| 274 | // TypeOf returns the schema type of predicate |
| 275 | func (s *state) TypeOf(pred string) (types.TypeID, error) { |
| 276 | s.RLock() |
| 277 | defer s.RUnlock() |
| 278 | if schema, ok := s.predicate[pred]; ok { |
| 279 | return types.TypeID(schema.ValueType), nil |
| 280 | } |
| 281 | return types.UndefinedID, errors.Errorf("Schema not defined for predicate: %v.", pred) |
| 282 | } |
| 283 | |
| 284 | // IsIndexed returns whether the predicate is indexed or not |
| 285 | func (s *state) IsIndexed(ctx context.Context, pred string) bool { |