parsePredsFromMutation returns a union set of all the predicate names in the input nquads
(nquads []*api.NQuad)
| 739 | |
| 740 | // parsePredsFromMutation returns a union set of all the predicate names in the input nquads |
| 741 | func parsePredsFromMutation(nquads []*api.NQuad) []string { |
| 742 | // use a map to dedup predicates |
| 743 | predsMap := make(map[string]struct{}) |
| 744 | for _, nquad := range nquads { |
| 745 | // _STAR_ALL is not a predicate in itself. |
| 746 | if nquad.Predicate != "_STAR_ALL" { |
| 747 | predsMap[nquad.Predicate] = struct{}{} |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | preds := make([]string, 0, len(predsMap)) |
| 752 | for pred := range predsMap { |
| 753 | preds = append(preds, pred) |
| 754 | } |
| 755 | |
| 756 | return preds |
| 757 | } |
| 758 | |
| 759 | func isAclPredMutation(nquads []*api.NQuad) bool { |
| 760 | for _, nquad := range nquads { |