/**
   * Update the program with the name given as argument using the data provided in the stream. This
   * method will first calculate the difference between the previous version of the program and the
   * new version of the program. It then updates the program in the database and notifies the engine
   * of all removed and added rules.
   *
   * @throws IOException in case the stream cannot be read
   * @throws SailException in case the program already exists
   * @throws ParseException in case the program cannot be parsed
   */
  public void updateProgram(String name, InputStream data)
      throws IOException, SailException, ParseException {
    KWRLProgramParserBase parser = new KWRLProgramParser(getValueFactory(), data);
    Program p = parser.parseProgram();
    p.setName(name);

    updateProgram(p);
  }