ParseJSON is a convenience wrapper function to get all NQuads in one call. This can however, lead to high memory usage. So be careful using this.
(b []byte, op int)
| 790 | // ParseJSON is a convenience wrapper function to get all NQuads in one call. This can however, lead |
| 791 | // to high memory usage. So be careful using this. |
| 792 | func ParseJSON(b []byte, op int) ([]*api.NQuad, *pb.Metadata, error) { |
| 793 | buf := NewNQuadBuffer(-1) |
| 794 | err := buf.FastParseJSON(b, op) |
| 795 | if err != nil { |
| 796 | return nil, nil, err |
| 797 | } |
| 798 | buf.Flush() |
| 799 | nqs := <-buf.Ch() |
| 800 | metadata := buf.Metadata() |
| 801 | return nqs, metadata, nil |
| 802 | } |
no test coverage detected