docs: public static RDFDataset parseNQuads(String input) throws JsonLdError {
          // build RDF dataset
          final RDFDataset dataset = new RDFDataset();
  
          // split N-Quad input into lines
          final String[] lines = Regex.EOLN.split(input);
          int lineNumber = 0;
          for (final String line : lines) {
              lineNumber++;
  
              // skip empty lines
              if (Regex.EMPTY.matcher(line).matches()) {
                  continue;
              }
  
              // parse quad
              final Matcher match = Regex.QUAD.matcher(line);
              if (!match.matches()) {
                  throw new JsonLdError(JsonLdError.Error.SYNTAX_ERROR,
                          "Error while parsing N-Quads; invalid quad. line:" + lineNumber);
              }
  
              // get subject
              RDFDataset.Node subject;
              if (match.group(1) != null) {
                  subject = new RDFDataset.IRI(unescape(match.group(1)));
              } else {
                  subject = new RDFDataset.BlankNode(unescape(match.group(2)));
              }
  
              // get predicate
              final RDFDataset.Node predicate = new RDFDataset.IRI(unescape(match.group(3)));
  
              // get object
              RDFDataset.Node object;
              if (match.group(4) != null) {
                  object = new RDFDataset.IRI(unescape(match.group(4)));
              } else if (match.group(5) != null) {
                  object = new RDFDataset.BlankNode(unescape(match.group(5)));
              } else {
                  final String language = unescape(match.group(8));
                  final String datatype = match.group(7) != null ? unescape(match.group(7))
                          : match.group(8) != null ? RDF_LANGSTRING : XSD_STRING;
                  final String unescaped = unescape(match.group(6));
                  object = new RDFDataset.Literal(unescaped, datatype, language);
              }
  
              // get graph name ('@default' is used for the default graph)
              String name = "@default";
              if (match.group(9) != null) {
                  name = unescape(match.group(9));
              } else if (match.group(10) != null) {
                  name = unescape(match.group(10));
              }
  
              final RDFDataset.Quad triple = new RDFDataset.Quad(subject, predicate, object, name);
  
              // initialise graph in dataset
              if (!dataset.containsKey(name)) {
                  final List<RDFDataset.Quad> tmp = new ArrayList<RDFDataset.Quad>();
                  tmp.add(triple);
                  dataset.put(name, tmp);
              }
              // add triple if unique to its graph
              else {
                  final List<RDFDataset.Quad> triples = (List<RDFDataset.Quad>) dataset.get(name);
                  if (!triples.contains(triple)) {
                      triples.add(triple);
                  }
              }
          }
  
          return dataset;
      }