validateKeys checks predicate and facet keys in N-Quad for syntax errors.
(nq *api.NQuad)
| 2368 | |
| 2369 | // validateKeys checks predicate and facet keys in N-Quad for syntax errors. |
| 2370 | func validateKeys(nq *api.NQuad) error { |
| 2371 | if err := validateKey(nq.Predicate); err != nil { |
| 2372 | return errors.Wrapf(err, "predicate %q", nq.Predicate) |
| 2373 | } |
| 2374 | for i := range nq.Facets { |
| 2375 | if nq.Facets[i] == nil { |
| 2376 | continue |
| 2377 | } |
| 2378 | if err := validateKey(nq.Facets[i].Key); err != nil { |
| 2379 | return errors.Errorf("Facet %q, %s", nq.Facets[i].Key, err) |
| 2380 | } |
| 2381 | } |
| 2382 | return nil |
| 2383 | } |
| 2384 | |
| 2385 | // validateQuery verifies that the query does not contain any preds that |
| 2386 | // are longer than the limit (2^16). |
searching dependent graphs…