Finished cleanOAI

This commit is contained in:
Spyros Zoupanos 2020-09-09 21:59:04 +03:00
parent 398f1f6f15
commit 1d9f8f79a8
1 changed files with 262 additions and 178 deletions

View File

@ -168,12 +168,12 @@ public class PiwikStatsDB {
this.robotsList = counterRobots.getRobotsPatterns();
System.out.println("====> Processing repository logs");
processRepositoryLog();
// processRepositoryLog();
System.out.println("====> Repository process done");
log.info("repository process done");
System.out.println("====> Removing double clicks");
removeDoubleClicks();
// removeDoubleClicks();
System.out.println("====> Removing double clicks done");
log.info("removing double clicks done");
@ -753,189 +753,273 @@ public class PiwikStatsDB {
private void cleanOAI() throws Exception {
ConnectDB.getConnection().setAutoCommit(false);
System.out.println("====> Cleaning oai - Step 1");
stmt = ConnectDB.getConnection().createStatement();
String sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.chlc.min-saude.pt/'," +
"'oai:repositorio.chlc.min-saude.pt:') WHERE entity_id LIKE 'oai:repositorio.chlc.min-saude.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 2");
stmt = ConnectDB.getConnection().createStatement();
String sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.chlc.min-saude.pt/','oai:repositorio.chlc.min-saude.pt:') WHERE entity_id LIKE 'oai:repositorio.chlc.min-saude.pt/%';";
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.hospitaldebraga.pt/'," +
"'oai:repositorio.hospitaldebraga.pt:') WHERE entity_id LIKE 'oai:repositorio.hospitaldebraga.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 3");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ipl.pt/'," +
"'oai:repositorio.ipl.pt:') WHERE entity_id LIKE 'oai:repositorio.ipl.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 4");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:bibliotecadigital.ipb.pt/'," +
"'oai:bibliotecadigital.ipb.pt:') WHERE entity_id LIKE 'oai:bibliotecadigital.ipb.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 5");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ismai.pt/'," +
"'oai:repositorio.ismai.pt:') WHERE entity_id LIKE 'oai:repositorio.ismai.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 6");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorioaberto.uab.pt/'," +
"'oai:repositorioaberto.uab.pt:') WHERE entity_id LIKE 'oai:repositorioaberto.uab.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 7");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.uac.pt/'," +
"'oai:repositorio.uac.pt:') WHERE entity_id LIKE 'oai:repositorio.uac.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 8");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.insa.pt/'," +
"'oai:repositorio.insa.pt:') WHERE entity_id LIKE 'oai:repositorio.insa.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 9");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ipcb.pt/'," +
"'oai:repositorio.ipcb.pt:') WHERE entity_id LIKE 'oai:repositorio.ipcb.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 10");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ispa.pt/'," +
"'oai:repositorio.ispa.pt:') WHERE entity_id LIKE 'oai:repositorio.ispa.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 11");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.chporto.pt/'," +
"'oai:repositorio.chporto.pt:') WHERE entity_id LIKE 'oai:repositorio.chporto.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 12");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ucp.pt/'," +
"'oai:repositorio.ucp.pt:') WHERE entity_id LIKE 'oai:repositorio.ucp.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 13");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:rihuc.huc.min-saude.pt/'," +
"'oai:rihuc.huc.min-saude.pt:') WHERE entity_id LIKE 'oai:rihuc.huc.min-saude.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 14");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ipv.pt/'," +
"'oai:repositorio.ipv.pt:') WHERE entity_id LIKE 'oai:repositorio.ipv.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 15");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:www.repository.utl.pt/'," +
"'oai:www.repository.utl.pt:') WHERE entity_id LIKE 'oai:www.repository.utl.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 16");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:run.unl.pt/'," +
"'oai:run.unl.pt:') WHERE entity_id LIKE 'oai:run.unl.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 17");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:sapientia.ualg.pt/'," +
"'oai:sapientia.ualg.pt:') WHERE entity_id LIKE 'oai:sapientia.ualg.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 18");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ipsantarem.pt/'," +
"'oai:repositorio.ipsantarem.pt:') WHERE entity_id LIKE 'oai:repositorio.ipsantarem.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 19");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:arca.igc.gulbenkian.pt/'," +
"'oai:arca.igc.gulbenkian.pt:') WHERE entity_id LIKE 'oai:arca.igc.gulbenkian.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 20");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:ubibliorum.ubi.pt/'," +
"'oai:ubibliorum.ubi.pt:') WHERE entity_id LIKE 'oai:ubibliorum.ubi.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 21");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:digituma.uma.pt/'," +
"'oai:digituma.uma.pt:') WHERE entity_id LIKE 'oai:digituma.uma.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 22");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ul.pt/'," +
"'oai:repositorio.ul.pt:') WHERE entity_id LIKE 'oai:repositorio.ul.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 23");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.hff.min-saude.pt/'," +
"'oai:repositorio.hff.min-saude.pt:') WHERE entity_id LIKE 'oai:repositorio.hff.min-saude.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 24");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorium.sdum.uminho.pt/'," +
"'oai:repositorium.sdum.uminho.pt:') WHERE entity_id LIKE 'oai:repositorium.sdum.uminho.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 25");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:recipp.ipp.pt/'," +
"'oai:recipp.ipp.pt:') WHERE entity_id LIKE 'oai:recipp.ipp.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 26");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:bdigital.ufp.pt/'," +
"'oai:bdigital.ufp.pt:') WHERE entity_id LIKE 'oai:bdigital.ufp.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 27");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:repositorio.lneg.pt/'," +
"'oai:repositorio.lneg.pt:') WHERE entity_id LIKE 'oai:repositorio.lneg.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 28");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:iconline.ipleiria.pt/'," +
"'oai:iconline.ipleiria.pt:') WHERE entity_id LIKE 'oai:iconline.ipleiria.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
System.out.println("====> Cleaning oai - Step 29");
stmt = ConnectDB.getConnection().createStatement();
sql =
"UPDATE " + ConnectDB.getUsageStatsDBSchema() + ".piwiklogtmp " +
"SET entity_id = regexp_replace(entity_id, '^oai:comum.rcaap.pt/'," +
"'oai:comum.rcaap.pt:') WHERE entity_id LIKE 'oai:comum.rcaap.pt/%'";
stmt.executeUpdate(sql);
stmt.close();
sql =
"UPDATE usagestats.piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.chlc.min-saude.pt/','oai:repositorio.chlc.min-saude.pt:') \n" +
"WHERE entity_id LIKE 'oai:repositorio.chlc.min-saude.pt/%'";
System.out.println("====> Cleaning oai - Done, closing connection");
ConnectDB.getConnection().close();
System.exit(0);
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.hospitaldebraga.pt/','oai:repositorio.hospitaldebraga.pt:') WHERE entity_id LIKE 'oai:repositorio.hospitaldebraga.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklog SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ipl.pt/','oai:repositorio.ipl.pt:') WHERE entity_id LIKE 'oai:repositorio.ipl.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:bibliotecadigital.ipb.pt/','oai:bibliotecadigital.ipb.pt:') WHERE entity_id LIKE 'oai:bibliotecadigital.ipb.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklog SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ismai.pt/','oai:repositorio.ismai.pt:') WHERE entity_id LIKE 'oai:repositorio.ismai.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklog SET entity_id = regexp_replace(entity_id, '^oai:repositorioaberto.uab.pt/','oai:repositorioaberto.uab.pt:') WHERE entity_id LIKE 'oai:repositorioaberto.uab.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.uac.pt/','oai:repositorio.uac.pt:') WHERE entity_id LIKE 'oai:repositorio.uac.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.insa.pt/','oai:repositorio.insa.pt:') WHERE entity_id LIKE 'oai:repositorio.insa.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ipcb.pt/','oai:repositorio.ipcb.pt:') WHERE entity_id LIKE 'oai:repositorio.ipcb.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ispa.pt/','oai:repositorio.ispa.pt:') WHERE entity_id LIKE 'oai:repositorio.ispa.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.chporto.pt/','oai:repositorio.chporto.pt:') WHERE entity_id LIKE 'oai:repositorio.chporto.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ucp.pt/','oai:repositorio.ucp.pt:') WHERE entity_id LIKE 'oai:repositorio.ucp.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:rihuc.huc.min-saude.pt/','oai:rihuc.huc.min-saude.pt:') WHERE entity_id LIKE 'oai:rihuc.huc.min-saude.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ipv.pt/','oai:repositorio.ipv.pt:') WHERE entity_id LIKE 'oai:repositorio.ipv.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:www.repository.utl.pt/','oai:www.repository.utl.pt:') WHERE entity_id LIKE 'oai:www.repository.utl.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:run.unl.pt/','oai:run.unl.pt:') WHERE entity_id LIKE 'oai:run.unl.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:sapientia.ualg.pt/','oai:sapientia.ualg.pt:') WHERE entity_id LIKE 'oai:sapientia.ualg.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ipsantarem.pt/','oai:repositorio.ipsantarem.pt:') WHERE entity_id LIKE 'oai:repositorio.ipsantarem.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:arca.igc.gulbenkian.pt/','oai:arca.igc.gulbenkian.pt:') WHERE entity_id LIKE 'oai:arca.igc.gulbenkian.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:ubibliorum.ubi.pt/','oai:ubibliorum.ubi.pt:') WHERE entity_id LIKE 'oai:ubibliorum.ubi.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:digituma.uma.pt/','oai:digituma.uma.pt:') WHERE entity_id LIKE 'oai:digituma.uma.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.ul.pt/','oai:repositorio.ul.pt:') WHERE entity_id LIKE 'oai:repositorio.ul.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.hff.min-saude.pt/','oai:repositorio.hff.min-saude.pt:') WHERE entity_id LIKE 'oai:repositorio.hff.min-saude.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorium.sdum.uminho.pt/','oai:repositorium.sdum.uminho.pt:') WHERE entity_id LIKE 'oai:repositorium.sdum.uminho.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:recipp.ipp.pt/','oai:recipp.ipp.pt:') WHERE entity_id LIKE 'oai:recipp.ipp.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:bdigital.ufp.pt/','oai:bdigital.ufp.pt:') WHERE entity_id LIKE 'oai:bdigital.ufp.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:repositorio.lneg.pt/','oai:repositorio.lneg.pt:') WHERE entity_id LIKE 'oai:repositorio.lneg.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:iconline.ipleiria.pt/','oai:iconline.ipleiria.pt:') WHERE entity_id LIKE 'oai:iconline.ipleiria.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
stmt = ConnectDB.getConnection().createStatement();
sql = "UPDATE piwiklogtmp SET entity_id = regexp_replace(entity_id, '^oai:comum.rcaap.pt/','oai:comum.rcaap.pt:') WHERE entity_id LIKE 'oai:comum.rcaap.pt/%';";
stmt.executeUpdate(sql);
stmt.close();
ConnectDB.getConnection().commit();
ConnectDB.getConnection().close();
}
private String processPortalURL(String url) {