MCPcopy
hub / github.com/dgraph-io/dgraph / parsePredsFromMutation

Function parsePredsFromMutation

edgraph/access.go:741–757  ·  view source on GitHub ↗

parsePredsFromMutation returns a union set of all the predicate names in the input nquads

(nquads []*api.NQuad)

Source from the content-addressed store, hash-verified

739
740// parsePredsFromMutation returns a union set of all the predicate names in the input nquads
741func 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
759func isAclPredMutation(nquads []*api.NQuad) bool {
760 for _, nquad := range nquads {

Callers 1

authorizeMutationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected