filterSchemaNodeForNamespace filters schema nodes for the given namespace.
(namespace uint64, nodes []*pb.SchemaNode)
| 3109 | |
| 3110 | // filterSchemaNodeForNamespace filters schema nodes for the given namespace. |
| 3111 | func filterSchemaNodeForNamespace(namespace uint64, nodes []*pb.SchemaNode) []*pb.SchemaNode { |
| 3112 | out := []*pb.SchemaNode{} |
| 3113 | |
| 3114 | for _, node := range nodes { |
| 3115 | nodeNamespace, attrName := x.ParseNamespaceAttr(node.Predicate) |
| 3116 | if nodeNamespace != namespace { |
| 3117 | continue |
| 3118 | } |
| 3119 | node.Predicate = attrName |
| 3120 | out = append(out, node) |
| 3121 | } |
| 3122 | return out |
| 3123 | } |
| 3124 | |
| 3125 | // StripBlankNode returns a copy of the map where all the keys have the blank node prefix removed. |
| 3126 | func StripBlankNode(mp map[string]uint64) map[string]uint64 { |
no test coverage detected