@Override
  public InterpreterResult interpret(String cypherQuery, InterpreterContext interpreterContext) {
    LOGGER.info("Opening session");
    if (StringUtils.isBlank(cypherQuery)) {
      return new InterpreterResult(Code.SUCCESS);
    }
    final List<String> queries = isMultiStatementEnabled ?
            Arrays.asList(cypherQuery.split(";[^'|^\"|^(\\w+`)]")) : Arrays.asList(cypherQuery);
    if (queries.size() == 1) {
      final String query = queries.get(0);
      return runQuery(query, interpreterContext);
    } else {
      final int lastIndex = queries.size() - 1;
      final List<String> subQueries = queries.subList(0, lastIndex);
      for (String query : subQueries) {
        runQuery(query, interpreterContext);
      }
      return runQuery(queries.get(lastIndex), interpreterContext);
    }
  }
@Test
  void testDates() {
    InterpreterResult result = interpreter.interpret(
            "RETURN datetime('2015-06-24T12:50:35.556+0100') AS theDateTime", context);
    assertEquals(Code.SUCCESS, result.code());
    assertEquals("theDateTime\n2015-06-24T12:50:35.556+01:00\n", result.toString()
            .replace(TABLE_RESULT_PREFIX, StringUtils.EMPTY));

    result = interpreter.interpret("RETURN localdatetime('2015185T19:32:24') AS theLocalDateTime",
            context);
    assertEquals(Code.SUCCESS, result.code());
    assertEquals("theLocalDateTime\n2015-07-04T19:32:24\n", result.toString()
            .replace(TABLE_RESULT_PREFIX, StringUtils.EMPTY));

    result = interpreter.interpret("RETURN date('+2015-W13-4') AS theDate", context);
    assertEquals(Code.SUCCESS, result.code());
    assertEquals("theDate\n2015-03-26\n", result.toString()
            .replace(TABLE_RESULT_PREFIX, StringUtils.EMPTY));

    result = interpreter.interpret("RETURN time('125035.556+0100') AS theTime", context);
    assertEquals(Code.SUCCESS, result.code());
    assertEquals("theTime\n12:50:35.556+01:00\n", result.toString().replace(TABLE_RESULT_PREFIX,
            StringUtils.EMPTY));

    result = interpreter.interpret("RETURN localtime('12:50:35.556') AS theLocalTime", context);
    assertEquals(Code.SUCCESS, result.code());
    assertEquals("theLocalTime\n12:50:35.556\n", result.toString()
            .replace(TABLE_RESULT_PREFIX, StringUtils.EMPTY));
  }