Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SqlStore.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SqlStore.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SqlStore.java	(revision 47503)
@@ -0,0 +1,354 @@
+package eu.dnetlib.data.claimsDemo;
+
+import org.apache.log4j.Logger;
+
+import java.sql.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author eri Sql Store class to connect to the DB backend
+ */
+
+public class SqlStore {
+
+	private Logger log = Logger.getLogger(this.getClass());
+
+	private String dbUrl;
+	private String dbUser;
+	private String dbPassword;
+	private Connection connection;
+
+	private String dbDriver;
+
+	public SqlStore(String dbUrl, String dbUser, String dbPassword, String dbDriver)  {
+		this.dbDriver = dbDriver;
+		this.dbUser = dbUser;
+		this.dbUrl = dbUrl;
+		this.dbPassword = dbPassword;
+
+	}
+
+	public SqlStore() throws Exception {
+
+	}
+
+
+	public void init() throws ClassNotFoundException, SQLException {
+ 			Class.forName(dbDriver);
+			this.getConnection();
+
+
+	}
+
+	public void destroy() throws SQLException {
+		this.closeConnection();
+
+	}
+
+	public void close() throws SQLException {
+		closeConnection();
+
+	}
+
+	/**
+	 * Establishes a JDBC connection to the database server without a given DB.
+	 * Used in order to create or drop databases.
+	 *
+	 * @throws SQLException
+	 */
+	public void getConnectionNoDatabase() throws SQLException {
+		String parsedUrl = this.parseUrl(dbUrl);
+		log.info("Connecting to " + parsedUrl + dbUser + dbPassword);
+		connection = (Connection) DriverManager.getConnection(parsedUrl, dbUser, dbPassword);
+		log.info("Connected to " + parsedUrl);
+
+	}
+
+	/**
+	 * Establishes a connection to a given DB.
+	 *
+	 * @throws SQLException
+	 */
+	public void getConnection() throws SQLException {
+
+			log.info("Attempting connection to : " + this.dbUrl + " for " + this.dbUser + " and  " + this.dbPassword);
+			connection = (Connection) DriverManager.getConnection(this.dbUrl, dbUser, dbPassword);
+			log.info("Connected to " + this.dbUrl);
+
+	}
+
+	/**
+	 * Closes Database connections.
+	 *
+	 * @throws SQLException
+	 */
+	public void closeConnection() throws SQLException {
+
+			if (connection != null) {
+				connection.close();
+			}
+
+	}
+
+	/**
+	 * Executes the @param command stored procedure in the Database. Stored
+	 * procedure parameters are specified in values.
+	 *
+	 * @param command
+	 * @param values
+	 * @return
+	 * @throws SQLException
+	 */
+	public ResultSet executeStoredProcedure(String command, ArrayList<String> values) throws SQLException {
+		java.sql.CallableStatement callableStatement = null;
+		log.debug("  Executing   Query ..." + command);
+
+			callableStatement = this.connection.prepareCall(command);
+			int pos = 1;
+
+			for (String v : values) {
+
+				callableStatement.setObject(pos, v);
+
+				pos++;
+			}
+
+			callableStatement.execute();
+			return callableStatement.getResultSet();
+
+
+
+	}
+
+	/**
+	 * Executes the stored query procedure specified by @param command.
+	 *
+	 * @param command
+	 * @return
+	 * @throws SQLException
+	 */
+	public ResultSet executeStoredProcedure(String command) throws SQLException {
+		log.debug("  Executing   Query ..." + command);
+		java.sql.CallableStatement callableStatement = null;
+
+			callableStatement = this.connection.prepareCall(command);
+
+			callableStatement.execute();
+			return callableStatement.getResultSet();
+
+
+
+	}
+
+	/**
+	 * Executes the @param query
+	 *
+	 * @param command
+	 * @return
+	 * @throws SQLException
+	 */
+	public ResultSet executeQuery(String command) throws SQLException, SQLStoreException {
+		log.debug("  Executing   Query ... " + command);
+ 			Statement st = connection.createStatement();
+
+			if (st.execute(command)) {
+
+				ResultSet rs = st.getResultSet();
+				//st.close();
+				return rs;
+			} else {
+				log.error("Fail to execute command " + st.getWarnings());
+				throw  new SQLStoreException("Fail to execute command " + st.getWarnings());
+
+			}
+
+
+
+	}
+
+	/**
+	 * Executes the @param  prepared query with the @values as parameters
+	 * Returns a result set.
+	 *
+	 * @param command
+	 * @param values
+	 * @return
+	 * @throws SQLException
+	 */
+	public ResultSet executeQuery(String command, ArrayList<String> values) throws SQLException, SQLStoreException {
+		log.debug("  Executing   Query ..." + command);
+
+			PreparedStatement st = connection.prepareStatement(command);
+
+			int pos = 1;
+
+			for (String v : values) {
+
+				st.setObject(pos, v);
+
+				pos++;
+			}
+
+			if (st.execute()) {
+				ResultSet rs = st.getResultSet();
+			//	st.close();
+				return rs;
+			} else {
+				log.error("Fail to execute command " + st.getWarnings());
+				throw  new SQLStoreException("Fail to execute command " + st.getWarnings());
+			}
+
+
+
+	}
+
+	/**
+	 * Executes the @param command Update query
+	 *
+	 * @param command
+	 * @return
+	 * @throws SQLException
+	 */
+	public void executeUpdate(String command) throws SQLException {
+		log.debug("  Executing   Query ..." + command);
+ 			Statement st = connection.createStatement();
+			st.executeUpdate(command);
+			//st.close();
+	}
+    public void executeUpdateWithRollback(List<String> commandS)  throws  SQLException{
+        log.debug("  Executing   Query ..." + commandS);
+            Statement st = connection.createStatement();
+            connection.setAutoCommit(false);
+            for(String command : commandS) {
+                if(command.equals("EXCEPTION")){
+                    throw new SQLException("Force rollback ");
+                }
+                st.executeUpdate(command);
+            }
+            //st.close();
+            connection.commit();
+            connection.setAutoCommit(true);
+
+    }
+	/**
+	 * Executes the @param command  Prepared Update query  with the
+	 *
+	 * @param command
+	 * @param values
+	 * @return
+	 * @throws Exception
+	 * @values as parameters
+	 */
+	public void executeUpdate(String command, ArrayList<String> values) throws SQLException {
+		log.debug("  Executing   Query ..." + command);
+			PreparedStatement st = connection.prepareStatement(command);
+
+			int pos = 1;
+
+			for (String v : values) {
+
+				st.setObject(pos, v);
+
+				pos++;
+			}
+
+			boolean executed = st.execute();
+
+			if (!executed) {
+				log.error("Fail to execute update command " + st.getWarnings());
+				throw new SQLException("Fail to execute update command " + st.getWarnings());
+			}
+	}
+
+
+	/**
+	 * Turns autocommit on and off.
+	 *
+	 * @param on
+	 * @throws Exception
+	 */
+	public void setautoCommit(boolean on) throws SQLException {
+			this.connection.setAutoCommit(on);
+	}
+
+
+	/**
+	 * Creates a serialized string from the ResultSet returned from a query
+	 *
+	 * @throws Exception
+	 */
+	public String getResults(ResultSet rs) throws SQLException {
+		String data = new String();
+		try {
+
+
+			ResultSetMetaData rsmd = rs.getMetaData();
+			while (rs.next()) {
+				for (int i = 1; i < rsmd.getColumnCount() - 1; i++)
+
+				{
+
+					log.debug(rsmd.getColumnName(i) + "," + rs.getString(i));
+					data += rsmd.getColumnName(i) + "," + rs.getString(i) + "\n";
+				}
+
+			}
+			log.debug(" Generated Data :" + data);
+			rs.close();
+			return data;
+
+
+		} finally {
+			this.closeConnection();
+		}
+
+	}
+
+	private String parseUrl(String url) {
+
+		if (url.endsWith("/")) {
+			url = url.substring(0, url.lastIndexOf('/'));
+
+		}
+		url = url.substring(0, url.lastIndexOf('/') + 1);
+		log.debug(" db url  parsed" + url);
+		return url;
+	}
+
+	public String getDbDriver() {
+		return dbDriver;
+	}
+
+	public void setDbDriver(String dbDriver) {
+		this.dbDriver = dbDriver;
+	}
+
+	public String getDbUrl() {
+		return dbUrl;
+	}
+
+	public void setDbUrl(String dbUrl) {
+		this.dbUrl = dbUrl;
+	}
+
+	public String getDbUser() {
+		return dbUser;
+	}
+
+	public void setDbUser(String dbUser) {
+		this.dbUser = dbUser;
+	}
+
+	public String getDbPassword() {
+		return dbPassword;
+	}
+
+	public void setDbPassword(String dbPassword) {
+		this.dbPassword = dbPassword;
+	}
+
+	public void setConnection(Connection connection) {
+		this.connection = connection;
+	}
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SQLStoreException.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SQLStoreException.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SQLStoreException.java	(revision 47503)
@@ -0,0 +1,22 @@
+package eu.dnetlib.data.claimsDemo;
+
+/**
+ * Created by argirok on 12/5/2017.
+ */
+public class SQLStoreException extends Throwable {
+    public SQLStoreException() {
+        super();
+    }
+
+    public SQLStoreException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public SQLStoreException(String message) {
+        super(message);
+    }
+
+    public SQLStoreException(Throwable cause) {
+        super(cause);
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.xml
===================================================================
--- modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.xml	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.xml	(revision 47503)
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:cxf="http://cxf.apache.org/core"
+       xmlns:jaxws="http://cxf.apache.org/jaxws"
+       xmlns:p="http://http://www.springframework.org/schema/p"
+       xmlns:template="http://dnetlib.eu/springbeans/template"
+       xmlns:t="http://dnetlib.eu/springbeans/t"
+
+       xsi:schemaLocation="
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
+        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
+        http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+	http://dnetlib.eu/springbeans/template http://dnetlib.eu/springbeans/template.xsd"
+       default-autowire="byName">
+    <!--Un comment in order to run the tests / Comment to deploy-->
+    <!--<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">-->
+        <!--<property name="locations" value="classpath:eu/dnetlib/data/claims/migration/springContext-claimsDemo.properties"/>-->
+    <!--</bean>-->
+    <bean id="directIndexHandler" class="eu.dnetlib.data.claims.migration.handler.DirectIndexHandler">
+        <property name="directClaimAPIUrl"  value="http://beta.services.openaire.eu:8280/is/mvc/api/publications"/>
+    </bean>
+    <bean id="fetchClaimHandler" class="eu.dnetlib.data.claims.migration.handler.FetchClaimHandler">
+        <property name="sqlDAO" ref="sqlDao"/>
+        <property name="queryGenerator" ref="queryGenerator"/>
+
+    </bean>
+    <bean id="claimHandler" class="eu.dnetlib.data.claims.migration.handler.ClaimHandler">
+        <property name="sqlDAO" ref="sqlDao"/>
+        <property name="queryGenerator" ref="queryGenerator"/>
+        <property name="dmfContextHandler" ref="dmfContextHandler"/>
+        <property name="projectHandler" ref="projectHandler"/>
+        <property name="resultHandler" ref="resultHandler"/>
+        <property name="claimValidation" ref="claimValidation"/>
+    </bean>
+    <bean id="externalRecordHandler" class="eu.dnetlib.data.claims.migration.handler.ExternalRecordHandler">
+        <property name="searchUtils" ref="searchUtils"/>
+        <property name="externalRecordParser" ref="externalRecordParser"/>
+    </bean>
+    <bean id="dmfResultHandler" class="eu.dnetlib.data.claims.migration.handler.DMFResultHandler">
+        <property name="sqlDAO" ref="sqlDao"/>
+        <property name="queryGenerator" ref="queryGenerator"/>
+        <property name="dmfParser" ref="dmfParser"/>
+    </bean>
+    <bean id="dmfContextHandler" class="eu.dnetlib.data.claims.migration.handler.DMFContextHandler">
+        <property name="sqlDAO" ref="sqlDao"/>
+        <property name="queryGenerator" ref="queryGenerator"/>
+        <property name="dmfParser" ref="dmfParser"/>
+    </bean>
+    <bean id="fetchProjectHandler" class="eu.dnetlib.data.claims.migration.handler.FetchProjectHandler">
+        <property name="sqlDAO" ref="sqlDao"/>
+        <property name="queryGenerator" ref="queryGenerator"/>
+
+    </bean>
+
+    <bean id="projectHandler" class="eu.dnetlib.data.claims.migration.handler.ProjectHandler">
+        <property name="searchUtils" ref="searchUtils"/>
+        <property name="oafParser" ref="oafParser"/>
+        <property name="queryGenerator" ref="queryGenerator"/>
+        <property name="sqlDAO" ref="sqlDao"/>
+    </bean>
+
+    <bean id="contextRelationHandler" class="eu.dnetlib.data.claims.migration.handler.ContextRelationHandler">
+        <property name="sqlDAO" ref="sqlDao"/>
+        <property name="queryGenerator" ref="queryGenerator"/>
+        <property name="dmfParser" ref="dmfParser"/>
+    </bean>
+    <bean id="relationHandler" class="eu.dnetlib.data.claims.migration.handler.RelationHandler">
+        <property name="sqlDAO" ref="sqlDao"/>
+        <property name="queryGenerator" ref="queryGenerator"/>
+        <property name="relationParser" ref="relationParser"/>
+    </bean>
+    <bean id="indexResultHandler" class="eu.dnetlib.data.claims.migration.handler.IndexResultHandler">
+        <property name="searchUtils" ref="searchUtils"/>
+    </bean>
+    <bean id="resultHandler" class="eu.dnetlib.data.claims.migration.handler.ResultHandler">
+        <property name="sqlDAO" ref="sqlDao"/>
+        <property name="queryGenerator" ref="queryGenerator"/>
+        <!--<property name="pathToSaveRecord" value="/home/argirok/claims_beta/"/>-->
+        <property name="pathToSaveRecord" value="${services.claimsDemo.results.pathToSaveRecord}"/>
+
+    </bean>
+    <!-- End of Handlers -->
+    <!--Parsers -->
+    <bean id="oafParser" class="eu.dnetlib.data.claims.migration.parser.OafParser"></bean>
+    <bean id="dmfParser" class="eu.dnetlib.data.claims.migration.parser.DMFParser"></bean>
+    <bean id="relationParser" class="eu.dnetlib.data.claims.migration.parser.RelationParser"></bean>
+    <bean id="externalRecordParser" class="eu.dnetlib.data.claims.migration.parser.ExternalRecordParser"></bean>
+    <!-- end of Parsers -->
+    <bean id="searchUtils" class="eu.dnetlib.data.claimsDemo.SearchUtils"></bean>
+
+    <bean id="claimValidation" class="eu.dnetlib.data.claims.migration.ClaimValidation">
+        <property name="pathToSaveReport" value="${services.claimsDemo.reports.pathToSaveReport}"/>
+    </bean>
+
+    <bean id="emailSender" class="eu.dnetlib.data.emailSender.EmailSender">
+        <property name="fetchClaimHandler" ref="fetchClaimHandler"/>
+        <property name="projectHandler" ref="projectHandler"/>
+        <property name="openaireClaimsPage" value="${services.claims.mail.angularUrl}"/>
+        <property name="username" value="${services.claims.mail.from}"/>
+        <property name="password" value="${services.claims.mail.password}"/>
+        <property name="host" value="${services.claims.mail.host}"/>
+        <property name="port" value="${services.claims.mail.port}"/>
+        <property name="from" value="${services.claims.mail.from}"/>
+        <property name="specialRecipients" value="${services.claims.mail.specialRecipients}"/>
+    </bean>
+    
+    <bean id="sqlStore" class="eu.dnetlib.data.claimsDemo.SqlStore" init-method="init" destroy-method="destroy">
+        <property name="dbUser" value="${services.claimsDemo.db.username}"/>
+        <property name="dbPassword" value="${services.claimsDemo.db.password}"/>
+        <property name="dbDriver" value="${services.claimsDemo.db.driverClassName}"/>
+        <property name="dbUrl" value="${services.claimsDemo.db.url}"/>
+    </bean>
+
+    <bean id="sqlDao" class="eu.dnetlib.data.claimsDemo.SqlDAO">
+        <property name="sqlStore" ref="sqlStore"/>
+    </bean>
+
+
+    <bean id="queryGenerator" class="eu.dnetlib.data.claimsDemo.QueryGenerator">
+        <property name="updateOnInsert" value="true"/>
+    </bean>
+
+    <bean id="beautySleep" class="java.lang.String">
+        <constructor-arg type="String" value="86400"/>
+    </bean>
+
+    <bean id="targetHour" class="java.lang.String">
+        <constructor-arg type="String" value="12"/>
+    </bean>
+
+    <bean id="targetMinute" class="java.lang.String">
+        <constructor-arg type="String" value="00"/>
+    </bean>
+
+    <bean id="targetSecond" class="java.lang.String">
+        <constructor-arg type="String" value="00"/>
+    </bean>
+</beans>
\ No newline at end of file
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ProjectHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ProjectHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ProjectHandler.java	(revision 47503)
@@ -0,0 +1,81 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import eu.dnetlib.data.claims.migration.entity.Project;
+import eu.dnetlib.data.claims.migration.parser.OafParser;
+import eu.dnetlib.data.claimsDemo.QueryGenerator;
+import eu.dnetlib.data.claimsDemo.SQLStoreException;
+import eu.dnetlib.data.claimsDemo.SearchUtils;
+import eu.dnetlib.data.claimsDemo.SqlDAO;
+import org.apache.log4j.Logger;
+
+import java.util.List;
+
+/**
+ * Created by kiatrop on 5/2/2016.
+ */
+public class ProjectHandler {
+    SearchUtils searchUtils = null;
+    OafParser oafParser = null;
+    SqlDAO sqlDAO = null;
+    QueryGenerator queryGenerator = null;
+
+    private static Logger logger = Logger.getLogger(ProjectHandler.class);
+
+    private String fetchProjectById(String id) throws Exception {
+        return searchUtils.fetchProjectXmlFromIndex(id);
+    }
+
+    public Project fetchProjectByID(String id) throws Exception {
+        return fetchProjectByOaf(fetchProjectById(id));
+    }
+
+    public Project fetchProjectByOaf(String oaf) throws Exception {
+        return oafParser.oaf2Project(oaf);
+    }
+/*    public String generateSaveQueryForProject(Project project){
+        return queryGenerator.generateInsertProjectQuery(project.getOpenaireId(),project.getName(),project.getAcronym(),project.getFunderId(),project.getFunderName(),project.getFunderShortName());
+    }
+    public void saveProject(Project project) throws Exception {
+        sqlDAO.executePreparedQuery(generateSaveQueryForProject(project));
+    }*/
+    public OafParser getOafParser() {
+        return oafParser;
+    }
+
+    public void setOafParser(OafParser oafParser) {
+        this.oafParser = oafParser;
+    }
+
+    public SearchUtils getSearchUtils() {
+        return searchUtils;
+    }
+
+    public void setSearchUtils(SearchUtils searchUtils) {
+        this.searchUtils = searchUtils;
+    }
+    public QueryGenerator getQueryGenerator() {
+        return queryGenerator;
+    }
+
+    public void setQueryGenerator(QueryGenerator queryGenerator) {
+        this.queryGenerator = queryGenerator;
+    }
+
+    public void updateTokenByProjectId(String projectId, String newToken) throws SQLStoreException,Exception {
+        sqlDAO.executeUpdateQuery(queryGenerator.generateUpdateTokenByProjectId(projectId, newToken));
+    }
+
+    public void updateContactEmailsByProjectId(String projectId, List<String> contactEmails) throws SQLStoreException,Exception {
+        sqlDAO.executeUpdateQuery(queryGenerator.generateUpdateContactEmailsByProjectIdByProjectId(projectId, contactEmails));
+    }
+
+    public SqlDAO getSqlDAO() {
+        return sqlDAO;
+    }
+
+    public void setSqlDAO(SqlDAO sqlDAO) {
+        this.sqlDAO = sqlDAO;
+    }
+
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/JsonldBuilder.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/JsonldBuilder.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/JsonldBuilder.java	(revision 47503)
@@ -0,0 +1,82 @@
+package eu.dnetlib.data.claims.migration;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.google.gson.*;
+import eu.dnetlib.data.claims.migration.entity.Claim;
+import eu.dnetlib.data.claims.migration.entity.Result;
+import org.springframework.web.client.RestTemplate;
+
+import javax.lang.model.type.ArrayType;
+
+public class JsonldBuilder {
+	
+	public static String toJsonld(ClaimGenerics<Object, Result> claim) {
+		Gson gson = new GsonBuilder().setPrettyPrinting().create();
+		
+		String retString = gson.toJson(claim);
+		
+	/*	final String uri = "http://localhost:9090/oa/buildAndInsertClaim";
+		 
+	 
+	    RestTemplate restTemplate = new RestTemplate();
+	    String result = restTemplate.postForObject( uri, retString, String.class);
+	 
+	    System.out.println(result);
+	*/	
+		return retString;
+//		JsonParser parser = new JsonParser();
+//		JsonObject obj = parser.parse(retString).getAsJsonObject();
+//		obj.addProperty("@context", "https://dl.dropboxusercontent.com/u/19168406/oa-openaire.jsonld");
+//		obj.addProperty("@type", "oa:Annotation");
+//		return  gson.toJson(obj).toString();
+	}
+    public static String toJsonld(Claim claim) {
+        Gson gson = new GsonBuilder().setPrettyPrinting().create();
+        String retString = gson.toJson(claim);
+        return retString;
+    }
+    public static String toJsonld(List<Claim> claims) {
+
+        GsonBuilder gsonBuilder = new GsonBuilder();
+        gsonBuilder.setPrettyPrinting();
+        gsonBuilder.setDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+        Gson gson =gsonBuilder.create();
+
+         String retString = gson.toJson(claims);
+        return retString;
+    }
+
+	public static void bulkLoad(List<String> claims) {
+		
+		final String uri = "http://localhost:9090/oa/insertClaim";
+		RestTemplate restTemplate = new RestTemplate();
+		 
+		int counter = 0;
+		
+		List<String> claimsBatch = new ArrayList<String>();
+		for (String claim : claims) {
+			counter ++;
+			claimsBatch.add(claim);
+			if (counter % 50 == 0) {
+				String result = restTemplate.postForObject( uri, "{\"@graph\" : "+claimsBatch.toString()+"}", String.class);
+				claimsBatch.clear();
+				System.out.println(result);
+			}
+		}
+		
+		if (!claimsBatch.isEmpty()) {
+			String result = restTemplate.postForObject( uri, "{\"@graph\" : "+claimsBatch.toString()+"}", String.class);
+			claimsBatch.clear();
+			System.out.println(result);
+		}
+	 
+		
+//		JsonParser parser = new JsonParser();
+//		JsonObject obj = parser.parse(retString).getAsJsonObject();
+//		obj.addProperty("@context", "https://dl.dropboxusercontent.com/u/19168406/oa-openaire.jsonld");
+//		obj.addProperty("@type", "oa:Annotation");
+//		return  gson.toJson(obj).toString();
+	}
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/ClaimValidationException.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/ClaimValidationException.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/ClaimValidationException.java	(revision 47503)
@@ -0,0 +1,24 @@
+package eu.dnetlib.data.claims.migration;
+
+/**
+ * Created by kiatrop on 21/4/2016.
+ */
+public class ClaimValidationException extends Exception {
+
+    public ClaimValidationException() {
+        super();
+    }
+
+    public ClaimValidationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public ClaimValidationException(String message) {
+        super(message);
+    }
+
+    public ClaimValidationException(Throwable cause) {
+        super(cause);
+    }
+
+}
Index: modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claimsDemo/claims.sql
===================================================================
--- modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claimsDemo/claims.sql	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claimsDemo/claims.sql	(revision 47503)
@@ -0,0 +1 @@
+ 
\ No newline at end of file
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/emailSender/EmailScheduler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/emailSender/EmailScheduler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/emailSender/EmailScheduler.java	(revision 47503)
@@ -0,0 +1,122 @@
+package eu.dnetlib.data.emailSender;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import java.util.Calendar;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+
+import static java.util.concurrent.TimeUnit.SECONDS;
+
+/**
+ * Created by kiatrop on 10/5/2017.
+ */
+
+
+public class EmailScheduler implements ServletContextListener {
+
+    private int delay = 0;
+    private final Logger logger = Logger.getLogger(EmailScheduler.class);
+
+    @Autowired
+    private String beautySleep;
+
+    @Autowired
+    private String targetHour;
+    @Autowired
+    private String targetMinute;
+    @Autowired
+    private String targetSecond;
+    @Autowired
+    private EmailSender emailSender;
+
+    private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
+
+    @Override
+    public void contextInitialized(ServletContextEvent servletContextEvent) {
+        WebApplicationContextUtils
+                .getRequiredWebApplicationContext(servletContextEvent.getServletContext())
+                .getAutowireCapableBeanFactory()
+                .autowireBean(this);
+
+        logger.debug("Initializing EmailScheduler with beautySleep " + beautySleep + " and begin time " + targetHour+":"+targetMinute+":"+targetSecond + " and email sender " + emailSender);
+        delay = getInitialDelaySeconds(Integer.parseInt(targetHour), Integer.parseInt(targetMinute), Integer.parseInt(targetSecond));
+        logger.debug("EmailScheduler will wait "+delay + " seconds");
+        
+        final ScheduledFuture<?> resetHandle = scheduler.scheduleAtFixedRate(emailSender, delay, Integer.parseInt(beautySleep), SECONDS);
+    }
+
+    @Override
+    public void contextDestroyed(ServletContextEvent servletContextEvent) {
+        logger.info("Shutting down EmailScheduler.");
+        scheduler.shutdown();
+    }
+
+    private int getInitialDelaySeconds(int targetHour, int targetMinute, int targetSecond) {
+        int delay = 0;  // delay in seconds
+
+        // calculate second of target run time within a day
+        int target = targetHour*60*60+targetMinute*60+targetSecond;
+
+        // calculate second of current time within a day
+        Calendar calendar = Calendar.getInstance();
+        int second = calendar.get(Calendar.SECOND);
+        int minute = calendar.get(Calendar.MINUTE);
+        int hour = calendar.get(Calendar.HOUR_OF_DAY);
+        int current = hour*60*60+minute*60+second;
+
+        if(target > current) {
+            delay = target - current;
+        } else {
+            // one day has 86400 seconds
+            delay = 86400 - (current - target);
+        }
+
+        return delay;
+    }
+
+    public void setEmailSender(EmailSender emailSender) {
+        this.emailSender = emailSender;
+    }
+
+    public void setBeautySleep(String beautySleep) {
+        this.beautySleep = beautySleep;
+    }
+
+    public String getBeautySleep() {
+        return beautySleep;
+    }
+
+    public EmailSender getEmailSender() {
+        return emailSender;
+    }
+
+    public String getTargetHour() {
+        return targetHour;
+    }
+
+    public void setTargetHour(String targetHour) {
+        this.targetHour = targetHour;
+    }
+
+    public String getTargetMinute() {
+        return targetMinute;
+    }
+
+    public void setTargetMinute(String targetMinute) {
+        this.targetMinute = targetMinute;
+    }
+
+    public String getTargetSecond() {
+        return targetSecond;
+    }
+
+    public void setTargetSecond(String targetSecond) {
+        this.targetSecond = targetSecond;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/RelationParserTest.java
===================================================================
--- modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/RelationParserTest.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/RelationParserTest.java	(revision 47503)
@@ -0,0 +1,56 @@
+package eu.dnetlib.data.claims.migration.parser;
+
+import eu.dnetlib.data.claims.migration.entity.Relation;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Created by kiatrop on 9/2/2016.
+ */
+public class RelationParserTest {
+
+    private final String projectResultXml =
+            "<RELATIONS>" +
+                    "<RELATION type='resultProject' source='50|od______2367::63368dc45b69d3eac6bf94b0181b4e64' target='40|corda_______::fe4cbcc8f465c016c034a4f93965074c' />" +
+                    "</RELATIONS>";
+
+    private final String publicationDatasetXml =
+            "<RELATIONS>" +
+                    "<RELATION type='resultResult_publicationdataset_isRelatedTo' source='50|dedup_wf_001::f81ff2795647ddd5756b046c026e22ec' target='50|datacite____::6302a4307468b410343413c04b11453b' />" +
+                    "</RELATIONS>";
+
+    private final String datasetPublicationXml =
+            "<RELATIONS>" +
+                    "<RELATION type='resultResult_datasetpublication_isRelatedTo' source='50|r37b0ad08687::f016cea0f48814bea455804017883872' target='50|crossref____::68178723a3e54b2ab18acb8e2859ddaf' />" +
+                    "</RELATIONS>";
+
+
+    @Test
+    public void xml2Relation_projectResult_test() {
+        Relation relation = RelationParser.xml2Relation(projectResultXml);
+        Assert.assertEquals(relation.getSourceId(), "corda_______::fe4cbcc8f465c016c034a4f93965074c");
+        Assert.assertEquals(relation.getSourceType(), ClaimUtils.PROJECT);
+        Assert.assertEquals(relation.getTargetId(), "od______2367::63368dc45b69d3eac6bf94b0181b4e64");
+        Assert.assertEquals(relation.getTargetType(), ClaimUtils.PUBLICATION);
+    }
+
+    @Test
+    public void xml2Relation_publicationDataset_test() {
+        Relation relation = RelationParser.xml2Relation(publicationDatasetXml);
+        Assert.assertEquals(relation.getSourceId(), "datacite____::6302a4307468b410343413c04b11453b");
+        Assert.assertEquals(relation.getSourceType(), ClaimUtils.DATASET);
+        Assert.assertEquals(relation.getTargetId(), "dedup_wf_001::f81ff2795647ddd5756b046c026e22ec");
+        Assert.assertEquals(relation.getTargetType(), ClaimUtils.PUBLICATION);
+    }
+
+    @Test
+    public void xml2Relation_datasetPublication_test() {
+        Relation relation = RelationParser.xml2Relation(datasetPublicationXml);
+        Assert.assertEquals(relation.getSourceId(), "crossref____::68178723a3e54b2ab18acb8e2859ddaf");
+        Assert.assertEquals(relation.getSourceType(), ClaimUtils.PUBLICATION);
+        Assert.assertEquals(relation.getTargetId(), "r37b0ad08687::f016cea0f48814bea455804017883872");
+        Assert.assertEquals(relation.getTargetType(), ClaimUtils.DATASET);
+    }
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SqlDAO.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SqlDAO.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SqlDAO.java	(revision 47503)
@@ -0,0 +1,126 @@
+package eu.dnetlib.data.claimsDemo;
+
+/**
+ * Created by Eri on 18/11/2015.
+ */
+
+
+import org.apache.log4j.Logger;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+
+/**
+ * @author eri
+ */
+
+public class SqlDAO {
+	private SqlStore sqlStore;
+	//private QueryGenerator queryGenerator;
+
+	private Logger log = Logger.getLogger(this.getClass());
+	private long startTime;
+	private long endtime;
+
+	public SqlDAO() throws Exception {
+
+	}
+
+
+
+	/**
+	 * Example of calling a stored procedure
+	 *
+	 * @throws Exception
+	 *
+	public void callStoredProcedure() throws Exception {
+		log.info("  Executing Stored Procedure...");
+		sqlStore.getConnection();
+		startTime = System.currentTimeMillis();
+
+		String q = queryGenerator.callProcedure("create_views");
+		sqlStore.executeStoredProcedure(q);
+		sqlStore.closeConnection();
+		endtime = System.currentTimeMillis();
+		log.info("Total time for  Procedure    : " + ((endtime - startTime) / 60000) + " minutes ");
+	}
+	*/
+
+	/**
+	 * Example of executing a prepared query with a result set
+	 * with Query and parameters given as arguements
+	 *
+	 * @throws Exception
+	 */
+	public String executePreparedQuery(String q, ArrayList<String> data) throws SQLException, SQLStoreException {
+
+			ResultSet rs = sqlStore.executeQuery(q, data);
+			return sqlStore.getResults(rs);
+	}
+
+	/**
+	 * Example of executing a prepared query with a result set
+	 * with query set from Query Generator class
+	 *
+	 * @throws Exception
+	 *
+	public String executePreparedQuery(ArrayList<String> data) throws Exception {
+		try {
+			ResultSet rs = sqlStore.executeQuery(queryGenerator.generateSelectAllClaimsQuery(), data);
+			return sqlStore.getResults(rs);
+
+		} catch (Exception e)
+
+		{
+			log.error(e.getMessage());
+			throw new Exception(e);
+		}
+
+	} */
+
+	/**
+	 * Example of executing a custom prepared query
+	 *
+	 * @throws Exception
+	 */
+	public ResultSet executePreparedQuery(String q) throws SQLStoreException, SQLException {
+ 			ResultSet rs = sqlStore.executeQuery(q);
+			log.debug("Executing query " + q);
+			return rs;
+
+
+
+	}
+
+	public void executeUpdateQuery(String q) throws Exception {
+		try {
+			log.debug("Executing query " + q);
+			sqlStore.executeUpdate(q);
+
+		} catch (Exception e)
+
+		{
+            log.debug("\n Query is:"+q);
+			log.error("Fail to execute query:" + q, e);
+			throw new Exception(e);
+		}
+
+	}
+
+	public SqlStore getSqlStore() {
+		return sqlStore;
+	}
+
+	public void setSqlStore(SqlStore sqlStore) {
+		this.sqlStore = sqlStore;
+	}
+
+	/*public QueryGenerator getQueryGenerator() {
+		return queryGenerator;
+	}
+
+	public void setQueryGenerator(QueryGenerator queryGenerator) {
+		this.queryGenerator = queryGenerator;
+	}*/
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SearchUtils.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SearchUtils.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/SearchUtils.java	(revision 47503)
@@ -0,0 +1,317 @@
+package eu.dnetlib.data.claimsDemo;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathFactory;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+
+/**
+ * Created by argirok on 20/11/2015.
+ */
+/*
+*Search and Parsing xmls from Search Service
+*Search for DOIs
+*
+ */
+public class SearchUtils {
+    private static final Logger logger = Logger.getLogger(SearchUtils.class);
+
+    private static String searchUrl="http://beta.services.openaire.eu:8480/search/search?action=search";
+//    private static String searchUrl="http://services.openaire.eu:8480/search/search?action=search";
+    private static String apiUrlForResults=" http://beta.services.openaire.eu:8480/search/api/";//"http://api.openaire.eu/search/";
+    private static String apiUrlForDedupResults="http://rudie.di.uoa.gr:8080/dnet-functionality-services-1.2.0-SNAPSHOT/api/";
+    private static String apiUrlForProjects="http://beta.services.openaire.eu:8480/search/api/";//"http://rudie.di.uoa.gr:8080/dnet-functionality-services-1.2.0-SNAPSHOT/api/";
+    private static String crossrefUrl="https://api.crossref.org/works?filter=doi:";
+    private static String dataciteUrl="https://data.datacite.org/application/rdf+xml/";
+    private static String dataciteNewAPIUrl="https://api.datacite.org/works/";
+    private static String orcidUrlPrefix="https://pub.orcid.org/";
+    private static String orcidUrlSuffix="/orcid-works";
+    private boolean useApi=true;
+
+    public SearchUtils(){
+
+    }
+
+    public static String fetchProjectXmlFromIndex(String id) throws Exception{
+            return getRequest(getProjectApiUrl(id));
+    }
+
+    /**
+     *Look up in API, if there is no result,
+     * consider that id is a dedup id and search for the objIdentifier id.
+     * Then look up again in the API with the objIdentifier
+     * @param id
+     * @return xml or null
+     * @throws Exception
+     */
+    public static String fetchPublicationXmlFromIndex(String id) throws Exception{
+
+        String xml=getRequest(getPublicationApiUrl(id));
+        if(getNumberOfResultsInAPIXML(xml)==0){
+            String objId=getResultObjIdentifierFromSearch(id);
+            if(objId!=null){
+                xml=getRequest(getPublicationApiUrl(objId));
+                if(getNumberOfResultsInAPIXML(xml)==0){
+                    xml=null;
+                }
+            }else{
+                xml=null;
+            }
+        }
+        return xml;
+    }
+    public static String fetchDedupPublicationXmlFromIndex(String id) throws Exception{
+
+        String xml=getRequest(getDedupPublicationApiUrl(id));
+        if(getNumberOfResultsInAPIXML(xml)==0){
+            String objId=getResultObjIdentifierFromSearch(id);
+            if(objId!=null){
+                xml=getRequest(getDedupPublicationApiUrl(objId));
+                if(getNumberOfResultsInAPIXML(xml)==0){
+                    xml=null;
+                }
+            }else{
+                xml = null;
+            }
+        }
+        return xml;
+    }
+
+    /**
+     *Look up in API, if there is no result,
+     * consider that id is a dedup id and search for the objIdentifier id.
+     * Then look up again in the API with the objIdentifier
+     *
+     * @param id
+     * @return xml
+     * @throws Exception
+     */
+    public static String fetchDatasetXmlFromIndex(String id) throws Exception{
+
+        String xml=getRequest(getDatasetApiUrl(id));
+        if(getNumberOfResultsInAPIXML(xml)==0){
+            String objId=getResultObjIdentifierFromSearch(id);
+            if(objId!=null){
+                xml=getRequest(getDatasetApiUrl(objId));
+                if(getNumberOfResultsInAPIXML(xml)==0){
+                    xml=null;
+                }
+            }else{
+                xml=null;
+            }
+        }
+        return xml;
+
+    }
+    public static String fetchDedupDatasetXmlFromIndex(String id) throws Exception{
+
+        String xml=getRequest(getDedupDatasetApiUrl(id));
+        if(getNumberOfResultsInAPIXML(xml)==0){
+            String objId=getResultObjIdentifierFromSearch(id);
+            if(objId!=null){
+                xml=getRequest(getDedupDatasetApiUrl(objId));
+                if(getNumberOfResultsInAPIXML(xml)==0){
+                    xml=null;
+                }
+            }else{
+                xml = null;
+            }
+        }
+        return xml;
+
+    }
+
+    public static String fetchResultXMLFromDatacite(String id) throws Exception{
+            return getRequest(getDataciteUrl(id));
+    }
+    public static String fetchResultXMLFromOrcid(String id) throws Exception{
+
+            return getRequest(getOrcidUrl(id));
+    }
+
+     public static String getProjectApiUrl(String id)  {
+
+        return apiUrlForProjects+"/projects?openaireProjectID="+id;
+    }
+
+    public static String getDatasetApiUrl(String id)  {
+
+        return apiUrlForResults+"/datasets?openaireDatasetID="+id;
+    }
+    public static String getDedupDatasetApiUrl(String id)  {
+
+        return apiUrlForDedupResults+"/datasets?openaireDatasetID="+id;
+    }
+    public static String getPublicationApiUrl(String id)  {
+
+        return apiUrlForResults+"/publications?openairePublicationID="+id;
+    }
+    public static String getDedupPublicationApiUrl(String id)  {
+
+        return apiUrlForDedupResults+"/publications?openairePublicationID="+id;
+    }
+    private static String getDataciteUrl(String id)  {
+
+        return dataciteNewAPIUrl+id;
+    }
+
+    private static String getOrcidUrl(String id)  {
+
+        return orcidUrlPrefix+id+orcidUrlSuffix;
+    }
+
+
+    /**
+     * Get result and objIdentifier  form openaire Search
+     * @param resultdupid
+     * @return
+     */
+    private static String getResultXMLByResultdupidSearchByUrl(String resultdupid)  {
+        String url= null;
+        try {
+             url = searchUrl+"&sTransformer=results_openaire&query="+
+                    URLEncoder.encode("(((deletedbyinference = false) AND (oaftype exact result)) )" +
+                            " and (resultdupid exact " + resultdupid + ")", "UTF-8")
+                    +"&size=10&locale=en_GB";
+        } catch (UnsupportedEncodingException e) {
+            logger.error("UnsupportedEncodingException",e);
+        }
+        return url;
+    }
+
+
+    // HTTP GET request
+    private static String getRequest(String url) throws Exception {
+        URL obj = new URL(url);
+        HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+        int responseCode = con.getResponseCode();
+        if(responseCode != 200){
+            return null;
+        }
+        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+        StringBuffer response = new StringBuffer();
+        String inputLine;
+        while ((inputLine = in.readLine()) != null) {
+            response.append(inputLine).append("\n");
+        }
+        in.close();
+        return response.toString();
+    }
+
+    public static String getCrossrefJsonRecord(String doi){
+        String url=crossrefUrl+doi;
+        URL obj = null;
+        String responseStr=null;
+        try {
+            obj = new URL(url);
+            HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+            BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+            StringBuffer response = new StringBuffer();
+            String inputLine;
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine).append("\n");
+            }
+            in.close();
+            responseStr=response.toString();
+            if(responseStr==null||(!responseStr.contains("\"status\":\"ok\"")||!(responseStr.contains("\"DOI\":\"")))){
+                responseStr=null;
+            }
+        } catch (Exception e) {
+            try{
+                PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("dois_malformed_urls.txt", true)));
+                out.println("Doi:"+doi+" Url:"+url);
+                out.close();
+
+            }catch (IOException e1) {
+                logger.error("Couldn't write to file " + "dois_malformed_urls.txt",e);
+            }
+
+        }
+        return responseStr;
+    }
+
+    /**
+     *
+     * @param doi
+     * @return true  if the given doi request returns a valid answer otherwise false
+     * @throws IOException
+     */
+     public static boolean isDoiValid(String doi) throws IOException {
+            boolean found=false;
+            String responseStr=getCrossrefJsonRecord(doi);
+             if(responseStr!=null){
+                found=true;
+            }
+            return found;
+    }
+
+    /**
+     * Search in index for result with resultdupid
+     * @param  resultdupid  Openaire Id
+     * @return objIdentifier
+     */
+    private static String getResultObjIdentifierFromSearch(String resultdupid) throws Exception {
+        String xml=getRequest(getResultXMLByResultdupidSearchByUrl(resultdupid));
+        String objIdentifier=null;
+            String size=null;
+            DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+            DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+            InputSource inputSource= new InputSource(new StringReader(xml));
+            Document document=dBuilder.parse(inputSource);
+             XPathFactory xPathfactory= XPathFactory.newInstance();
+            XPath xpath = xPathfactory.newXPath();
+            NodeList nl = (NodeList) xpath.compile("//total/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                size= nl.item(0).getNodeValue();
+            }
+            if(size!=null && Integer.parseInt(size)>0){
+                nl = (NodeList) xpath.compile("//field[@indexId='objIdentifier']/@value").evaluate(document, XPathConstants.NODESET);
+                if (nl.getLength() > 0) {
+                    objIdentifier=nl.item(0).getNodeValue();
+                }
+            }
+        return objIdentifier;
+    }
+
+    /**
+     *
+     * @param xml : API result xml
+     * @return number of results Found
+     * @throws Exception
+     */
+    public static Integer getNumberOfResultsInAPIXML(String xml) throws Exception {
+        if(xml==null){
+            return 0;
+        }
+        String totalStr=null;
+        Integer total=0;
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        InputSource inputSource= new InputSource(new StringReader(xml));
+        Document document=dBuilder.parse(inputSource);
+        XPathFactory xPathfactory= XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+        NodeList nl = (NodeList) xpath.compile("//total/text()").evaluate(document, XPathConstants.NODESET);
+        if (nl.getLength() > 0) {
+            totalStr= nl.item(0).getNodeValue();
+        }
+        if(totalStr!=null){
+            total=Integer.parseInt(totalStr);
+        }
+        return total;
+    }
+
+
+}
+
+
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/IndexUtils.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/IndexUtils.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/IndexUtils.java	(revision 47503)
@@ -0,0 +1,382 @@
+package eu.dnetlib.data.claimsDemo;
+
+import eu.dnetlib.data.claims.migration.entity.Project;
+import eu.dnetlib.data.claims.migration.entity.Result;
+import org.apache.log4j.Logger;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import sun.net.www.protocol.http.HttpURLConnection;
+
+import java.io.*;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by kiatrop on 21/3/2017.
+ */
+public class IndexUtils {
+
+    private static final Logger logger = Logger.getLogger(IndexUtils.class);
+
+    public static JSONObject createJSON(Result result, List<Project> projects, List<String> concepts) throws Exception {
+        //id ?????? result.getOpenaireId();
+        //source ????
+        result.getTitle();
+        //Description ????
+        result.getAccessRights();
+        result.getEmbargoEndDate();
+        result.getAuthors();
+        result.getExternalUrl();
+        //dcSource ????
+        result.getDoi();
+        //subjects ++++
+        //Concepts
+        //publication date
+        //publisher
+        //language
+        //category
+        //isConcept????
+
+        return null;
+    }
+
+    public static JSONObject createJSON(String id, String source, String title, String description, String access_mode,
+                                        String embargoEndDate, Map<String,String> authors, String url, String dcSource,
+                                        String doi, List<String> subjects, List<String> concepts,
+                                        String publicationDate, String publisher, String language, String category,
+                                        boolean isConcept, List<Project> project4Indexes, List<String> concepts4index) throws Exception {
+
+        if (source.equals("openaire")) {
+            throw new IllegalArgumentException("cannot create JSON for openaire");
+        }
+        //logger.info("create JSON for doi " + doi);
+        //logger.info("projects " + project4Indexes);
+
+        //if the orcid id exists
+        String orcid = null;
+        String hostedby = null;
+        String hostedbyName = null;
+        String collectedFrom = null;
+        String collectedFromName = null;
+        String recordIdentifier = id;
+        String newDoi = doi;
+        hostedby = "openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18";
+
+        if (source.equals("doi") && !isConcept) {
+            hostedbyName = "Unknown Repository";
+            collectedFrom = "openaire____::crossref";
+            collectedFromName = "Crossref";
+            newDoi = id;
+
+        } else if (source.equals("datacite")) {
+            hostedbyName = "Unknown Repository";
+            collectedFrom = "openaire____::datacite";
+            collectedFromName = "Datacite";
+
+        } else if (source.equals("orcid")) {
+            orcid = id;
+            hostedbyName = "Unknown Repository";
+            collectedFrom = "openaire____::orcid";
+            collectedFromName = "ORCID";
+
+        } else if (source.equals("driver")) {
+            hostedbyName = "Unknown Repository";
+            collectedFrom = "openaire____::driver";
+            collectedFromName = "Digital Repository Infrastructure Vision for European Research";
+        }
+
+        JSONObject claimJSON = new JSONObject();
+//        String prefix = getPrefix(source);
+        claimJSON.put("originalId", id);
+        claimJSON.put("title", title);
+
+        JSONArray authorsJSONArray = new JSONArray();
+        for (Map.Entry<String,String> authorEntry: authors.entrySet()) {
+            authorsJSONArray.add(authorEntry.getValue());
+        }
+
+        claimJSON.put("authors", authorsJSONArray);
+
+        claimJSON.put("publisher", publisher);
+        claimJSON.put("description", description);
+        claimJSON.put("language", language);
+
+        JSONArray pidsJSONArray = new JSONArray();
+        JSONObject pidJSON = null;
+        if (newDoi != null) {
+            pidJSON = new JSONObject();
+            pidJSON.put("type", "doi");
+            pidJSON.put("value", newDoi);
+            pidsJSONArray.add(pidJSON);
+        }
+        if (orcid != null) {
+            pidJSON = new JSONObject();
+            pidJSON.put("type", "orcidworkid");
+            pidJSON.put("value", orcid);
+            pidsJSONArray.add(pidJSON);
+        }
+        claimJSON.put("pids", pidsJSONArray);
+
+        claimJSON.put("licenseCode", access_mode);
+        if(source.equals("crossref")) {
+            claimJSON.put("resourceType", "0001");
+        } else if (source.equals("datacite")) {
+            claimJSON.put("resourceType", "0021");
+        } else {
+            claimJSON.put("resourceType", "0001");
+        }
+
+        claimJSON.put("url", url);
+        claimJSON.put("collectedFromId", collectedFrom);
+        claimJSON.put("hostedById", hostedby);
+
+        JSONArray linksToProjectsJSONArray = new JSONArray();
+        for (Project project:project4Indexes) {
+            linksToProjectsJSONArray.add(createProjectPath(project)) ;
+        }
+        claimJSON.put("linksToProjects",linksToProjectsJSONArray);
+
+        JSONArray contextsJSONArray = new JSONArray();
+        if(!concepts4index.isEmpty()) {
+            for (String context: concepts4index) {
+                contextsJSONArray.add(context); //TODO check
+            }
+        }
+        claimJSON.put("contexts", contextsJSONArray);
+
+        return claimJSON;
+    }
+
+    public static void feedIndex(String id, String source, String title,
+                                 String description, String access_mode, String embargoEndDate,
+                                 Map<String, String> authors, String url, String dcSource, String doi,
+                                 List<Project> projects, List<String> subjects, List<String> concepts,
+                                 String publicationDate, String publisher, String language, String category,
+                                 boolean isConcept, List<Project> project4Indexes, List<String> concepts4index,
+                                 String directClaimAPIUrl) throws Exception {
+
+        logger.info("number of projects " + project4Indexes);
+        if (project4Indexes!= null) {
+            logger.info("number of projects " + project4Indexes.size());
+        }
+
+        URL obj = new URL(directClaimAPIUrl);
+        HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+        JSONObject claimJson = createJSON(id, source, title, description, access_mode, embargoEndDate,
+                authors, url, dcSource, doi, subjects, concepts, publicationDate,
+                publisher, language, category, isConcept, project4Indexes, concepts4index);
+        //add request header
+        con.setRequestMethod("POST");
+        //con.setRequestProperty("User-Agent", USER_AGENT);
+        con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
+        con.setRequestProperty("Content-Type", "application/json");
+
+        logger.debug("Feeding index with " + claimJson.toJSONString());
+        String urlParameters = claimJson.toJSONString();
+
+        // Send post request
+        con.setDoOutput(true);
+        DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(wr, "UTF-8"));
+        writer.write(urlParameters);
+        writer.close();
+        wr.close();
+
+        int responseCode = con.getResponseCode();
+        logger.debug("\nSending 'POST' request to URL : " + url);
+        logger.debug("Post parameters : " + urlParameters);
+        logger.debug("Response Code : " + responseCode);
+
+        BufferedReader in = new BufferedReader(
+                new InputStreamReader(con.getInputStream()));
+        String inputLine;
+        StringBuffer response = new StringBuffer();
+
+        while ((inputLine = in.readLine()) != null) {
+            response.append(inputLine);
+        }
+        in.close();
+
+        //print result
+        logger.debug(response.toString());
+    }
+
+    private static String createProjectPath(Project project) {
+        if (project.getFunderShortName().equals("EC")) {
+            if(project.getAcronym() != null && !project.getAcronym().trim().isEmpty()) {
+                return "info:eu-repo/grantAgreement/EC/" + project.getFundingStreamLevel0() + "/"
+                        + project.getCode() + "/EU//" + project.getAcronym();
+            }
+
+            return "info:eu-repo/grantAgreement/EC/"+project.getFundingStreamLevel0()+"/"
+                    +project.getCode()+"/EU//"+project.getName();
+        }
+
+        if (project.getFunderShortName().equals("WT")) {
+            if(project.getAcronym() != null && !project.getAcronym().trim().isEmpty()) {
+                return "info:eu-repo/grantAgreement/WT//" + project.getCode() + "//" + project.getAcronym();
+            }
+            return "info:eu-repo/grantAgreement/WT//"+project.getCode()+project.getName();
+        }
+
+        if (project.getFunderShortName().equals("ARC")) {
+            logger.debug("name: '" + project.getName()+"'");
+            logger.debug("name: '" + project.getAcronym()+"'");
+            if(project.getAcronym() != null && !project.getAcronym().trim().isEmpty()) {
+                return "info:eu-repo/grantAgreement/ARC/" + project.getFundingStreamLevel0() + "/"
+                        + project.getCode() + "/AU//" + project.getAcronym();
+            }
+            return "info:eu-repo/grantAgreement/ARC/"+project.getFundingStreamLevel0()+"/"
+                    +project.getCode()+"/AU//"+project.getName();
+        }
+
+        if (project.getFunderShortName().equals("NHMRC")) {
+            if(project.getAcronym() != null && !project.getAcronym().trim().isEmpty()) {
+                return "info:eu-repo/grantAgreement/NHMRC/" + project.getFundingStreamLevel0() + "/"
+                        + project.getCode() + "/AU//" + project.getAcronym();
+            }
+            return "info:eu-repo/grantAgreement/NHMRC/"+project.getFundingStreamLevel0()+"/"
+                    +project.getCode()+"/AU//"+project.getName();
+        }
+
+        if (project.getFunderShortName().equals("FCT")) {
+            if(project.getAcronym() != null && !project.getAcronym().trim().isEmpty()) {
+                return "info:eu-repo/grantAgreement/FCT/" + project.getFundingStreamLevel0() + "/"
+                        + project.getCode() + "/PT//" + project.getAcronym();
+            }
+            return "info:eu-repo/grantAgreement/FCT/"+project.getFundingStreamLevel0()+"/"
+                    +project.getCode()+"/PT//"+project.getName();
+        }
+
+        return "";
+    }
+
+    private static  String getPrefix(String source) {
+        logger.debug("SOURCE " + source);
+        if (source == null || source.equals("openaire")) {
+            return "openaire____";
+        } else if (source.equals("doi")) {
+            return "crossref____";
+        } if (source.equals("orcid")) {
+            return "orcid_______";
+        } else if (source.equals("datacite")) {
+            return "datacite____";
+        } else if (source.equals("driver")) {
+            return "driver______";
+        } else {
+            return null;
+        }
+    }
+/*
+    public static void main(String[] args) throws IOException {
+
+        String url = "http://beta.services.openaire.eu:8280/is/mvc/api/publications/feedObject";
+        URL obj = new URL(url);
+        HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+        //add reuqest header
+        con.setRequestMethod("POST");
+        //con.setRequestProperty("User-Agent", USER_AGENT);
+        con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
+        con.setRequestProperty("Content-Type", "application/json");
+
+
+        /*String urlParameters = "{\n" +
+                "\"collectedFromId\": \"openaire____::crossref\",\n" +
+                "\"authors\": [\"George Papastefanatos\", \"Panos Vassiliadis\", \"Alkis Simitsis\", \"Yannis Vassiliou\"],\n" +
+                "\"title\": \"HECATAEUS: Regulating schema evolution\",\n" +
+                "\"hostedById\": \"openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18\",\n" +
+                "\"licenseCode\": \"OPEN\",\n" +
+                "\"pids\": [{\n" +
+                "\"value\": \"10.1109\\/icde.2010.5447778\",\n" +
+                "\"type\": \"doi\"\n" +
+                "}],\n" +
+                "\"description\": null,\n" +
+                "\"originalId\": \"crossref____::817ee94bc4a0515adadb1fdaa78927f6\",\n" +
+                "\"contexts\": [],\n" +
+                "\"language\": null,\n" +
+                "\"linksToProjects\": [\"info:eu-repo/grantAgreement/EC/FP7/283595/EU//OpenAIREplus\"],\n" +
+                "\"url\": \"http:\\/\\/dx.doi.org\\/10.1109\\/icde.2010.5447778\",\n" +
+                "\"resourceType\": \"0001\",\n" +
+                "\"publisher\": \"Institute of Electrical & Electronics Engineers (IEEE)\"\n" +
+                "}";
+
+        String urlParameters = "{\n" +
+                "\"collectedFromId\": \"openaire____::crossref\",\n" +
+                "\"authors\": [\"George Papastefanatos\", \"Panos Vassiliadis\", \"Alkis Simitsis\", \"Yannis Vassiliou\"],\n" +
+                " \"title\": \"â\\\\ dark bottomless Abyss, that lies under our feet, had yawned openâ\\\\\",\n" +
+                "\"hostedById\": \"openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18\",\n" +
+                "\"licenseCode\": \"CLOSED\",\n" +
+                "\"pids\": [{\n" +
+                "\"value\": \"10.1007\\/s13740_012_0006_9\",\n" +
+                "\"type\": \"doi\"\n" +
+                "}],\n" +
+                "\"description\": null,\n" +
+                "\"originalId\": \"crossref____::test\",\n" +
+                "\"contexts\": [\"egi::classification::natsc::infos::dmin\"], " +
+                "\"language\": null, " +
+                "\"linksToProjects\": [\"info:eu-repo/grantAgreement/EC/FP7/283595/EU//OpenAIREplus\"], " +
+                "\"url\": \"http:\\/\\/dx.doi.org\\/10.1007\\/s13740_012_0006_9\", " +
+                "\"resourceType\": \"0001\", " +
+                "\"publisher\": \"Springer Science + Business Media\" " +
+                "}";
+*/
+
+/*        String urlParameters = "{ " +
+                "\"collectedFromId\": \"openaire____::crossref\", " +
+                "\"authors\": [\"Agapi Dalkou\"], " +
+                "\"title\": \"Η ανάπτυξη ερμηνευτικών στρατηγικών στο μάθημα της νεοελληνικής λογοτεχνίας στη δευτεροβάθμια εκπαίδευση σε περιβάλλον συνεργατικής μάθησης\", " +
+                "\"hostedById\": \"openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18\", " +
+                "\"licenseCode\": \"CLOSED\", " +
+                "\"pids\": [{ " +
+                "\"value\": \"10.12681\\/eadd\\/29202\", " +
+                "\"type\": \"doi\" " +
+                "}], " +
+                "\"description\": null, " +
+                "\"originalId\": \"crossref____::cf7d85a13ac43f92431b102723d13d5a\", " +
+                "\"contexts\": [\"egi\", \"egi::country::gr\"], " +
+                "\"language\": null, " +
+                "\"linksToProjects\": [\"info:eu-repo\\/grantAgreement\\/EC\\/FP7\\/246686\\/EU\\/\\/OPENAIRE\", \"info:eu-repo\\/grantAgreement\\/EC\\/FP7\\/288611\\/EU\\/\\/ECODRIVER\"], " +
+                "\"url\": \"http:\\/\\/dx.doi.org\\/10.12681\\/eadd\\/29202\", " +
+                "\"resourceType\": \"0001\", " +
+                "\"publisher\": \"National Documentation Centre\"" +
+                "}";
+
+        // Send post request
+        con.setDoOutput(true);
+        /*DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+        wr.writeBytes(urlParameters);
+        wr.flush();
+        wr.close();
+        */
+
+/*        DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(wr, "UTF-8"));
+        writer.write(urlParameters);
+        writer.close();
+        wr.close();
+
+
+        int responseCode = con.getResponseCode();
+        System.out.println(" Sending 'POST' request to URL : " + url);
+        System.out.println("Post parameters : " + urlParameters);
+        System.out.println("Response Code : " + responseCode);
+
+        BufferedReader in = new BufferedReader(
+                new InputStreamReader(con.getInputStream()));
+        String inputLine;
+        StringBuffer response = new StringBuffer();
+
+        while ((inputLine = in.readLine()) != null) {
+            response.append(inputLine);
+        }
+        in.close();
+
+        //print result
+        System.out.println(response.toString());
+    }
+*/
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/ClaimUtils.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/ClaimUtils.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/ClaimUtils.java	(revision 47503)
@@ -0,0 +1,38 @@
+package eu.dnetlib.data.claimsDemo;
+
+/**
+ * Created by argirok on 22/1/2016.
+ */
+public class ClaimUtils {
+
+    public enum Type { PUBLICATION, DATASET, PROJECT, CONTEXT }
+    public enum CollecteFrom {OPENAIRE, CROSSREF, DATACITE, ORCID}
+
+    public static final String  PUBLICATION = "publication";
+    public static final String  DATASET = "dataset";
+    public static final String  PROJECT = "project";
+    public static final String  CONTEXT = "context";
+
+    public static final boolean  USEAPIRESULTS = true;
+    public static final boolean  USEAPIPROJECTS = false;
+
+
+    public static final String  COLLECTED_FROM_OPENAIRE = "infrastruct_::openaire";
+    public static final String  COLLECTED_FROM_CROSSREF = "openaire____::crossref";
+    public static final String  COLLECTED_FROM_DATACITE = "openaire____::datacite";
+    public static final String  COLLECTED_FROM_ORCID =    "openaire____::orcid";
+
+    public static final String  OPENAIRE = "openaire";
+    public static final String  CROSSREF = "crossref";
+    public static final String  DATACITE = "datacite";
+    public static final String  ORCID =    "orcid";
+
+    public static final String  DATASOURCE_ID_CROSSREF = "openaire____::081b82f96300b6a6e3d282bad31cb6e2";
+    public static final String  DATASOURCE_ID_DATACTE = "openaire____::9e3be59865b2c1c335d32dae2fe7b254";
+    public static final String  DATASOURCE_ID__ORCID = "openaire____::806360c771262b4d6770e7cdf04b5c5a";
+
+    public static final String PREFIX_URL_FOR_DOI="https://dx.doi.org/";
+    public static final String FORMAT_XML="xml";
+    public static final String FORMAT_JSON="json";
+
+}
Index: modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/ExternalParserTest.java
===================================================================
--- modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/ExternalParserTest.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/ExternalParserTest.java	(revision 47503)
@@ -0,0 +1,259 @@
+package eu.dnetlib.data.claims.migration.parser;
+
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import org.apache.log4j.BasicConfigurator;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Created by kiatrop on 23/2/2016.
+ */
+public class ExternalParserTest {
+
+
+    @Before
+    public void init() throws Exception {
+        BasicConfigurator.configure();
+    }
+    private String crossrefJson = "{\"status\":\"ok\",\"message-type\":\"work-list\",\"message-version\":\"1.0.0\",\"message\":" +
+            "{\"query\":{\"search-terms\":null,\"start-index\":0},\"items-per-page\":20,\"items\":[{\"indexed\":" +
+            "{\"date-parts\":[[2015,12,28]], \"date-time\":\"2015-12-28T17:45:59Z\",\"timestamp\":1451324759779}," +
+            "\"reference-count\":0,\"publisher\":\"Society for Neuroscience\", \"issue\":\"17\"," +
+            "\"published-print\":{\"date-parts\":[[2012,4,25]]},\"DOI\":\"10.1523\\/jneurosci.2900-11.2012\"," +
+            "\"type\":\"journal-article\",\"created\": {\"date-parts\":[[2012,4,25]]," +
+            "\"date-time\":\"2012-04-25T16:38:54Z\",\"timestamp\":1335371934000},\"page\":\"5728-5736\"," +
+            "\"source\":\"CrossRef\",\"title\":[\"Imaging Microglial\\/Macrophage Activation in Spinal Cords of " +
+            "Experimental Autoimmune Encephalomyelitis Rats by Positron Emission Tomography Using the Mitochondrial " +
+            "18 kDa Translocator Protein Radioligand [18F]DPA-714\"]," +
+            "\"prefix\":\"http:\\/\\/id.crossref.org\\/prefix\\/10.1523\",\"volume\":\"32\",\"author\":" +
+            "[{\"affiliation\":[],\"family\":\"Abourbeh\",\"given\":\"G.\"},{\"affiliation\":[],\"family\":\"Theze\"," +
+            "\"given\":\"B.\"},{\"affiliation\":[],\"family\":\"Maroy\",\"given\":\"R.\"},{\"affiliation\":[],\"family\":" +
+            "\"Dubois\",\"given\":\"A.\"},{\"affiliation\":[],\"family\":\"Brulon\",\"given\":\"V.\"}," +
+            "{\"affiliation\":[],\"family\":\"Fontyn\",\"given\":\"Y.\"},{\"affiliation\":[],\"family\":\"Dolle\"," +
+            "\"given\":\"F.\"},{\"affiliation\":[],\"family\":\"Tavitian\",\"given\":\"B.\"},{\"affiliation\":[]," +
+            "\"family\":\"Boisgard\",\"given\":\"R.\"}],\"member\":\"http:\\/\\/id.crossref.org\\/member\\/393\"," +
+            "\"published-online\":{\"date-parts\":[[2012,4,25]]},\"container-title\":[\"Journal of Neuroscience\"]," +
+            "\"deposited\":{\"date-parts\":[[2014,2,27]],\"date-time\":\"2014-02-27T06:42:02Z\",\"timestamp\":1393483322000}," +
+            "\"score\":1.0,\"subtitle\":[],\"issued\":{\"date-parts\":[[2012,4,25]]}," +
+            "\"URL\":\"http:\\/\\/dx.doi.org\\/10.1523\\/jneurosci.2900-11.2012\",\"ISSN\":[\"0270-6474\",\"1529-2401\"]," +
+            "\"subject\":[\"Neuroscience(all)\"]}],\"total-results\":1,\"facets\":{}}}" +
+            "";
+
+
+    @Test
+    public void crossref2ResultTest(){
+        Result result = ExternalRecordParser.crossref2Result(crossrefJson);
+
+        Assert.assertNull(result.getAccessRights());
+        Assert.assertNull(result.getBestLicense());
+        Assert.assertEquals("openaire____::crossref", result.getCollectedFrom());
+        Assert.assertEquals("10.1523/jneurosci.2900-11.2012", result.getDoi());
+        Assert.assertNull(result.getOai());
+        Assert.assertNotNull(result.getOpenaireId());//        Assert.assertNull(result.getOpenaireId());
+        Assert.assertNull(result.getPmcid());
+        Assert.assertEquals(ClaimUtils.PUBLICATION, result.getResultType());
+        Assert.assertEquals("Imaging Microglial/Macrophage Activation in Spinal Cords of Experimental Autoimmune Encephalomyelitis Rats by Positron Emission Tomography Using the Mitochondrial 18 kDa Translocator Protein Radioligand [18F]DPA-714", result.getTitle());
+        Assert.assertEquals("json", result.getRecordFormat());
+        Assert.assertEquals("https://dx.doi.org/10.1523/jneurosci.2900-11.2012", result.getExternalUrl());
+        Assert.assertNull(result.getEmbargoEndDate());
+        Assert.assertNull(result.getOrcidworkid());
+
+        Assert.assertEquals(9, result.getAuthors().size());
+        Assert.assertEquals("G. Abourbeh", result.getAuthors().get(0+""));
+        Assert.assertEquals("Y. Fontyn", result.getAuthors().get(5+""));
+    }
+
+    private String orcidXml = "<orcid-message xmlns=\"http://www.orcid.org/ns/orcid\">\n" +
+            "    <message-version>1.1</message-version>\n" +
+            "    <orcid-profile type=\"user\">\n" +
+            "        <orcid-identifier>\n" +
+            "            <uri>http://orcid.org/0000-0002-9414-646X</uri>\n" +
+            "            <path>0000-0002-9414-646X</path>\n" +
+            "            <host>orcid.org</host>\n" +
+            "        </orcid-identifier>\n" +
+            "        <orcid-preferences>\n" +
+            "            <locale>es</locale>\n" +
+            "        </orcid-preferences>\n" +
+            "        <orcid-history>\n" +
+            "            <creation-method>website</creation-method>\n" +
+            "            <completion-date>2013-01-11T14:07:54.194Z</completion-date>\n" +
+            "            <submission-date>2013-01-11T13:27:46.558Z</submission-date>\n" +
+            "            <last-modified-date>2016-01-27T16:06:13.543Z</last-modified-date>\n" +
+            "            <claimed>true</claimed>\n" +
+            "        </orcid-history>\n" +
+            "        <orcid-activities>\n" +
+            "            <orcid-works>\n" +
+            "                <orcid-work put-code=\"21755327\" visibility=\"public\">\n" +
+            "                    <work-title>\n" +
+            "                        <title>Providing Ubiquitous Positioning in Outdoor Environments</title>\n" +
+            "                    </work-title>\n" +
+            "                    <journal-title>2015 IEEE International Conference on Systems, Man, and Cybernetics</journal-title>\n" +
+            "                    <work-citation>\n" +
+            "                        <work-citation-type>bibtex</work-citation-type>\n" +
+            "                        <citation>@inproceedings{Moreno_2015,doi = {10.1109/smc.2015.229},url = {http://dx.doi.org/10.1109/smc.2015.229},year = 2015,month = {oct},publisher = {Institute of Electrical {\\&amp;} Electronics Engineers ({IEEE})},author = {Daniel Moreno and Sergio F. Ochoa and Roc Meseguer},title = {Providing Ubiquitous Positioning in Outdoor Environments},booktitle = {2015 {IEEE} International Conference on Systems, Man, and Cybernetics}}</citation>\n" +
+            "                    </work-citation>\n" +
+            "                    <work-type>conference-paper</work-type>\n" +
+            "                    <publication-date>\n" +
+            "                        <year>2015</year>\n" +
+            "                        <month>10</month>\n" +
+            "                    </publication-date>\n" +
+            "                    <work-external-identifiers>\n" +
+            "                        <work-external-identifier>\n" +
+            "                            <work-external-identifier-type>doi</work-external-identifier-type>\n" +
+            "                            <work-external-identifier-id>10.1109/smc.2015.229</work-external-identifier-id>\n" +
+            "                        </work-external-identifier>\n" +
+            "                    </work-external-identifiers>\n" +
+            "                    <work-contributors>\n" +
+            "                        <contributor>\n" +
+            "                            <credit-name visibility=\"public\">Daniel Moreno</credit-name>\n" +
+            "                            <contributor-attributes>\n" +
+            "                                <contributor-role>author</contributor-role>\n" +
+            "                            </contributor-attributes>\n" +
+            "                        </contributor>\n" +
+            "                        <contributor>\n" +
+            "                            <credit-name visibility=\"public\">Sergio F. Ochoa</credit-name>\n" +
+            "                            <contributor-attributes>\n" +
+            "                                <contributor-role>author</contributor-role>\n" +
+            "                            </contributor-attributes>\n" +
+            "                        </contributor>\n" +
+            "                        <contributor>\n" +
+            "                            <credit-name visibility=\"public\">Roc Meseguer</credit-name>\n" +
+            "                            <contributor-attributes>\n" +
+            "                                <contributor-role>author</contributor-role>\n" +
+            "                            </contributor-attributes>\n" +
+            "                        </contributor>\n" +
+            "                    </work-contributors>\n" +
+            "                    <work-source>\n" +
+            "                        <uri>http://orcid.org/0000-0002-3054-1567</uri>\n" +
+            "                        <path>0000-0002-3054-1567</path>\n" +
+            "                        <host>orcid.org</host>\n" +
+            "                    </work-source>\n" +
+            "                </orcid-work>\n" +
+            "                <orcid-work put-code=\"19191618\" visibility=\"public\">\n" +
+            "                    <work-title>\n" +
+            "                        <title>A Context-Aware Model to Provide Positioning in Disaster Relief Scenarios</title>\n" +
+            "                    </work-title>\n" +
+            "                    <journal-title>Sensors</journal-title>\n" +
+            "                    <work-citation>\n" +
+            "                        <work-citation-type>bibtex</work-citation-type>\n" +
+            "                        <citation>@article{Moreno_2015,doi = {10.3390/s151025176},url = {http://dx.doi.org/10.3390/s151025176},year = 2015,month = {sep},publisher = {{MDPI} {AG}},volume = {15},number = {10},pages = {25176--25207},author = {Daniel Moreno and Sergio Ochoa and Roc Meseguer},title = {A Context-Aware Model to Provide Positioning in Disaster Relief Scenarios},journal = {Sensors}}</citation>\n" +
+            "                    </work-citation>\n" +
+            "                    <work-type>journal-article</work-type>\n" +
+            "                    <publication-date>\n" +
+            "                        <year>2015</year>\n" +
+            "                        <month>09</month>\n" +
+            "                    </publication-date>\n" +
+            "                    <work-external-identifiers>\n" +
+            "                        <work-external-identifier>\n" +
+            "                            <work-external-identifier-type>doi</work-external-identifier-type>\n" +
+            "                            <work-external-identifier-id>10.3390/s151025176</work-external-identifier-id>\n" +
+            "                        </work-external-identifier>\n" +
+            "                    </work-external-identifiers>\n" +
+            "                    <work-contributors>\n" +
+            "                        <contributor>\n" +
+            "                            <credit-name visibility=\"public\">Daniel Moreno</credit-name>\n" +
+            "                            <contributor-attributes>\n" +
+            "                                <contributor-role>author</contributor-role>\n" +
+            "                            </contributor-attributes>\n" +
+            "                        </contributor>\n" +
+            "                        <contributor>\n" +
+            "                            <credit-name visibility=\"public\">Sergio Ochoa</credit-name>\n" +
+            "                            <contributor-attributes>\n" +
+            "                                <contributor-role>author</contributor-role>\n" +
+            "                            </contributor-attributes>\n" +
+            "                        </contributor>\n" +
+            "                        <contributor>\n" +
+            "                            <credit-name visibility=\"public\">Roc Meseguer</credit-name>\n" +
+            "                            <contributor-attributes>\n" +
+            "                                <contributor-role>author</contributor-role>\n" +
+            "                            </contributor-attributes>\n" +
+            "                        </contributor>\n" +
+            "                    </work-contributors>\n" +
+            "                    <work-source>\n" +
+            "                        <uri>http://orcid.org/0000-0002-3054-1567</uri>\n" +
+            "                        <path>0000-0002-3054-1567</path>\n" +
+            "                        <host>orcid.org</host>\n" +
+            "                    </work-source>\n" +
+            "                </orcid-work>" +
+            "</orcid-works></orcid-activities></orcid-profile></orcid-message>";
+
+    @Test
+    public void orcid2ResultTest() {
+        Result result = ExternalRecordParser.orcid2Result(orcidXml, "0000-0002-9414-646X-21755327");
+
+        Assert.assertNull(result.getAccessRights());
+        Assert.assertNull(result.getBestLicense());
+        Assert.assertEquals("openaire____::orcid", result.getCollectedFrom());
+        Assert.assertEquals("10.1109/smc.2015.229", result.getDoi());
+        Assert.assertEquals("0000-0002-9414-646X-21755327", result.getOrcidworkid());
+        Assert.assertNull(result.getOai());
+        Assert.assertNotNull(result.getOpenaireId());//        Assert.assertNull(result.getOpenaireId());
+        Assert.assertNull(result.getPmcid());
+        Assert.assertEquals(ClaimUtils.PUBLICATION, result.getResultType());
+        Assert.assertEquals("Providing Ubiquitous Positioning in Outdoor Environments", result.getTitle());
+        Assert.assertEquals("xml", result.getRecordFormat());
+        Assert.assertEquals("https://dx.doi.org/10.1109/smc.2015.229", result.getExternalUrl());
+        Assert.assertNull(result.getEmbargoEndDate());
+
+    }
+
+
+    private String dataciteXml = "<rdf:RDF\n" +
+            "    xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n" +
+            "    xmlns:owl=\"http://www.w3.org/2002/07/owl#\"\n" +
+            "    xmlns:j.0=\"http://purl.org/dc/terms/\" > \n" +
+            "  <rdf:Description rdf:about=\"http://dx.doi.org/10.5060/D4RN35SD/USGS85K1_041\">\n" +
+            "    <j.0:creator>Krimmel, Robert</j.0:creator>\n" +
+            "    <j.0:publisher>National Snow and Ice Data Center/World Data Center for Glaciology, Boulder</j.0:publisher>\n" +
+            "    <j.0:title>Chocolate Glacier</j.0:title>\n" +
+            "    <j.0:date>2008</j.0:date>\n" +
+            "    <owl:sameAs>doi:10.5060/D4RN35SD/USGS85K1_041</owl:sameAs>\n" +
+            "    <owl:sameAs>info:doi/10.5060/D4RN35SD/USGS85K1_041</owl:sameAs>\n" +
+            "    <j.0:identifier>10.5060/D4RN35SD/USGS85K1_041</j.0:identifier>\n" +
+            "  </rdf:Description>\n" +
+            "</rdf:RDF>\n";
+
+    private String dataciteJson = "{\"data\":{\"id\":\"https://doi.org/10.5281/ZENODO.54730\",\"type\":\"works\",\"attributes\":{\"doi\":\"10.5281/ZENODO.54730\",\"url\":null,\"author\":[{\"family\":\"Manola\",\"given\":\"Natalia\"}],\"title\":\"From Open Access to Open Science\",\"container-title\":\"Zenodo\",\"description\":\"Presentation given at the PASTEUR4OA conference - Green Light for Open Access: Aligning Europe’s OA Policies, Amsterdam, 17th-18th May 2016.\",\"resource-type-subtype\":\"Presentation\",\"data-center-id\":\"cern.zenodo\",\"member-id\":\"cern\",\"resource-type-id\":\"text\",\"version\":null,\"license\":\"https://creativecommons.org/licenses/by/4.0/\",\"schema-version\":\"3\",\"results\":[],\"related-identifiers\":[],\"published\":\"2016\",\"deposited\":\"2016-06-03T17:03:51Z\",\"updated\":\"2016-06-03T17:03:51Z\",\"media\":null,\"xml\":\"PHJlc291cmNlIHhtbG5zPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtMyIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtMyBodHRwOi8vc2NoZW1hLmRhdGFjaXRlLm9yZy9tZXRhL2tlcm5lbC0zL21ldGFkYXRhLnhzZCI+CiAgPGlkZW50aWZpZXIgaWRlbnRpZmllclR5cGU9IkRPSSI+MTAuNTI4MS96ZW5vZG8uNTQ3MzA8L2lkZW50aWZpZXI+CiAgPGNyZWF0b3JzPgogICAgPGNyZWF0b3I+CiAgICAgIDxjcmVhdG9yTmFtZT5NYW5vbGEsIE5hdGFsaWEgPC9jcmVhdG9yTmFtZT4KICAgICAgPGFmZmlsaWF0aW9uPk9wZW5BSVJFPC9hZmZpbGlhdGlvbj4KICAgIDwvY3JlYXRvcj4KICA8L2NyZWF0b3JzPgogIDx0aXRsZXM+CiAgICA8dGl0bGU+RnJvbSBPcGVuIEFjY2VzcyB0byBPcGVuIFNjaWVuY2U8L3RpdGxlPgogIDwvdGl0bGVzPgogIDxwdWJsaXNoZXI+WmVub2RvPC9wdWJsaXNoZXI+CiAgPHB1YmxpY2F0aW9uWWVhcj4yMDE2PC9wdWJsaWNhdGlvblllYXI+CiAgPHN1YmplY3RzPgogICAgPHN1YmplY3Q+UEFTVEVVUjRPQTwvc3ViamVjdD4KICAgIDxzdWJqZWN0Pk9wZW4gQWNjZXNzPC9zdWJqZWN0PgogICAgPHN1YmplY3Q+UHJlc2VudGF0aW9uPC9zdWJqZWN0PgogIDwvc3ViamVjdHM+CiAgPGNvbnRyaWJ1dG9ycz4KICAgIDxjb250cmlidXRvciBjb250cmlidXRvclR5cGU9IkZ1bmRlciI+CiAgICAgIDxjb250cmlidXRvck5hbWU+RXVyb3BlYW4gQ29tbWlzc2lvbjwvY29udHJpYnV0b3JOYW1lPgogICAgICA8bmFtZUlkZW50aWZpZXIgbmFtZUlkZW50aWZpZXJTY2hlbWU9ImluZm8iPmluZm86ZXUtcmVwby9ncmFudEFncmVlbWVudC9FQy9GUDcvNjExNzQyPC9uYW1lSWRlbnRpZmllcj4KICAgIDwvY29udHJpYnV0b3I+CiAgPC9jb250cmlidXRvcnM+CiAgPGRhdGVzPgogICAgPGRhdGUgZGF0ZVR5cGU9Iklzc3VlZCI+MjAxNi0wNS0xODwvZGF0ZT4KICA8L2RhdGVzPgogIDxyZXNvdXJjZVR5cGUgcmVzb3VyY2VUeXBlR2VuZXJhbD0iVGV4dCI+UHJlc2VudGF0aW9uPC9yZXNvdXJjZVR5cGU+CiAgPGFsdGVybmF0ZUlkZW50aWZpZXJzPgogICAgPGFsdGVybmF0ZUlkZW50aWZpZXIgYWx0ZXJuYXRlSWRlbnRpZmllclR5cGU9IlVSTCI+aHR0cDovL3plbm9kby5vcmcvcmVjb3JkLzU0NzMwPC9hbHRlcm5hdGVJZGVudGlmaWVyPgogICAgPGFsdGVybmF0ZUlkZW50aWZpZXIgYWx0ZXJuYXRlSWRlbnRpZmllclR5cGU9IlVSTCI+aHR0cDovL3d3dy5wYXN0ZXVyNG9hLmV1L3NpdGVzL3Bhc3RldXI0b2EvZmlsZXMvZ2VuZXJpYy9OYXRhbGlhJTIwTWFub2xhJTIwUERGLnBkZjwvYWx0ZXJuYXRlSWRlbnRpZmllcj4KICA8L2FsdGVybmF0ZUlkZW50aWZpZXJzPgogIDxyZWxhdGVkSWRlbnRpZmllcnM+CiAgICA8cmVsYXRlZElkZW50aWZpZXIgcmVsYXRpb25UeXBlPSJIYXNQYXJ0IiByZWxhdGVkSWRlbnRpZmllclR5cGU9IlVSTCI+aHR0cHM6Ly96ZW5vZG8ub3JnL3JlY29yZC81NDczMC9maWxlcy8xOF9OYXRhbGlhX01hbm9sYV9QREYucGRmPC9yZWxhdGVkSWRlbnRpZmllcj4KICA8L3JlbGF0ZWRJZGVudGlmaWVycz4KICA8cmlnaHRzTGlzdD4KICAgIDxyaWdodHMgcmlnaHRzVVJJPSJpbmZvOmV1LXJlcG8vc2VtYW50aWNzL29wZW5BY2Nlc3MiPk9wZW4gQWNjZXNzPC9yaWdodHM+CiAgICA8cmlnaHRzIHJpZ2h0c1VSST0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnkvNC4wLyI+Q3JlYXRpdmUgQ29tbW9ucyBBdHRyaWJ1dGlvbiA0LjAgSW50ZXJuYXRpb25hbDwvcmlnaHRzPgogIDwvcmlnaHRzTGlzdD4KICA8ZGVzY3JpcHRpb25zPgogICAgPGRlc2NyaXB0aW9uIGRlc2NyaXB0aW9uVHlwZT0iQWJzdHJhY3QiPiZsdDtwJmd0O1ByZXNlbnRhdGlvbiBnaXZlbiBhdCB0aGUgUEFTVEVVUjRPQSBjb25mZXJlbmNlIC0mYW1wO25ic3A7R3JlZW4gTGlnaHQgZm9yIE9wZW4gQWNjZXNzOiBBbGlnbmluZyBFdXJvcGUmYW1wO3JzcXVvO3MgT0EgUG9saWNpZXMsIEFtc3RlcmRhbSwgMTd0aC0xOHRoIE1heSAyMDE2LiZsdDsvcCZndDs8L2Rlc2NyaXB0aW9uPgogIDwvZGVzY3JpcHRpb25zPgo8L3Jlc291cmNlPgo=\"},\"relationships\":{\"data-center\":{\"meta\":{}},\"member\":{\"meta\":{}},\"resource-type\":{\"meta\":{}}}}}";
+
+    @Test
+    public void datacite2ResultTest() {
+        Result result = ExternalRecordParser.datacite2Result(dataciteXml);
+
+        Assert.assertNull(result.getAccessRights());
+        Assert.assertNull(result.getBestLicense());
+        Assert.assertEquals("openaire____::datacite", result.getCollectedFrom());
+        Assert.assertEquals("10.5060/D4RN35SD/USGS85K1_041", result.getDoi());
+        Assert.assertNull(result.getOrcidworkid());
+        Assert.assertNull(result.getOai());
+        Assert.assertNotNull(result.getOpenaireId());//        Assert.assertNull(result.getOpenaireId());
+        Assert.assertNull(result.getPmcid());
+        Assert.assertEquals(ClaimUtils.DATASET, result.getResultType());
+        Assert.assertEquals("Chocolate Glacier", result.getTitle());
+        Assert.assertEquals("xml", result.getRecordFormat());
+        Assert.assertEquals("http://dx.doi.org/10.5060/D4RN35SD/USGS85K1_041", result.getExternalUrl());
+        Assert.assertNull(result.getEmbargoEndDate());
+
+    }
+
+    @Test
+    public void dataciteJsonResultTest() {
+        Result result = ExternalRecordParser.dataciteJson2Result(dataciteJson);
+
+        Assert.assertNull(result.getAccessRights());
+        Assert.assertNull(result.getBestLicense());
+        Assert.assertEquals("openaire____::datacite", result.getCollectedFrom());
+        Assert.assertEquals("10.5281/ZENODO.54730", result.getDoi());
+        Assert.assertNull(result.getOrcidworkid());
+        Assert.assertNull(result.getOai());
+        Assert.assertNotNull(result.getOpenaireId());//        Assert.assertNull(result.getOpenaireId());
+        Assert.assertNull(result.getPmcid());
+        Assert.assertEquals(ClaimUtils.DATASET, result.getResultType());
+        Assert.assertEquals("From Open Access to Open Science", result.getTitle());
+        Assert.assertEquals("json", result.getRecordFormat());
+        Assert.assertEquals("https://dx.doi.org/10.5281/ZENODO.54730", result.getExternalUrl());
+        Assert.assertNull(result.getEmbargoEndDate());
+
+    }
+}
Index: modules/uoa-claims/claims-demo/uoa-claims-demo.iml
===================================================================
--- modules/uoa-claims/claims-demo/uoa-claims-demo.iml	(nonexistent)
+++ modules/uoa-claims/claims-demo/uoa-claims-demo.iml	(revision 47503)
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:uoa-utils:1.2.2" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-service-utils:1.0.1" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-service-common:1.0.0-hotfix" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-misc-utils:1.0.3" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-rmi-api:2.6.0" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:uoa-api:1.2.1" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:dnet-actionmanager-api:3.1.1" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:uoa-domain:1.3.1" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-blackboard-common:1.0.0" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-notifications-common:1.1.0" level="project" />
+    <orderEntry type="library" name="Maven: junit:junit:4.8.2" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:uoa-utils:1.2.3-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.0.1" level="project" />
+    <orderEntry type="library" name="Maven: org.antlr:antlr-runtime:3.0.1" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-service-utils:1.0.2-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: apache:oro:2.0.8" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:2.7.8" level="project" />
+    <orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
+    <orderEntry type="library" name="Maven: asm:asm:3.3.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-api:2.7.8" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.2.0" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.0.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-javamail_1.4_spec:1.7.1" level="project" />
+    <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-core:2.7.8" level="project" />
+    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.1.13" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:2.7.8" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:2.7.8" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:2.7.8" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:2.7.8" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:2.7.8" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:2.7.8" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.2" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context:4.0.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.0.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-service-common:2.0.0-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: org.antlr:stringtemplate:3.2" level="project" />
+    <orderEntry type="library" name="Maven: org.antlr:antlr:2.7.7" level="project" />
+    <orderEntry type="library" name="Maven: opensymphony:quartz:1.6.6" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-misc-utils:1.0.4-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
+    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.8" level="project" />
+    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
+    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
+    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
+    <orderEntry type="library" name="Maven: saxonica:saxon:9.1.0.8" level="project" />
+    <orderEntry type="library" name="Maven: saxonica:saxon-dom:9.1.0.8" level="project" />
+    <orderEntry type="library" name="Maven: jgrapht:jgrapht:0.7.2" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-rmi-api:2.6.1-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-spring-utils:1.0.1-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
+    <orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.0.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-web:4.0.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.0.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: jparsec:jparsec:2.0" level="project" />
+    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.8.0" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.6" level="project" />
+    <orderEntry type="library" name="Maven: runcc:runcc:0.7" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:uoa-api:1.2.2-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:dnet-actionmanager-api:3.1.2-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:uoa-domain:1.3.2-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:3.5.6-Final" level="project" />
+    <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:3.5.6-Final" level="project" />
+    <orderEntry type="library" name="Maven: antlr:antlr:2.7.6" level="project" />
+    <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.1" level="project" />
+    <orderEntry type="library" name="Maven: javax.transaction:jta:1.1" level="project" />
+    <orderEntry type="library" name="Maven: cglib:cglib:2.2" level="project" />
+    <orderEntry type="library" name="Maven: javassist:javassist:3.9.0.GA" level="project" />
+    <orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.0.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.hibernate:hibernate-annotations:3.5.6-Final" level="project" />
+    <orderEntry type="library" name="Maven: org.hibernate:hibernate-commons-annotations:3.2.0.Final" level="project" />
+    <orderEntry type="library" name="Maven: com.google.gwt:gwt-user:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: javax.validation:validation-api:1.0.0.GA" level="project" />
+    <orderEntry type="library" name="Maven: javax.validation:validation-api:sources:1.0.0.GA" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: com.google.gwt:gwt-servlet:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.ant:ant:1.8.2" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.ant:ant-launcher:1.8.2" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.0.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.0.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-core:4.0.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-tx:4.0.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.9.5" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:1.0" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-blackboard-common:1.0.1-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: eu.dnetlib:cnr-notifications-common:1.1.1-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.0.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: postgresql:postgresql:9.1-901.jdbc4" level="project" />
+    <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.4" level="project" />
+    <orderEntry type="library" name="Maven: javax.mail:mail:1.4" level="project" />
+    <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-test:4.0.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.googlecode.json-simple:json-simple:1.1" level="project" />
+    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
+  </component>
+</module>
\ No newline at end of file
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ExternalRecordHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ExternalRecordHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ExternalRecordHandler.java	(revision 47503)
@@ -0,0 +1,74 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claims.migration.parser.ExternalRecordParser;
+import eu.dnetlib.data.claimsDemo.SearchUtils;
+
+import java.io.IOException;
+
+/**
+ * Created by kiatrop on 8/2/2016.
+ */
+public class ExternalRecordHandler {
+
+    SearchUtils searchUtils;
+    ExternalRecordParser externalRecordParser = null;
+
+    private String fetchCrossrefRecord(String doi) {
+        return searchUtils.getCrossrefJsonRecord(doi);
+    }
+
+    /**
+     * @param id of author - not the full one with work
+     * @return
+     * @throws Exception
+     */
+    private String fetchOrcidRecord(String id) throws Exception {
+        return searchUtils.fetchResultXMLFromOrcid(id);
+
+    }
+
+    private String fetchDataciteRecord(String id) throws Exception {
+        return searchUtils.fetchResultXMLFromDatacite(id);
+
+    }
+
+    public Result fetchResultfromCrossref(String doi) {
+        return externalRecordParser.crossref2Result(fetchCrossrefRecord(doi));
+    }
+
+    public Result fetchResultfromOrcid(String id) throws Exception {
+        Result result = externalRecordParser.orcid2Result(fetchOrcidRecord(id.substring(0, 19)), id);
+
+        return result;
+    }
+
+    public Result fetchResultfromDatacite(String id) throws Exception {
+        return externalRecordParser.dataciteJson2Result(fetchDataciteRecord(id));
+    }
+
+    public SearchUtils getSearchUtils() {
+        return searchUtils;
+    }
+
+    public void setSearchUtils(SearchUtils searchUtils) {
+        this.searchUtils = searchUtils;
+    }
+
+    public ExternalRecordParser getExternalRecordParser() {
+        return externalRecordParser;
+    }
+
+    public void setExternalRecordParser(ExternalRecordParser externalRecordParser) {
+        this.externalRecordParser = externalRecordParser;
+    }
+
+    public static void main(String[] args) throws Exception {
+        ExternalRecordHandler externalRecordHandler = new ExternalRecordHandler();
+        ExternalRecordParser externalRecordParser = new ExternalRecordParser();
+        externalRecordHandler.setExternalRecordParser(externalRecordParser);
+        Result r= externalRecordHandler.fetchResultfromDatacite("10.5281/ZENODO.54730");
+        System.out.println(r.toString());
+    }
+
+}
\ No newline at end of file
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ContextRelationHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ContextRelationHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ContextRelationHandler.java	(revision 47503)
@@ -0,0 +1,104 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import eu.dnetlib.data.claims.migration.entity.ContextRelation;
+import eu.dnetlib.data.claims.migration.parser.DMFParser;
+import eu.dnetlib.data.claimsDemo.QueryGenerator;
+import eu.dnetlib.data.claimsDemo.SQLStoreException;
+import eu.dnetlib.data.claimsDemo.SqlDAO;
+
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by argirok on 10/2/2016.
+ */
+public class ContextRelationHandler {
+
+    QueryGenerator queryGenerator = null;
+    SqlDAO sqlDAO = null;
+    DMFParser dmfParser = null;
+
+    public List<ContextRelation> fetchAllConceptRelations() throws Exception, SQLStoreException {
+        List<ContextRelation> relations = null;
+//          ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateQueryForTesting(-1,"169112"));
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectConceptClaimsEnrichedWithDMFClaimsQuery(-1));
+//        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectConceptClaimsForLattestClaimsQuery(-1));
+
+        relations = new ArrayList<ContextRelation>();
+
+        while(rs.next()) {
+            ContextRelation relation = new ContextRelation();
+            relation.setClaimId(rs.getString("id"));
+            relation.setClaimedBy(rs.getString("agent"));
+            relation.setClaimDate(rs.getDate("date"));
+            String xml = rs.getString("xml");
+            relation.setContextId( dmfParser.getContextIdFromDMF(xml));
+            String resultId = rs.getString("resultid");
+            relation.setResultId(resultId);
+            relation.setContextDmf(xml);
+
+            String dmf=rs.getString("dmf");
+            if(dmf!=null){
+                relation.setResultDmf(dmf);
+                relation.setHasDMF(true);
+                relation.setCollectedFrom(DMFResultHandler.identifyCollectedFrom(resultId));
+
+            }
+
+            relations.add(relation);
+        }
+        return relations;
+    }
+    public List<ContextRelation> fetchConceptRelationById() throws Exception, SQLStoreException {
+        List<ContextRelation> relations = null;
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectConceptClaimByIDEnrichedWithDMFClaimsQuery(-1,"169112"));
+        relations = new ArrayList<ContextRelation>();
+
+        while(rs.next()) {
+            ContextRelation relation = new ContextRelation();
+            relation.setClaimId(rs.getString("id"));
+            relation.setClaimedBy(rs.getString("agent"));
+            relation.setClaimDate(rs.getDate("date"));
+
+            relation.setContextId( dmfParser.getContextIdFromDMF(rs.getString("xml")));
+            relation.setResultId((rs.getString("resultid")));
+            relation.setContextDmf(rs.getString("xml"));
+
+            String dmf=rs.getString("dmf");
+            if(dmf!=null){
+                relation.setResultDmf(dmf);
+                relation.setHasDMF(true);
+                relation.setCollectedFrom(DMFResultHandler.identifyCollectedFrom(rs.getString("resultid")));
+
+            }
+
+            relations.add(relation);
+        }
+        return relations;
+    }
+
+    public QueryGenerator getQueryGenerator() {
+        return queryGenerator;
+    }
+
+    public void setQueryGenerator(QueryGenerator queryGenerator) {
+        this.queryGenerator = queryGenerator;
+    }
+
+    public SqlDAO getSqlDAO() {
+        return sqlDAO;
+    }
+
+    public void setSqlDAO(SqlDAO sqlDAO) {
+        this.sqlDAO = sqlDAO;
+    }
+
+    public DMFParser getDmfParser() {
+        return dmfParser;
+    }
+
+    public void setDmfParser(DMFParser dmfParser) {
+        this.dmfParser = dmfParser;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DirectIndexHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DirectIndexHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DirectIndexHandler.java	(revision 47503)
@@ -0,0 +1,163 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import org.apache.log4j.Logger;
+import org.json.simple.JSONObject;
+import sun.net.www.protocol.http.HttpURLConnection;
+
+import java.io.*;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+
+/**
+ * Created by argirok on 26/4/2017.
+ */
+public class DirectIndexHandler {
+
+    private String directClaimAPIUrl;
+    private static final Logger logger = Logger.getLogger(DirectIndexHandler.class);
+
+
+    public boolean insertRecord(String record){
+
+        return this.feedIndex(record);
+    }
+    public boolean updateRecord(String record){
+
+        return this.feedIndex(record);
+    }
+    public boolean deleteRecord(String originalId, String collectedFromId){
+
+        return this.removeObjectFromIndex(originalId,collectedFromId);
+    }
+
+    private boolean feedIndex(String record) {
+
+        URL obj = null;
+        try {
+            obj = new URL(directClaimAPIUrl+"/feedObject");
+        } catch (MalformedURLException e) {
+            logger.error("Malformed  direct Claim APIUrl" + directClaimAPIUrl,e);
+            return false;
+
+        }
+        HttpURLConnection con = null;
+        try {
+            con = (HttpURLConnection) obj.openConnection();
+
+
+
+            //add request header
+            con.setRequestMethod("POST");
+            //con.setRequestProperty("User-Agent", USER_AGENT);
+            con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
+            con.setRequestProperty("Content-Type", "application/json");
+
+            logger.info("Feeding index with " + record);
+            String urlParameters = record;
+
+            // Send post request
+            con.setDoOutput(true);
+            DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+            BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(wr, "UTF-8"));
+            writer.write(urlParameters);
+            writer.close();
+            wr.close();
+
+            int responseCode = con.getResponseCode();
+            logger.info("\nSending 'POST' request to URL : " + directClaimAPIUrl);
+            logger.info("Post parameters : " + urlParameters);
+            logger.info("Response Code : " + responseCode);
+
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(con.getInputStream()));
+            String inputLine;
+            StringBuffer response = new StringBuffer();
+
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine);
+            }
+            in.close();
+            if(response.toString().equals("true")){
+                return true;
+            }else{
+                logger.error("An error occured. Record isn't saved in the Index.\n"+response.toString());
+                return false;
+            }
+        } catch (IOException e) {
+            logger.error("An error occured while trying to feed object" ,e);
+
+            return false;
+        }
+    }
+    private boolean removeObjectFromIndex(String originalId, String collectedFromId){
+
+        URL obj = null;
+        String urlParameters = "?originalId="+originalId+"&collectedFromId="+collectedFromId;
+
+        try {
+            obj = new URL(directClaimAPIUrl+"/deleteObject"+urlParameters);
+        } catch (MalformedURLException e) {
+            logger.error("Malformed  direct Claim APIUrl" + directClaimAPIUrl,e);
+            return false;
+
+        }
+        HttpURLConnection con = null;
+        try {
+            con = (HttpURLConnection) obj.openConnection();
+
+
+
+            //add request header
+            con.setRequestMethod("POST");
+            //con.setRequestProperty("User-Agent", USER_AGENT);
+            con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
+            con.setRequestProperty("Content-Type", "application/json");
+
+
+            // Send post request
+            con.setDoOutput(true);
+//            DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+//            BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(wr, "UTF-8"));
+//            writer.write(urlParameters);
+//            writer.close();
+//            wr.close();
+
+            int responseCode = con.getResponseCode();
+            logger.info("\nSending 'POST' request to URL : " + directClaimAPIUrl+urlParameters);
+            logger.info("Post parameters : " + urlParameters);
+            logger.info("Response Code : " + responseCode);
+
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(con.getInputStream()));
+            String inputLine;
+            StringBuffer response = new StringBuffer();
+
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine);
+            }
+            in.close();
+
+            //print result
+            logger.info(response.toString());
+            if(response.toString().equals("true")){
+                return true;
+            }else{
+                return false;
+            }
+        } catch (IOException e) {
+            logger.error("An error occured while trying to delete object",e);
+
+            return false;
+        }
+    }
+
+    public String getDirectClaimAPIUrl() {
+        return directClaimAPIUrl;
+    }
+
+    public void setDirectClaimAPIUrl(String directClaimAPIUrl) {
+        this.directClaimAPIUrl = directClaimAPIUrl;
+    }
+}
\ No newline at end of file
Index: modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claimsDemo/egi.xml
===================================================================
--- modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claimsDemo/egi.xml	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claimsDemo/egi.xml	(revision 47503)
@@ -0,0 +1,2475 @@
+<RESOURCE_PROFILE>
+    <HEADER>
+        <RESOURCE_IDENTIFIER value="1284f828-6c12-4905-a9c9-43f143b36e08_Q29udGV4dERTUmVzb3VyY2VzL0NvbnRleHREU1Jlc291cmNlVHlwZQ=="/>
+        <RESOURCE_TYPE value="ContextDSResourceType"/>
+        <RESOURCE_KIND value="ContextDSResources"/>
+        <RESOURCE_URI value=""/>
+        <DATE_OF_CREATION value=""/>
+    </HEADER>
+    <BODY>
+        <CONFIGURATION>
+            <context id="egi" label="EGI" type="community">
+                <category claim="true" id="egi::classification" label="EGI classification scheme">
+                    <concept claim="true" id="egi::classification::natsc" label="Natural Sciences">
+                        <param name="originalID">1</param>
+                        <concept claim="true" id="egi::classification::natsc::math" label="Mathematics">
+                            <param name="originalID">1.1</param>
+                            <concept claim="true" id="egi::classification::natsc::math::applied" label="Applied Mathematics">
+                                <param name="originalID">1.1.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::math::pure" label="Pure Mathematics">
+                                <param name="originalID">1.1.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::math::stats" label="Statistics and Probability">
+                                <param name="originalID">1.1.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::math::other" label="Other">
+                                <param name="originalID">1.1.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::natsc::cosc" label="Computer sciences">
+                            <param name="originalID">1.2</param>
+                            <concept claim="true" id="egi::classification::natsc::cosc::algo" label="Algorithms">
+                                <param name="originalID">1.2.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::artii" label="Artificial Intelligence">
+                                <param name="originalID">1.2.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::carc" label="Computer architecture">
+                                <param name="originalID">1.2.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::ccomm" label="Computer communications">
+                                <param name="originalID">1.2.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::cgraph" label="Computer graphics">
+                                <param name="originalID">1.2.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::csecr" label="Computer security and reliability">
+                                <param name="originalID">1.2.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::dstr" label="Data structures">
+                                <param name="originalID">1.2.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::disc" label="Distributed computing">
+                                <param name="originalID">1.2.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::hci" label="Human-computer interaction">
+                                <param name="originalID">1.2.9</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::opes" label="Operating systems">
+                                <param name="originalID">1.2.10</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::parc" label="Parallel computing">
+                                <param name="originalID">1.2.11</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::plan" label="Programming languages">
+                                <param name="originalID">1.2.12</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::qcom" label="Quantum computing">
+                                <param name="originalID">1.2.13</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::softe" label="software engineering">
+                                <param name="originalID">1.2.14</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::theo" label="Theory of computation">
+                                <param name="originalID">1.2.15</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::cosc::other" label="Other">
+                                <param name="originalID">1.2.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::natsc::infos" label="Information sciences">
+                            <param name="originalID">1.3</param>
+                            <concept claim="true" id="egi::classification::natsc::infos::dman" label="Data management">
+                                <param name="originalID">1.3.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::infos::dmin" label="Data mining">
+                                <param name="originalID">1.3.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::infos::iret" label="Information retrieval">
+                                <param name="originalID">1.3.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::infos::iman" label="Information management">
+                                <param name="originalID">1.3.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::infos::kman" label="Knowledge management">
+                                <param name="originalID">1.3.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::infos::mult" label="Multimedia, hypermedia">
+                                <param name="originalID">1.3.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::infos::other" label="Other">
+                                <param name="originalID">1.3.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::natsc::earths" label="Earth sciences">
+                            <param name="originalID">1.4</param>
+                            <concept claim="true" id="egi::classification::natsc::earths::atms" label="Atmospheric science">
+                                <param name="originalID">1.4.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::clim" label="Climate research">
+                                <param name="originalID">1.4.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::geoc" label="Geochemistry">
+                                <param name="originalID">1.4.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::geol" label="Geology">
+                                <param name="originalID">1.4.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::geop" label="Geophysics">
+                                <param name="originalID">1.4.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::hydr" label="Hydrology">
+                                <param name="originalID">1.4.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::mine" label="Mineralogy">
+                                <param name="originalID">1.4.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::ocea" label="Oceanography">
+                                <param name="originalID">1.4.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::pala" label="palaeontology">
+                                <param name="originalID">1.4.9</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::pgeo" label="Physical geography">
+                                <param name="originalID">1.4.10</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::seis" label="Seismology">
+                                <param name="originalID">1.4.11</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::volc" label="Volcanology">
+                                <param name="originalID">1.4.12</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::earths::other" label="Other">
+                                <param name="originalID">1.4.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::natsc::biosc" label="Biological sciences">
+                            <param name="originalID">1.5</param>
+                            <concept claim="true" id="egi::classification::natsc::biosc::aerob" label="Aerobiology">
+                                <param name="originalID">1.5.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::bact" label="Bacteriology">
+                                <param name="originalID">1.5.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::behav" label="Behavioural biology">
+                                <param name="originalID">1.5.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::bimol" label="Biochemistry and molecular biology">
+                                <param name="originalID">1.5.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::bcons" label="Biodiversity conservation">
+                                <param name="originalID">1.5.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::binfo" label="Bioinformatics">
+                                <param name="originalID">1.5.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::brhy" label="Biological rhythm">
+                                <param name="originalID">1.5.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::biol" label="Biology">
+                                <param name="originalID">1.5.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::bioph" label="Biophysics">
+                                <param name="originalID">1.5.9</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::bota" label="Botany">
+                                <param name="originalID">1.5.10</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::cellb" label="Cell biology">
+                                <param name="originalID">1.5.11</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::cobio" label="Computational biology">
+                                <param name="originalID">1.5.12</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::cryo" label="Cryobiology">
+                                <param name="originalID">1.5.13</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::devb" label="Developmental biology">
+                                <param name="originalID">1.5.14</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::ecol" label="Ecology">
+                                <param name="originalID">1.5.15</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::evolb" label="Evolutionary biology">
+                                <param name="originalID">1.5.16</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::gehe" label="Genetics and heredity">
+                                <param name="originalID">1.5.17</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::marin" label="Marine and Freshwater biology">
+                                <param name="originalID">1.5.18</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::mbio" label="Mathematical biology">
+                                <param name="originalID">1.5.19</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::mibio" label="Microbiology">
+                                <param name="originalID">1.5.20</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::myco" label="Mycology">
+                                <param name="originalID">1.5.21</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::plant" label="Plant science">
+                                <param name="originalID">1.5.22</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::repr" label="Reproductive biology">
+                                <param name="originalID">1.5.23</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::strub" label="Structural biology">
+                                <param name="originalID">1.5.24</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::taxo" label="Taxonomy">
+                                <param name="originalID">1.5.25</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::theob" label="Theoretical biology">
+                                <param name="originalID">1.5.26</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::therm" label="Thermal biology">
+                                <param name="originalID">1.5.27</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::viro" label="Virology">
+                                <param name="originalID">1.5.28</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::zool" label="Zoology">
+                                <param name="originalID">1.5.29</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::biosc::other" label="Other">
+                                <param name="originalID">1.5.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::natsc::physc" label="Physical sciences">
+                            <param name="originalID">1.6</param>
+                            <concept claim="true" id="egi::classification::natsc::physc::acce" label="Acceleration physics">
+                                <param name="originalID">1.6.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::acou" label="Acoustics">
+                                <param name="originalID">1.6.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::aero" label="Aerosol physics">
+                                <param name="originalID">1.6.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::astrb" label="Astrobiology">
+                                <param name="originalID">1.6.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::astrn" label="Astronomy">
+                                <param name="originalID">1.6.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::astrp" label="Astroparticle physics">
+                                <param name="originalID">1.6.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::astrph" label="Astrophysics">
+                                <param name="originalID">1.6.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::atmc" label="Atomic">
+                                <param name="originalID">1.6.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::chph" label="Chemical physics">
+                                <param name="originalID">1.6.9</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::comph" label="Computational physics">
+                                <param name="originalID">1.6.10</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::conds" label="Condensed matter physics">
+                                <param name="originalID">1.6.11</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::cryog" label="Cryogenics">
+                                <param name="originalID">1.6.12</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::fluid" label="Fluid mechanics">
+                                <param name="originalID">1.6.13</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::fusi" label="Fusion">
+                                <param name="originalID">1.6.14</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::hene" label="High energy physics">
+                                <param name="originalID">1.6.15</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::mathp" label="Mathematical physics">
+                                <param name="originalID">1.6.16</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::medip" label="Medical physics">
+                                <param name="originalID">1.6.17</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::molep" label="Molecular physics">
+                                <param name="originalID">1.6.18</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::nuclp" label="Nuclear physics">
+                                <param name="originalID">1.6.19</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::optc" label="Optics">
+                                <param name="originalID">1.6.20</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::partp" label="Particle physics">
+                                <param name="originalID">1.6.21</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::phys" label="Physics">
+                                <param name="originalID">1.6.22</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::plans" label="Planetary science">
+                                <param name="originalID">1.6.23</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::plsm" label="Plasma physics">
+                                <param name="originalID">1.6.24</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::spac" label="Space physics">
+                                <param name="originalID">1.6.25</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::quant" label="Quantum physics">
+                                <param name="originalID">1.6.26</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::physc::other" label="Other">
+                                <param name="originalID">1.6.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::natsc::chesc" label="Chemical sciences">
+                            <param name="originalID">1.7</param>
+                            <concept claim="true" id="egi::classification::natsc::chesc::analc" label="Analytical chemistry">
+                                <param name="originalID">1.7.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::chesc::chem" label="Chemistry">
+                                <param name="originalID">1.7.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::chesc::collc" label="Colloid chemistry">
+                                <param name="originalID">1.7.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::chesc::compc" label="Computational chemistry">
+                                <param name="originalID">1.7.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::chesc::elecc" label="Electrochemistry">
+                                <param name="originalID">1.7.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::chesc::innuc" label="Inorganic and nuclear chemistry">
+                                <param name="originalID">1.7.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::chesc::mathc" label="Mathematical chemistry">
+                                <param name="originalID">1.7.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::chesc::orgc" label="Organic chemistry">
+                                <param name="originalID">1.7.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::chesc::phyc" label="Physical chemistry">
+                                <param name="originalID">1.7.9</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::chesc::polc" label="Polymer chemistry">
+                                <param name="originalID">1.7.10</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::natsc::chesc::other" label="Other">
+                                <param name="originalID">1.7.99</param>
+                            </concept>
+                        </concept>
+                    </concept>
+                    <concept claim="true" id="egi::classification::engt" label="Engineering and Technology">
+                        <param name="originalID">2</param>
+                        <concept claim="true" id="egi::classification::engt::cieng" label="Civil engineering">
+                            <param name="originalID">2.1</param>
+                            <concept claim="true" id="egi::classification::engt::civeng::arche" label="Architecture engineering">
+                                <param name="originalID">2.1.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::civeng::cieng" label="Civil engineering">
+                                <param name="originalID">2.1.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::civeng::cipro" label="Civil protection">
+                                <param name="originalID">2.1.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::civeng::costr" label="Construction/Structural engineering">
+                                <param name="originalID">2.1.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::civeng::treng" label="Transport engineering">
+                                <param name="originalID">2.1.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::civeng::other" label="Other">
+                                <param name="originalID">2.1.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::engt::eeie" label="Electrical, electronic and information engineering">
+                            <param name="originalID">2.2</param>
+                            <concept claim="true" id="egi::classification::engt::eeie::comes" label="Communication engineering and systems">
+                                <param name="originalID">2.2.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::eeie::comha" label="Computer hardware and architecture">
+                                <param name="originalID">2.2.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::eeie::elele" label="Electrical and electronic engineering">
+                                <param name="originalID">2.2.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::eeie::robaut" label="Robotics, Automation and Control Systems">
+                                <param name="originalID">2.2.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::eeie::other" label="Other">
+                                <param name="originalID">2.2.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::engt::meng" label="Mechanical engineering">
+                            <param name="originalID">2.3</param>
+                            <concept claim="true" id="egi::classification::engt::meng::apmec" label="Applied mechanics">
+                                <param name="originalID">2.3.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::meng::audm" label="Audio engineering">
+                                <param name="originalID">2.3.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::meng::nucl" label="Nuclear related engineering">
+                                <param name="originalID">2.3.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::meng::relia" label="Reliability analysis">
+                                <param name="originalID">2.3.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::meng::therd" label="Thermodynamics">
+                                <param name="originalID">2.3.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::meng::other" label="other">
+                                <param name="originalID">2.3.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::engt::aeros" label="Aerospace engineering">
+                            <param name="originalID">2.4</param>
+                            <concept claim="true" id="egi::classification::engt::aeros::aeren" label="Aeronautical engineering">
+                                <param name="originalID">2.4.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::aeros::astren" label="Astronautical engineering">
+                                <param name="originalID">2.4.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::aeros::other" label="Other">
+                                <param name="originalID">2.4.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::engt::cheme" label="Chemical engineering">
+                            <param name="originalID">2.5</param>
+                            <concept claim="true" id="egi::classification::engt::cheme::cheme" label="Chemical engineering">
+                                <param name="originalID">2.5.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::cheme::chempr" label="Chemical process engineering">
+                                <param name="originalID">2.5.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::cheme::other" label="Other">
+                                <param name="originalID">2.5.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::engt::maten" label="Materials engineering">
+                            <param name="originalID">2.6</param>
+                            <concept claim="true" id="egi::classification::engt::maten::ceram" label="Ceramics">
+                                <param name="originalID">2.6.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::maten::coatf" label="Coating and films">
+                                <param name="originalID">2.6.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::maten::compos" label="Composites">
+                                <param name="originalID">2.6.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::maten::paperw" label="Paper and wood">
+                                <param name="originalID">2.6.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::maten::text" label="Textiles">
+                                <param name="originalID">2.6.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::maten::other" label="Other">
+                                <param name="originalID">2.6.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::engt::bioeng" label="Bioengineering and Biomedical engineering">
+                            <param name="originalID">2.7</param>
+                            <concept claim="true" id="egi::classification::engt::bioeng::bioeng" label="Bioengineering">
+                                <param name="originalID">2.7.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::bioeng::biomed" label="Biomedical engineering">
+                                <param name="originalID">2.7.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::bioeng::other" label="Other">
+                                <param name="originalID">2.7.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::engt::enveng" label="Environmental engineering">
+                            <param name="originalID">2.8</param>
+                            <concept claim="true" id="egi::classification::engt::enveng::enfue" label="Energy and fuels">
+                                <param name="originalID">2.8.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::enveng::geoen" label="Geological engineering">
+                                <param name="originalID">2.8.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::enveng::geote" label="Geotechnics">
+                                <param name="originalID">2.8.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::enveng::oceae" label="Ocean engineering">
+                                <param name="originalID">2.8.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::enveng::minep" label="Mining and mineral processing">
+                                <param name="originalID">2.8.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::enveng::petren" label="Petroleum engineering">
+                                <param name="originalID">2.8.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::enveng::remse" label="Remote sensing">
+                                <param name="originalID">2.8.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::enveng::seav" label="Sea vessels">
+                                <param name="originalID">2.8.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::enveng::other" label="Other">
+                                <param name="originalID">2.8.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::engt::envbio" label="Environmental biotechnology">
+                            <param name="originalID">2.9</param>
+                            <concept claim="true" id="egi::classification::engt::envbio::biore" label="Bioremediation">
+                                <param name="originalID">2.9.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::envbio::diabi" label="Diagnostic biotechnologies">
+                                <param name="originalID">2.9.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::envbio::other" label="Other">
+                                <param name="originalID">2.9.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::engt::indbio" label="Industrial  biotechnology">
+                            <param name="originalID">2.10</param>
+                            <concept claim="true" id="egi::classification::engt::indbio::biden" label="Bio-derived novel materials">
+                                <param name="originalID">2.10.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::indbio::bicat" label="Biocatalysis">
+                                <param name="originalID">2.10.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::indbio::bibul" label="Bioderived bulk and fine chemicals">
+                                <param name="originalID">2.10.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::indbio::bifue" label="Biofuels">
+                                <param name="originalID">2.10.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::indbio::bimat" label="Biomaterials">
+                                <param name="originalID">2.10.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::indbio::bipro" label="Bioprocessing technologies">
+                                <param name="originalID">2.10.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::indbio::biprd" label="Bioproducts">
+                                <param name="originalID">2.10.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::indbio::ferm" label="Fermentation">
+                                <param name="originalID">2.10.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::indbio::other" label="Other">
+                                <param name="originalID">2.10.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::engt::nante" label="Nano-technology">
+                            <param name="originalID">2.11</param>
+                            <concept claim="true" id="egi::classification::engt::nante::nanma" label="Nano-materials">
+                                <param name="originalID">2.11.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::nante::nanpr" label="Nano-processes">
+                                <param name="originalID">2.11.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::engt::nante::other" label="Other">
+                                <param name="originalID">2.11.99</param>
+                            </concept>
+                        </concept>
+                    </concept>
+                    <concept claim="true" id="egi::classification::medsc" label="Medical and Health Sciences">
+                        <param name="originalID">3</param>
+                        <concept claim="true" id="egi::classification::medsc::basicm" label="Basic medicine">
+                            <param name="originalID">3.1</param>
+                            <concept claim="true" id="egi::classification::medsc::basicm::anatm" label="Anatomy and morphology">
+                                <param name="originalID">3.1.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::basicm::hugen" label="Human genetics">
+                                <param name="originalID">3.1.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::basicm::immu" label="Immunology">
+                                <param name="originalID">3.1.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::basicm::medch" label="Medicinal chemistry">
+                                <param name="originalID">3.1.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::basicm::neusc" label="Neuroscience">
+                                <param name="originalID">3.1.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::basicm::path" label="Pathology">
+                                <param name="originalID">3.1.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::basicm::pharm" label="Pharmacology and pharmacy">
+                                <param name="originalID">3.1.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::basicm::physi" label="Physiology">
+                                <param name="originalID">3.1.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::basicm::toxi" label="Toxicology">
+                                <param name="originalID">3.1.9</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::basicm::other" label="Other">
+                                <param name="originalID">3.1.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::medsc::clinm" label="Clinical medicine">
+                            <param name="originalID">3.2</param>
+                            <concept claim="true" id="egi::classification::medsc::clinm::alle" label="Allergy">
+                                <param name="originalID">3.2.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::anae" label="Anaesthesiology">
+                                <param name="originalID">3.2.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::andro" label="Andrology">
+                                <param name="originalID">3.2.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::cardi" label="Cardiac and Cardiovascular systems">
+                                <param name="originalID">3.2.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::emerg" label="Critical care/Emergency medicine">
+                                <param name="originalID">3.2.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::dent" label="Dentistry, oral surgery/medicine">
+                                <param name="originalID">3.2.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::derm" label="Dermatology and venereal diseases">
+                                <param name="originalID">3.2.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::gastr" label="Gastroenterology and hepatology">
+                                <param name="originalID">3.2.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::gener" label="General and internal medicine">
+                                <param name="originalID">3.2.9</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::geria" label="Geriatrics and gerontology">
+                                <param name="originalID">3.2.10</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::hema" label="Hematology">
+                                <param name="originalID">3.2.11</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::compl" label="Integrative and Complementary medicine">
+                                <param name="originalID">3.2.12</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::medim" label="Medical imaging">
+                                <param name="originalID">3.2.13</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::nucim" label="Nuclear medicine">
+                                <param name="originalID">3.2.14</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::obstg" label="Obstetrics and gynaecology">
+                                <param name="originalID">3.2.15</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::oncol" label="Oncology">
+                                <param name="originalID">3.2.16</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::ophth" label="Ophthalmology">
+                                <param name="originalID">3.2.17</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::optom" label="Optometry">
+                                <param name="originalID">3.2.18</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::ortho" label="Orthopaedics">
+                                <param name="originalID">3.2.19</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::otori" label="Otorhinolaryngology">
+                                <param name="originalID">3.2.20</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::paedi" label="Paediatrics">
+                                <param name="originalID">3.2.21</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::periph" label="Peripheral vascular disease">
+                                <param name="originalID">3.2.22</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::psych" label="Psychiatry">
+                                <param name="originalID">3.2.23</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::radio" label="Radiology">
+                                <param name="originalID">3.2.24</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::respi" label="Respiratory systems">
+                                <param name="originalID">3.2.25</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::rheum" label="Rheumatology">
+                                <param name="originalID">3.2.26</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::surge" label="Surgery">
+                                <param name="originalID">3.2.27</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::transp" label="Transplantation">
+                                <param name="originalID">3.2.28</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::urol" label="Urology and nephrology">
+                                <param name="originalID">3.2.29</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::clinm::other" label="Other">
+                                <param name="originalID">3.2.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::medsc::healsc" label="Health science">
+                            <param name="originalID">3.3</param>
+                            <concept claim="true" id="egi::classification::medsc::healsc::epide" label="Epidemiology">
+                                <param name="originalID">3.3.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::caresc" label="Health care science and services">
+                                <param name="originalID">3.3.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::policy" label="Health policy and services">
+                                <param name="originalID">3.3.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::infec" label="Infectious diseases">
+                                <param name="originalID">3.3.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::ethic" label="Medical ethics">
+                                <param name="originalID">3.3.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::nurse" label="Nursing">
+                                <param name="originalID">3.3.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::nutri" label="Nutrition and Dietetics">
+                                <param name="originalID">3.3.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::occup" label="Occupational health">
+                                <param name="originalID">3.3.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::paras" label="Parasitology">
+                                <param name="originalID">3.3.9</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::publi" label="Public and environmental health">
+                                <param name="originalID">3.3.10</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::sobio" label="Social biomedical science">
+                                <param name="originalID">3.3.11</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::sport" label="Sport and fitness science">
+                                <param name="originalID">3.3.12</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::subst" label="Substance abuse">
+                                <param name="originalID">3.3.13</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::trop" label="Tropical medicine">
+                                <param name="originalID">3.3.14</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::healsc::other" label="Other">
+                                <param name="originalID">3.3.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::medsc::medbio" label="Medical biotechnology">
+                            <param name="originalID">3.4</param>
+                            <concept claim="true" id="egi::classification::medsc::medbio::bdev" label="Biomedical devices">
+                                <param name="originalID">3.4.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::medbio::hbio" label="Health-related biotechnology">
+                                <param name="originalID">3.4.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::medbio::phbio" label="Pharmaceutical biotechnology">
+                                <param name="originalID">3.4.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::medbio::bioeth" label="Biotechnology and medical ethics">
+                                <param name="originalID">3.4.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::medbio::mdia" label="Molecular diagnostics">
+                                <param name="originalID">3.4.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::medbio::bmani" label="Biophysical manipulation">
+                                <param name="originalID">3.4.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::medsc::medbio::other" label="Other">
+                                <param name="originalID">3.4.99</param>
+                            </concept>
+                        </concept>
+                    </concept>
+                    <concept claim="true" id="egi::classification::agrisc" label="Agricultural Sciences">
+                        <param name="originalID">4</param>
+                        <concept claim="true" id="egi::classification::agrisc::agrfor" label="Agriculture, forestry, and fisheries">
+                            <param name="originalID">4.1</param>
+                            <concept claim="true" id="egi::classification::agrisc::agrfor::agri" label="Agriculture">
+                                <param name="originalID">4.1.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrfor::agrpl" label="Agronomy, plant breeding, plant protection">
+                                <param name="originalID">4.1.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrfor::fish" label="Fishery">
+                                <param name="originalID">4.1.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrfor::fore" label="Forestry">
+                                <param name="originalID">4.1.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrfor::horti" label="Horticulture and viticulture">
+                                <param name="originalID">4.1.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrfor::soil" label="Soil science">
+                                <param name="originalID">4.1.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrfor::other" label="Other">
+                                <param name="originalID">4.1.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::agrisc::anisc" label="Animal and dairy sciences">
+                            <param name="originalID">4.2</param>
+                            <concept claim="true" id="egi::classification::agrisc::anisc::anisc" label="Animal science">
+                                <param name="originalID">4.2.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::anisc::dair" label="Dairy science">
+                                <param name="originalID">4.2.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::anisc::husb" label="Husbandry">
+                                <param name="originalID">4.2.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::anisc::pets" label="Pets">
+                                <param name="originalID">4.2.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::anisc::other" label="Other">
+                                <param name="originalID">4.2.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::agrisc::vetsc" label="Veterinary sciences">
+                            <param name="originalID">4.3</param>
+                            <concept claim="true" id="egi::classification::agrisc::vetsc::vanae" label="Veterinary anaesthesiology">
+                                <param name="originalID">4.3.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::vetsc::vmed" label="Veterinary medicine">
+                                <param name="originalID">4.3.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::vetsc::vophth" label="Veterinary ophtahlmology">
+                                <param name="originalID">4.3.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::vetsc::vpath" label="Veterinary pathobiology">
+                                <param name="originalID">4.3.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::vetsc::vrad" label="Veterinary radiology">
+                                <param name="originalID">4.3.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::vetsc::vrepr" label="Veterinary reproduction">
+                                <param name="originalID">4.3.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::vetsc::vsurg" label="Veterinary surgery">
+                                <param name="originalID">4.3.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::vetsc::other" label="Other">
+                                <param name="originalID">4.3.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::agrisc::agrbio" label="Agricultural biotechnology">
+                            <param name="originalID">4.4</param>
+                            <concept claim="true" id="egi::classification::agrisc::agrbio::bmass" label="Biomass feedstock production tech.">
+                                <param name="originalID">4.4.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrbio::bphar" label="Biopharming">
+                                <param name="originalID">4.4.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrbio::diagn" label="Diagnostics">
+                                <param name="originalID">4.4.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrbio::fbiot" label="Food biotechnology">
+                                <param name="originalID">4.4.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrbio::gmtec" label="GM technology">
+                                <param name="originalID">4.4.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrbio::lclon" label="Livestock cloning">
+                                <param name="originalID">4.4.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrbio::masel" label="Marker assisted selection">
+                                <param name="originalID">4.4.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::agrisc::agrbio::other" label="Other">
+                                <param name="originalID">4.4.99</param>
+                            </concept>
+                        </concept>
+                    </concept>
+                    <concept claim="true" id="egi::classification::sosc" label="Social Sciences">
+                        <param name="originalID">5</param>
+                        <concept claim="true" id="egi::classification::sosc::psych" label="Psychology">
+                            <param name="originalID">5.1</param>
+                            <concept claim="true" id="egi::classification::sosc::psych::biops" label="Biological Psychology">
+                                <param name="originalID">5.1.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::psych::clips" label="Clinical Psychology">
+                                <param name="originalID">5.1.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::psych::cogps" label="Cognitive Psychology">
+                                <param name="originalID">5.1.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::psych::comps" label="Comparative Psychology">
+                                <param name="originalID">5.1.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::psych::devps" label="Developmental Psychology">
+                                <param name="originalID">5.1.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::psych::edups" label="Educational and School Psychology">
+                                <param name="originalID">5.1.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::psych::evops" label="Evolutionary Psychology">
+                                <param name="originalID">5.1.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::psych::indps" label="Industrial-organisational Psychology">
+                                <param name="originalID">5.1.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::psych::persps" label="Personality Psychology">
+                                <param name="originalID">5.1.9</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::psych::posps" label="Positive Psychology">
+                                <param name="originalID">5.1.10</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::psych::socps" label="Social Psychology">
+                                <param name="originalID">5.1.11</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::psych::other" label="Other">
+                                <param name="originalID">5.1.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::sosc::econ" label="Economics, finance and business">
+                            <param name="originalID">5.2</param>
+                            <concept claim="true" id="egi::classification::sosc::econ::busman" label="Business and management">
+                                <param name="originalID">5.2.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::econ::econom" label="Economics and Econometrics">
+                                <param name="originalID">5.2.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::econ::finan" label="Finance">
+                                <param name="originalID">5.2.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::econ::indus" label="Industrial relations">
+                                <param name="originalID">5.2.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::econ::other" label="Other">
+                                <param name="originalID">5.2.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::sosc::edusc" label="Educational sciences">
+                            <param name="originalID">5.3</param>
+                            <concept claim="true" id="egi::classification::sosc::edusc::genedu" label="General Education">
+                                <param name="originalID">5.3.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::edusc::spedu" label="Special Education">
+                                <param name="originalID">5.3.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::edusc::other" label="Other">
+                                <param name="originalID">5.3.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::sosc::socio" label="Sociology">
+                            <param name="originalID">5.4</param>
+                            <concept claim="true" id="egi::classification::sosc::socio::anthro" label="Anthropology">
+                                <param name="originalID">5.4.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::socio::demog" label="Demography">
+                                <param name="originalID">5.4.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::socio::ethno" label="Ethnology">
+                                <param name="originalID">5.4.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::socio::famil" label="Family studies">
+                                <param name="originalID">5.4.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::socio::socst" label="Social studies">
+                                <param name="originalID">5.4.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::socio::sowork" label="Social work">
+                                <param name="originalID">5.4.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::socio::sociol" label="Sociology">
+                                <param name="originalID">5.4.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::socio::women" label="Women's and gender studies">
+                                <param name="originalID">5.4.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::socio::other" label="Other">
+                                <param name="originalID">5.4.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::sosc::law" label="Law">
+                            <param name="originalID">5.5</param>
+                            <concept claim="true" id="egi::classification::sosc::law::canol" label="Canon Law">
+                                <param name="originalID">5.5.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::law::civill" label="Civil Law">
+                                <param name="originalID">5.5.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::law::comparl" label="Comparative Law">
+                                <param name="originalID">5.5.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::law::compel" label="Competition Law">
+                                <param name="originalID">5.5.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::law::constl" label="Constitutional Law">
+                                <param name="originalID">5.5.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::law::crimil" label="Criminal Law">
+                                <param name="originalID">5.5.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::law::islaml" label="Islamic Law">
+                                <param name="originalID">5.5.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::law::jewil" label="Jewish Law">
+                                <param name="originalID">5.5.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::law::juris" label="Jurisprudence">
+                                <param name="originalID">5.5.9</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::law::other" label="Other">
+                                <param name="originalID">5.5.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::sosc::polsc" label="Political Sciences">
+                            <param name="originalID">5.6</param>
+                            <concept claim="true" id="egi::classification::sosc::polsc::compp" label="Comparative Politics">
+                                <param name="originalID">5.6.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::polsc::empir" label="Empirical pata analysis">
+                                <param name="originalID">5.6.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::polsc::intre" label="International relations">
+                                <param name="originalID">5.6.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::polsc::organ" label="Organisational theory">
+                                <param name="originalID">5.6.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::polsc::polec" label="Political economy">
+                                <param name="originalID">5.6.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::polsc::polph" label="Political philosophy">
+                                <param name="originalID">5.6.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::polsc::pubad" label="Public administration">
+                                <param name="originalID">5.6.7</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::polsc::thsta" label="Theories of the state">
+                                <param name="originalID">5.6.8</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::polsc::other" label="Other">
+                                <param name="originalID">5.6.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::sosc::soecge" label="Social and economic geography">
+                            <param name="originalID">5.7</param>
+                            <concept claim="true" id="egi::classification::sosc::soecge::cuecge" label="Cultural and economic geography">
+                                <param name="originalID">5.7.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::soecge::transp" label="Transport planning">
+                                <param name="originalID">5.7.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::soecge::urbst" label="Urban studies">
+                                <param name="originalID">5.7.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::soecge::other" label="Other">
+                                <param name="originalID">5.7.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::sosc::media" label="Media and communications">
+                            <param name="originalID">5.8</param>
+                            <concept claim="true" id="egi::classification::sosc::media::cuecge" label="Information science - social">
+                                <param name="originalID">5.8.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::media::journ" label="Journalism">
+                                <param name="originalID">5.8.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::media::librsc" label="Library science">
+                                <param name="originalID">5.8.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::media::mediasoc" label="Media and socio-cultural communication">
+                                <param name="originalID">5.8.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::sosc::media::other" label="Other">
+                                <param name="originalID">5.8.99</param>
+                            </concept>
+                        </concept>
+                    </concept>
+                    <concept claim="true" id="egi::classification::human" label="Humanities">
+                        <param name="originalID">6</param>
+                        <concept claim="true" id="egi::classification::human::hist" label="History and Archaeology">
+                            <param name="originalID">6.1</param>
+                            <concept claim="true" id="egi::classification::human::hist::archae" label="Archaeology">
+                                <param name="originalID">6.1.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::hist::hist" label="History">
+                                <param name="originalID">6.1.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::hist::other" label="Other">
+                                <param name="originalID">6.1.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::human::lang" label="Languages and literature">
+                            <param name="originalID">6.2</param>
+                            <concept claim="true" id="egi::classification::human::lang::genlang" label="General language studies">
+                                <param name="originalID">6.2.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::lang::genlit" label="General literature studies">
+                                <param name="originalID">6.2.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::lang::ling" label="Linguistics">
+                                <param name="originalID">6.2.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::lang::liter" label="Literary theory">
+                                <param name="originalID">6.2.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::lang::splang" label="Specific languages">
+                                <param name="originalID">6.2.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::lang::split" label="Specific literatures">
+                                <param name="originalID">6.2.6</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::lang::other" label="Other">
+                                <param name="originalID">6.2.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::human::philos" label="Philosophy, ethics and religion">
+                            <param name="originalID">6.3</param>
+                            <concept claim="true" id="egi::classification::human::philos::ethic" label="Ethics">
+                                <param name="originalID">6.3.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::philos::philsc" label="Philosophy of science/technology">
+                                <param name="originalID">6.3.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::philos::philo" label="Philosophy">
+                                <param name="originalID">6.3.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::philos::relig" label="Religious studies">
+                                <param name="originalID">6.3.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::philos::theol" label="Theology">
+                                <param name="originalID">6.3.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::philos::other" label="Other">
+                                <param name="originalID">6.3.99</param>
+                            </concept>
+                        </concept>
+                        <concept claim="true" id="egi::classification::human::arts" label="Arts">
+                            <param name="originalID">6.4</param>
+                            <concept claim="true" id="egi::classification::human::arts::archi" label="Architectural design">
+                                <param name="originalID">6.4.1</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::arts::folk" label="Folklore Studies">
+                                <param name="originalID">6.4.2</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::arts::media" label="Media Studies">
+                                <param name="originalID">6.4.3</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::arts::music" label="Musicology">
+                                <param name="originalID">6.4.4</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::arts::perf" label="Performing arts studies">
+                                <param name="originalID">6.4.5</param>
+                            </concept>
+                            <concept claim="true" id="egi::classification::human::arts::Other" label="Other">
+                                <param name="originalID">6.4.99</param>
+                            </concept>
+                        </concept>
+                    </concept>
+                    <concept claim="true" id="egi::classification::supp" label="Support Activities">
+                        <param name="originalID">7</param>
+                        <concept claim="true" id="egi::classification::supp::digarc" label="Digital Archives">
+                            <param name="originalID">7.1</param>
+                        </concept>
+                        <concept claim="true" id="egi::classification::supp::infra" label="Infrastructure Development">
+                            <param name="originalID">7.2</param>
+                        </concept>
+                        <concept claim="true" id="egi::classification::supp::train" label="Training/Demonstrations">
+                            <param name="originalID">7.3</param>
+                        </concept>
+                        <concept claim="true" id="egi::classification::supp::other" label="Other">
+                            <param name="originalID">7.99</param>
+                        </concept>
+                    </concept>
+                </category>
+                <category claim="false" id="egi::projects" label="EGI Projects">
+                    <concept claim="true" id="egi::projects::biomedbridges" label="BioMedBridges">
+                        <param name="projectfullname"> Building data bridges from biology to medicine in Europe </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">The European Grid Initiative (EGI) is partner in BioMedBridges</param>
+                        <param name="grantid">RI-284209</param>
+                        <param name="url">http://www.biomedbridges.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::biovel" label="BioVel">
+                        <param name="projectfullname"> Biodiversity Virtual e-Laboratory </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">The European Grid Initiative (EGI) is partner in BioVel</param>
+                        <param name="grantid">RI-283359</param>
+                        <param name="url">http://www.biovel.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::chain" label="CHAIN">
+                        <param name="projectfullname">Co-ordination &amp; Harmonisation of Advanced e-INfrastructures</param>
+                        <param name="suggestedAcknowledgment">(Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between CHAIN and EGI-InSPIRE</param>
+                        <param name="grantid">RI-306819</param>
+                        <param name="url">http://www.chain-project.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::dchrp" label="DCH-RP">
+                        <param name="projectfullname"> Digital Cultural Heritage - Roadmap for Preservation </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">The European Grid Initiative (EGI) is partner in DCH-RP</param>
+                        <param name="grantid">RI-312274</param>
+                        <param name="url">http://www.dch-rp.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::decide" label="DECIDE">
+                        <param name="projectfullname"> Diagnostic Enhancement of Confidence by an International Distributed Environment </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between DECIDE and EGI-InSPIRE</param>
+                        <param name="grantid">RI-260011 </param>
+                        <param name="url">https://www.eu-decide.eu</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::drihms" label="DRIHMS">
+                        <param name="projectfullname"> Distributed Research Infrastructure for Hydro-Meteorology Study </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">(rule)</param>
+                        <param name="grantid">RI-246703 </param>
+                        <param name="url">http://www.drihms.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::efiscal" label="e-Fiscal">
+                        <param name="projectfullname"> Financial Study for Sustainable Computing e-Infrastructures </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">The European Grid Initiative (EGI) is partner in e-Fiscal</param>
+                        <param name="grantid">RI-283449</param>
+                        <param name="url">http://efiscal.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::esciencetalk" label="e-ScienceTalk">
+                        <param name="projectfullname"> e-ScienceTalk </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Coordinated by the European Grid Initiative (EGI)</param>
+                        <param name="grantid">260733</param>
+                        <param name="url">http://www.e-sciencetalk.org/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::ige" label="IGE">
+                        <param name="projectfullname"> Initiative for Globus in Europe </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between IGE and EGI</param>
+                        <param name="grantid">RI-261560 </param>
+                        <param name="url">http://www.ige-project.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::enventory" label="e.NVENTORY">
+                        <param name="projectfullname"> European e-Infrastructures Observatory </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between e.NVENTORY and EGI</param>
+                        <param name="grantid">RI-261554 </param>
+                        <param name="url">www.enventory.eu</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::egdi" label="EDGI">
+                        <param name="projectfullname"> European Desktop Grid Initiative </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between EDGI and EGI-Inspire</param>
+                        <param name="grantid">RI-261556 </param>
+                        <param name="url">www.edgi-project.eu</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::egiinspire" label="EGI-InSPIRE">
+                        <param name="projectfullname"> European Desktop Grid Initiative </param>
+                        <param name="suggestedAcknowledgment">The authors acknowledge the use of resources provided by the European Grid Infrastructure. For more information, please reference the EGI-InSPIRE paper (http://go.egi.eu/pdnon).</param>
+                        <param name="rule">Coordinated by the European Grid Initiative (EGI)</param>
+                        <param name="grantid">RI-261323</param>
+                        <param name="url">https://www.egi.eu/about/egi-inspire/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::emi" label="EMI">
+                        <param name="projectfullname"> European Middleware Initiative </param>
+                        <param name="suggestedAcknowledgment">The authors acknowledge the use of resources provided by the European Grid Infrastructure. For more information, please reference the EGI-InSPIRE paper (http://go.egi.eu/pdnon).</param>
+                        <param name="rule">Memorandum of Understanding between EMI and EGI</param>
+                        <param name="grantid">RI-261611</param>
+                        <param name="url">http://www.eu-emi.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::envri" label="ENVRI">
+                        <param name="projectfullname"> Common Operations of Environmental Research Infrastructures </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">The European Grid Initiative (EGI) is partner in ENVRI</param>
+                        <param name="grantid">283465</param>
+                        <param name="url">http://envri.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::erflow" label="ER-Flow">
+                        <param name="projectfullname"> European Research Community through interoperable workflows and data sharing </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">The European Grid Initiative (EGI) is partner in ER-Flow</param>
+                        <param name="grantid">RI-312579</param>
+                        <param name="url">http://www.erflow.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::mantychore" label="MANTYCHORE">
+                        <param name="projectfullname"> Provide infrastructure resources and IP networks as a service </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Informal agreement between MANTYCHORE and EGI</param>
+                        <param name="grantid">261527</param>
+                        <param name="url">http://www.mantychore.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::mapper" label="MAPPER">
+                        <param name="projectfullname"> Multiscale Applications on European e-Infrastructures </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between MAPPER and EGI</param>
+                        <param name="grantid">RI-261507</param>
+                        <param name="url">http://www.mapper-project.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::scalalife" label="SCALALIFE">
+                        <param name="projectfullname"> Scalable Software Services for Life Science </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between MAPPER and EGI-InSpire</param>
+                        <param name="grantid">RI-261523</param>
+                        <param name="url">http://www.scalalife.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::scibus" label="SCI-BUS">
+                        <param name="projectfullname"> SCIentific gateway Based User Support </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between SCI-BUS and EGI</param>
+                        <param name="grantid">RI-283481</param>
+                        <param name="url">http://www.sci-bus.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::shiwa" label="SHIWA">
+                        <param name="projectfullname"> SHaring Interoperable Workflows for large-scale scientific simulations on Available DCIs </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between SHIWA and EGI-Inspire</param>
+                        <param name="grantid">RI-261585</param>
+                        <param name="url">http://www.shiwa-workflow.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::siena" label="SIENA">
+                        <param name="projectfullname"> Standards and Interoperability for e-Infrastructure Implementation Initiative </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between SIENA and EGI-Inspire</param>
+                        <param name="grantid">RI-261575</param>
+                        <param name="url">http://www.sienainitiative.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::stratuslab" label="STRATUSLAB">
+                        <param name="projectfullname"> StratusLab </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between StratusLab and EGI-Inspire</param>
+                        <param name="grantid">RI-261552</param>
+                        <param name="url">http://stratuslab.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::uvasce" label="UVACSE">
+                        <param name="projectfullname"> University of Virginia Alliance for Computational Science and Engineering </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">Memorandum of Understanding between StratusLab and EGI</param>
+                        <param name="grantid"> (grantid) </param>
+                        <param name="url">http://www.uvacse.virginia.edu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::verce" label="VERCE">
+                        <param name="projectfullname"> Virtual Earthquake and seismology Research Community in Europe e-science environment </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule"> (rule) </param>
+                        <param name="grantid"> RI-283543 </param>
+                        <param name="url">http://www.verce.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::wenmr" label="WENMR">
+                        <param name="projectfullname"> A worldwide e-Infrastructure for NMR and structural biology </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule"> Memorandum of Understanding between WENMR and EGI </param>
+                        <param name="grantid"> RI-261572 </param>
+                        <param name="url">http://www.wenmr.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::helixn" label="Helix Nebula">
+                        <param name="projectfullname"> A worldwide e-Infrastructure for NMR and structural biology </param>
+                        <param name="suggestedAcknowledgment"> (Acknowledgement)</param>
+                        <param name="rule">The European Grid Initiative (EGI) is partner in Helix Nebula</param>
+                        <param name="grantid">312301</param>
+                        <param name="url">http://helix-nebula.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::projects::fedsm" label="FedSM">
+                        <param name="projectfullname">Implementing service management in federated e-Infrastructures</param>
+                        <param name="suggestedAcknowledgment">(Acknowledgement)</param>
+                        <param name="rule">The European Grid Initiative (EGI) is partner in FedSM</param>
+                        <param name="grantid">RI-312851</param>
+                        <param name="url">http://www.fedsm.eu/</param>
+                    </concept>
+                </category>
+                <category claim="true" id="egi::country" label="EGI Countries">
+                    <concept claim="true" id="egi::country::ba" label="Bosnia and Herzegovina">
+                        <param name="organisationname">ETFBL</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::be" label="Belgium">
+                        <param name="organisationname">BELNET</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::bg" label="Bulgaria">
+                        <param name="organisationname">IICT-BAS</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::ch" label="Switzerland">
+                        <param name="organisationname">SWiNG</param>
+                        <param name="organisationname">CERN</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::cy" label="Cyprus">
+                        <param name="organisationname">CyGrid</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::cz" label="Czech Republic">
+                        <param name="organisationname">CESNET</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::de" label="Germany">
+                        <param name="organisationname">Gauss-Allianz</param>
+                        <param name="organisationname">EMBL</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::dk" label="Denmark">
+                        <param name="organisationname">DCSC</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::ee" label="Estonia">
+                        <param name="organisationname">EENet</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::es" label="Spain">
+                        <param name="organisationname">CSIC</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::fi" label="Finland">
+                        <param name="organisationname">CSC</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::fr" label="France">
+                        <param name="organisationname">CNRS</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::gr" label="Greece">
+                        <param name="organisationname">GRNET</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::hr" label="Croatia">
+                        <param name="organisationname">SRCE</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::hu" label="Hungary">
+                        <param name="organisationname">NIIF</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::ie" label="Ireland">
+                        <param name="organisationname">Grid-Ireland</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::il" label="Israel">
+                        <param name="organisationname">IUCC</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::it" label="Italy">
+                        <param name="organisationname">INFN</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::lt" label="Lithuania">
+                        <param name="organisationname">VU</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::lu" label="Luxembourg">
+                        <param name="organisationname">RESTENA</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::lv" label="Latvia">
+                        <param name="organisationname">LUMII</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::me" label="Montenegro">
+                        <param name="organisationname">UoM</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::mk" label="Macedonia">
+                        <param name="organisationname">MARGI</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::nl" label="the Netherlands">
+                        <param name="organisationname">NCF</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::nr" label="Norway">
+                        <param name="organisationname">UNINETT Sigma AS</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::pl" label="Poland">
+                        <param name="organisationname">CYFRONET AGH</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::pt" label="Portugal">
+                        <param name="organisationname">UMIC</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::ro" label="Romania">
+                        <param name="organisationname">ICI</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::rs" label="Serbia">
+                        <param name="organisationname">IPB</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::si" label="Slovenia">
+                        <param name="organisationname">ARNES</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::sk" label="Slovakia">
+                        <param name="organisationname">SlovakGrid</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::se" label="Sweden">
+                        <param name="organisationname">SNIC</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::tr" label="Turkey">
+                        <param name="organisationname">ULAKBIM</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::uk" label="United Kingdom">
+                        <param name="organisationname">JISC</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::am" label="ARmenia">
+                        <param name="organisationname">IIAP NAS RA</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::md" label="Moldova">
+                        <param name="organisationname">RENAM</param>
+                    </concept>
+                    <concept claim="true" id="egi::country::ru" label="Russia">
+                        <param name="organisationname">e-ARENA</param>
+                    </concept>
+                </category>
+                <category claim="true" id="egi::organisation" label="National EGI Organisations">
+                    <concept claim="true" id="egi::organisation::etfbl" label="ETFBL">
+                        <param name="country">Bosnia and Herzegovina</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::belnet" label="BELNET">
+                        <param name="country">Belgium</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::iictbas" label="IICT-BAS">
+                        <param name="country">Bulgaria</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::swing" label="SWiNG">
+                        <param name="country">Switzerland</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::cygrid" label="CyGrid">
+                        <param name="country">Cyprus</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::cesnet" label="CESNET">
+                        <param name="country">Czech Republic</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::gaussallianz" label="Gauss-Allianz">
+                        <param name="country">Germany</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::dcsc" label="DCSC">
+                        <param name="country">Denmark</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::eenet" label="EENet">
+                        <param name="country">Estonia</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::csic" label="CSIC">
+                        <param name="country">Spain</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::csc" label="CSC">
+                        <param name="country">Finland</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::cnrs" label="CNRS">
+                        <param name="country">France</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::grnet" label="GRNET">
+                        <param name="country">Greece</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::srce" label="SRCE">
+                        <param name="country">Croatia</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::niif" label="NIIF">
+                        <param name="country">Hungary</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::gridireland" label="Grid-Ireland">
+                        <param name="country">Ireland</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::iucc" label="IUCC">
+                        <param name="country">Israel</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::infn" label="INFN">
+                        <param name="country">Italy</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::vu" label="VU">
+                        <param name="country">Lithuania</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::restena" label="RESTENA">
+                        <param name="country">Luxembourg</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::lumii" label="LUMII">
+                        <param name="country">Latvia</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::uom" label="UoM">
+                        <param name="country">Montenegro</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::margi" label="MARGI">
+                        <param name="country">Macedonia</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::ncf" label="NCF">
+                        <param name="country">the Netherlands</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::uninett" label="UNINETT Sigma AS">
+                        <param name="country">Norway</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::cyfronet" label="CYFRONET AGH">
+                        <param name="country">Poland</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::umic" label="umic">
+                        <param name="country">Portugal</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::ici" label="ICI">
+                        <param name="country">Romania</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::ipb" label="IPB">
+                        <param name="country">Serbia</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::arnes" label="ARNES">
+                        <param name="country">Slovenia</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::slovakgrid" label="SlovakGrid">
+                        <param name="country">Slovakia</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::snic" label="SNIC">
+                        <param name="country">Sweden</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::ulakbim" label="ULAKBIM">
+                        <param name="country">Turkey</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::jisc" label="JISC">
+                        <param name="country">United Kingdom</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::iiapnas" label="IIAP NAS RA">
+                        <param name="country">Armenia</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::renam" label="RENAM">
+                        <param name="country">Moldova</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::earena" label="e-ARENA">
+                        <param name="country">Russia</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::embl" label="EMBL">
+                        <param name="country">Germany</param>
+                    </concept>
+                    <concept claim="true" id="egi::organisation::cern" label="CERN">
+                        <param name="country">Switzerland</param>
+                    </concept>
+                </category>
+                <category claim="true" id="egi::virtual" label="EGI virtual organizations">
+                    <concept claim="true" id="egi::virtual::2352" label="vo.grand-est.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.grand-est.fr/</param>
+                        <param name="homepageUrl">http://www.grand-est.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::41" label="astron">
+                        <param name="enrollmentUrl">http://register.matrix.sara.nl/</param>
+                        <param name="homepageUrl">http://www.astron.nl</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::26" label="theophys">
+                        <param name="enrollmentUrl"/>
+                        <param name="homepageUrl"/>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::504" label="vo.londongrid.ac.uk">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/vo.londongrid.ac.uk/register/start.action</param>
+                        <param name="homepageUrl">https://www.gridpp.ac.uk/wiki/Vo.londongrid.ac.uk</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::78" label="vo.grif.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.grif.fr/</param>
+                        <param name="homepageUrl">http://www.grif.fr/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1670" label="eo-grid.ikd.kiev.ua">
+                        <param name="enrollmentUrl">https://voms.grid.ikd.kiev.ua:8443/voms/eo-grid.ikd.kiev.ua</param>
+                        <param name="homepageUrl">http://inform.ikd.kiev.ua/eo-grid/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2332" label="ops.ndgf.org">
+                        <param name="enrollmentUrl">https://voms.ndgf.org:8443/voms/ops.ndgf.org</param>
+                        <param name="homepageUrl">http://www.ndgf.org/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1430" label="vo.msfg.fr">
+                        <param name="enrollmentUrl">http://www.lupm.univ-montp2.fr/article.php3?id_article=79</param>
+                        <param name="homepageUrl">http://www.lupm.univ-montp2.fr/article.php3?id_article=79</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::40" label="ilc">
+                        <param name="enrollmentUrl">https://grid-voms.desy.de:8443/voms/ilc/</param>
+                        <param name="homepageUrl">http://www-flc.desy.de/flc/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2592" label="gr-sim.grid.auth.gr">
+                        <param name="enrollmentUrl">https://voms.hellasgrid.gr:8443/voms/gr-sim/register/start.action</param>
+                        <param name="homepageUrl">http://www.grid.auth.gr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2172" label="chem.vo.ibergrid.eu">
+                        <param name="enrollmentUrl">https://voms01.ncg.ingrid.pt:8443/voms/chem.vo.ibergrid.eu/register/start.action</param>
+                        <param name="homepageUrl">http://ibergrid.lip.pt/USP</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::311" label="vo.sbg.in2p3.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.sbg.in2p3.fr/</param>
+                        <param name="homepageUrl">http://www.iphc.cnrs.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10273" label="comet.j-parc.jp">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/comet.j-parc.jp/register/start.action</param>
+                        <param name="homepageUrl">http://comet.kek.jp</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10258" label="vo.earthserver.eu">
+                        <param name="enrollmentUrl">https://voms.ct.infn.it:8443/voms/vo.earthserver.eu</param>
+                        <param name="homepageUrl">http://earthserver-sg.consorzio-cometa.it/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10249" label="vo.sn2ns.in2p3.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.sn2ns.in2p3.fr/register/start.action</param>
+                        <param name="homepageUrl">http://irfu.cea.fr/Projets/SN2NS</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::96" label="trgridd">
+                        <param name="enrollmentUrl">https://voms.ulakbim.gov.tr:8443/voms/trgridd/</param>
+                        <param name="homepageUrl">https://voms.ulakbim.gov.tr:8443/voms/trgridd/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::710" label="vo.pic.es">
+                        <param name="enrollmentUrl">https://voms.pic.es:8443/voms/vo.pic.es</param>
+                        <param name="homepageUrl">http://www.pic.es</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::13" label="zeus">
+                        <param name="enrollmentUrl">https://grid-voms.desy.de:8443/voms/zeus</param>
+                        <param name="homepageUrl">http://www-zeus.desy.de/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::106" label="supernemo.vo.eu-egee.org">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/supernemo.vo.eu-egee.org/register/start.action</param>
+                        <param name="homepageUrl">http://nemo.in2p3.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::6" label="biomed">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/biomed</param>
+                        <param name="homepageUrl">http://lsgc.org/en/Biomed:home</param>
+                        <param name="suggestedAcknowledgment"> "Results obtained in this paper were computed on the biomed virtual organization of the European Grid Infrastructure (http://www.egi.eu). We thank the European Grid Infrastructure and its supporting National Grid Initiatives for providing the technical support, computing and storage facilities." (list of publications not up-to-embargoEndDate: http://lsgc.org/en/Biomed:publications) </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::890" label="prod.vo.eu-eela.eu">
+                        <param name="enrollmentUrl">https://voms.grid.unam.mx:8443/voms/prod.vo.eu-eela.eu</param>
+                        <param name="homepageUrl">http://www.e-science.unam.mx/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1030" label="vo.ops.csic.es">
+                        <param name="enrollmentUrl">https://voms.ific.uv.es:8443/voms/vo.ops.csic.es/</param>
+                        <param name="homepageUrl">http://www.grid.csic.es/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::250" label="euindia">
+                        <param name="enrollmentUrl">https://voms2.cnaf.infn.it:8443/voms/euindia/</param>
+                        <param name="homepageUrl">http://www.euindiagrid.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::476" label="vo.northgrid.ac.uk">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/vo.northgrid.ac.uk</param>
+                        <param name="homepageUrl">https://voms.gridpp.ac.uk:8443/voms/vo.northgrid.ac.uk</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10283" label="drihm.eu">
+                        <param name="enrollmentUrl">https://vomsmania.cnaf.infn.it:8443/voms/drihm.eu/</param>
+                        <param name="homepageUrl">http://www.drihm.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2153" label="ict.vo.ibergrid.eu">
+                        <param name="enrollmentUrl">https://voms01.ncg.ingrid.pt:8443/voms/ict.vo.ibergrid.eu/register/start.action</param>
+                        <param name="homepageUrl">http://ibergrid.lip.pt/USP</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10284" label="hyperk.org">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/hyperk.org/register/start.action</param>
+                        <param name="homepageUrl">http://www.hyperk.org</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2312" label="vo.eu-decide.eu">
+                        <param name="enrollmentUrl">http://applications.eu-decide.eu</param>
+                        <param name="homepageUrl">https://voms.ct.infn.it:8443/voms/vo.eu-decide.eu</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1250" label="superbvo.org">
+                        <param name="enrollmentUrl">http://superb.infn.it/how-to-join-us</param>
+                        <param name="homepageUrl">http://superb.infn.it/home</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::494" label="gilda">
+                        <param name="enrollmentUrl">https://voms.ct.infn.it:8443/voms/gilda</param>
+                        <param name="homepageUrl">https://gilda.ct.infn.it</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10252" label="xenon.biggrid.nl">
+                        <param name="enrollmentUrl">https://voms.grid.sara.nl:8443/voms/xenon.biggrid.nl</param>
+                        <param name="homepageUrl">https://wiki.biggrid.nl/wiki/index.php/Xenon</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::130" label="balticgrid">
+                        <param name="enrollmentUrl">https://voms.balticgrid.org:8443/voms/balticgrid/</param>
+                        <param name="homepageUrl">http://www.balticgrid.org</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10265" label="gerda.mpg.de">
+                        <param name="enrollmentUrl">https://vomsmania.cnaf.infn.it:8443/voms/gerda.mpg.de/</param>
+                        <param name="homepageUrl">http://www.mpi-hd.mpg.de/gerda</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::67" label="belle">
+                        <param name="enrollmentUrl">https://voms.cc.kek.jp:8443/voms/belle</param>
+                        <param name="homepageUrl">http://belle2.kek.jp/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2252" label="vo.stratuslab.eu">
+                        <param name="enrollmentUrl">https://voms.grid.auth.gr:8443/voms/vo.stratuslab.eu/register/start.action</param>
+                        <param name="homepageUrl">http://www.stratuslab.eu</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10026" label="camont">
+                        <param name="enrollmentUrl">http://www.hep.phy.cam.ac.uk/~parker/camtology/camont.html</param>
+                        <param name="homepageUrl">http://www.hep.phy.cam.ac.uk/~parker/camtology/camont.html</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10285" label="peachnote.com">
+                        <param name="enrollmentUrl"> https://perun.metacentrum.cz/perun-registrar-cert/?vo=peachnote.com</param>
+                        <param name="homepageUrl">http://www.peachnote.com</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::98" label="ific">
+                        <param name="enrollmentUrl">https://swevo.ific.uv.es:8443/voms/ific</param>
+                        <param name="homepageUrl">http://ific.uv.es</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1190" label="pacs.infn.it">
+                        <param name="enrollmentUrl"/>
+                        <param name="homepageUrl"/>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2192" label="oxgrid.ox.ac.uk">
+                        <param name="enrollmentUrl">http://oxgrid-vom.oerc.ox.ac.uk/cgi-bin/application.pl</param>
+                        <param name="homepageUrl">http://www.oerc.ox.ac.uk/resources/oxgrid</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::810" label="glast.org">
+                        <param name="enrollmentUrl">https://voms2.cnaf.infn.it:8443/voms/glast.org/</param>
+                        <param name="homepageUrl">http://glast.gsfc.nasa.gov/</param>
+                        <param name="suggestedAcknowledgment"> We would like to thank the INFN GRID Data Centers of ..., ..., ..., and ..., ... </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2372" label="demo.vo.edges-grid.eu">
+                        <param name="enrollmentUrl">http://edgi-project.eu/</param>
+                        <param name="homepageUrl">http://edgi-project.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2052" label="vo.dorii.eu">
+                        <param name="enrollmentUrl">https://voms.grid.auth.gr:8443/voms/vo.dorii.eu/</param>
+                        <param name="homepageUrl">http://www.dorii.eu/applications</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1110" label="vo.u-psud.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.u-psud.fr/register/start.action</param>
+                        <param name="homepageUrl">http://www.lri.fr/Demain/?cat=18</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::479" label="vo.cta.in2p3.fr">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/vo.cta.in2p3.fr/register/start.action</param>
+                        <param name="homepageUrl">http://www.mpi-hd.mpg.de/hfm/CTA/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1630" label="hgdemo">
+                        <param name="enrollmentUrl">https://voms.grid.auth.gr:8443/voms/hgdemo</param>
+                        <param name="homepageUrl">http://www.grid.auth.gr/en/services/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::31" label="ngs.ac.uk">
+                        <param name="enrollmentUrl">http://www.ngs.ac.uk/ukca/apply</param>
+                        <param name="homepageUrl">http://www.ngs.ac.uk</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10260" label="mpi-kickstart.egi.eu">
+                        <param name="enrollmentUrl">https://egee.cesnet.cz/mpi/registration/prihlaska_priprav.php</param>
+                        <param name="homepageUrl">https://www.metacentrum.cz/en/VO/MPI/index.html</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1912" label="ops.vo.ibergrid.eu">
+                        <param name="enrollmentUrl">https://voms01.ncg.ingrid.pt:8443/voms/ops.vo.ibergrid.eu/register/start.action</param>
+                        <param name="homepageUrl">http://ibergrid.lip.pt/USP</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::97" label="trgride">
+                        <param name="enrollmentUrl">https://voms.ulakbim.gov.tr:8443/voms/trgride/</param>
+                        <param name="homepageUrl">https://voms.ulakbim.gov.tr:8443/voms/trgride/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2472" label="vo.indicate-project.eu">
+                        <param name="enrollmentUrl">https://voms.ct.infn.it:8443/voms/vo.indicate-project.eu</param>
+                        <param name="homepageUrl">http://indicate-gw.consorzio-cometa.it/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::411" label="vo.lpnhe.in2p3.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.lpnhe.in2p3.fr</param>
+                        <param name="homepageUrl">http://lpnhe.in2p3.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::49" label="planck">
+                        <param name="enrollmentUrl">https://voms.cnaf.infn.it:8443/voms/planck/register/start.action</param>
+                        <param name="homepageUrl">http://www.oats.inaf.it/it/tematiche-ricerca/macroarea-5/265-planck-lfi</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::7" label="egeode">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/egeode/</param>
+                        <param name="homepageUrl">http://www.egeode.org</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2492" label="vo.sim-e-child.org">
+                        <param name="enrollmentUrl">https://voms.gnubila.fr:8443/voms/vo.sim-e-child.org</param>
+                        <param name="homepageUrl">http://sec-portal.maatg.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2212" label="uniandes.edu.co">
+                        <param name="enrollmentUrl">https://caribe.uniandes.edu.co:8443/voms/uniandes.edu.co/register/start.action</param>
+                        <param name="homepageUrl">https://caribe.uniandes.edu.co:8443/voms/uniandes.edu.co/user/home.action</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::910" label="oper.vo.eu-eela.eu">
+                        <param name="enrollmentUrl">https://voms.eela.ufrj.br:8443/voms/oper.vo.eu-eela.eu</param>
+                        <param name="homepageUrl">http://www.eu-eela.eu</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10251" label="vo.france-grilles.fr">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/vo.france-grilles.fr</param>
+                        <param name="homepageUrl">http://www.france-grilles.fr/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::20" label="ncf">
+                        <param name="enrollmentUrl"> https://voms.grid.sara.nl:8443/voms/ncf/admin/home.action</param>
+                        <param name="homepageUrl">https://www.surfsara.nl/systems/grid/new-users</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10268" label="vo.astro.pic.es">
+                        <param name="enrollmentUrl">https://voms01.pic.es:8443/voms/vo.astro.pic.es</param>
+                        <param name="homepageUrl">http://www.cosmo.pic.es</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::570" label="vo.hess-experiment.eu">
+                        <param name="enrollmentUrl">https://cagraidsvr10.cs.tcd.ie:8443/voms/vo.hess-experiment.eu/webui/request/user/create</param>
+                        <param name="homepageUrl">http://www.mpi-hd.mpg.de/hfm/HESS/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1650" label="sgdemo">
+                        <param name="enrollmentUrl">https://voms.grid.auth.gr:8443/voms/sgdemo</param>
+                        <param name="homepageUrl"/>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2152" label="phys.vo.ibergrid.eu">
+                        <param name="enrollmentUrl">https://voms01.ncg.ingrid.pt:8443/voms/phys.vo.ibergrid.eu/register/start.action</param>
+                        <param name="homepageUrl">http://ibergrid.lip.pt/USP</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::22" label="infngrid">
+                        <param name="enrollmentUrl">https://voms.cnaf.infn.it:8443/voms/infngrid/</param>
+                        <param name="homepageUrl">http://grid.infn.it</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::69" label="embrace">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/embrace/register/start.action</param>
+                        <param name="homepageUrl"> http://www.embracegrid.info/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10250" label="bbmri.nl">
+                        <param name="enrollmentUrl">https://voms.grid.sara.nl:8443/voms/bbmri.nl</param>
+                        <param name="homepageUrl">http://www.bbmri.nl</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10083" label="gridit">
+                        <param name="enrollmentUrl">https://voms.cnaf.infn.it:8443/voms/gridit/</param>
+                        <param name="homepageUrl">http://www.italiangrid.org/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10257" label="vo.aginfra.eu">
+                        <param name="enrollmentUrl">https://voms.ipb.ac.rs:8443/voms/vo.aginfra.eu/</param>
+                        <param name="homepageUrl">http://www.aginfra.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2432" label="shiwa-workflow.eu">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/shiwa-workflow.eu/</param>
+                        <param name="homepageUrl">http://www.shiwa-workflow.eu</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10267" label="igi.italiangrid.it">
+                        <param name="enrollmentUrl">https://vomsmania.cnaf.infn.it:8443/voms/igi.italiangrid.it/</param>
+                        <param name="homepageUrl">http://www.italiangrid.it/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1450" label="armgrid.grid.am">
+                        <param name="enrollmentUrl">https://voms.grid.am:8443/voms/armgrid.grid.am/</param>
+                        <param name="homepageUrl">http://www.grid.am</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::104" label="gridcc">
+                        <param name="enrollmentUrl">https://voms.grid.auth.gr:8443/voms/gridcc</param>
+                        <param name="homepageUrl">http://www.gridcc.org/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1510" label="vo.turbo.pic.es">
+                        <param name="enrollmentUrl">https://voms01.pic.es:8443/voms/vo.turbo.pic.es/register/start.action</param>
+                        <param name="homepageUrl">http://www.pic.es</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::37" label="hone">
+                        <param name="enrollmentUrl">https://grid-voms.desy.de:8443/voms/hone/</param>
+                        <param name="homepageUrl">http://www-h1.desy.de/</param>
+                        <param name="suggestedAcknowledgment"> We thank to all partners contributing to the WLCG computing infrastructure for their support for the H1 Collaboration (list of publications: http://www-h1.desy.de/h1/www/publications/H1publication.short_list.html#YEAR2013) </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2176" label="eng.vo.ibergrid.eu">
+                        <param name="enrollmentUrl">https://voms01.ncg.ingrid.pt:8443/voms/eng.vo.ibergrid.eu/register/start.action</param>
+                        <param name="homepageUrl">http://ibergrid.lip.pt/USP</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2174" label="earth.vo.ibergrid.eu">
+                        <param name="enrollmentUrl">https://voms01.ncg.ingrid.pt:8443/voms/earth.vo.ibergrid.eu/register/start.action</param>
+                        <param name="homepageUrl">http://ibergrid.lip.pt/USP</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10287" label="projects.nl">
+                        <param name="enrollmentUrl">https://voms.grid.sara.nl:8443/voms/projects.nl</param>
+                        <param name="homepageUrl">https://e-infra.surfsara.nl/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::107" label="auger">
+                        <param name="enrollmentUrl">https://egee.cesnet.cz/auger/registration/</param>
+                        <param name="homepageUrl">http://www.auger.org</param>
+                        <param name="suggestedAcknowledgment"> no statement defined </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::670" label="vo.lpsc.in2p3.fr">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/vo.mure.in2p3.fr/admin/home.action</param>
+                        <param name="homepageUrl">http://lpsc.in2p3.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::90" label="eela">
+                        <param name="enrollmentUrl">https://voms.lip.pt:8443/voms/eela/webui/request/user/create</param>
+                        <param name="homepageUrl">http://www.eu-eela.org/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::94" label="trgridb">
+                        <param name="enrollmentUrl">https://voms.ulakbim.gov.tr:8443/voms/trgridb/</param>
+                        <param name="homepageUrl">https://voms.ulakbim.gov.tr:8443/voms/trgridb/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::81" label="proactive">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/proactive/register/start.action</param>
+                        <param name="homepageUrl">http://www-sop.inria.fr/oasis/ProActive/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::990" label="desktopgrid.vo.edges-grid.eu">
+                        <param name="enrollmentUrl">http://idgf-sp.eu/</param>
+                        <param name="homepageUrl">http://idgf-sp.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1610" label="vo.delphi.cern.ch">
+                        <param name="enrollmentUrl">https://voms.cern.ch:8443/voms/vo.delphi.cern.ch/register/start.action</param>
+                        <param name="homepageUrl">http://delphiwww.cern.ch/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10262" label="vo.gridcl.fr">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/vo.gridcl.fr/</param>
+                        <param name="homepageUrl">http://www.labex-p2io.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::44" label="ildg">
+                        <param name="enrollmentUrl">https://grid-voms.desy.de:8443/voms/ildg</param>
+                        <param name="homepageUrl">http://plone.jldg.org/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1710" label="bg-edu.grid.acad.bg">
+                        <param name="enrollmentUrl">https://voms.ipp.acad.bg:8443/voms/bg-edu.grid.acad.bg/register/start.action</param>
+                        <param name="homepageUrl">http://www.grid.bas.bg</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::36" label="desy">
+                        <param name="enrollmentUrl">https://grid-voms.desy.de:8443/voms/desy</param>
+                        <param name="homepageUrl">http://grid.desy.de</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::3" label="lhcb">
+                        <param name="enrollmentUrl">https://lcg-voms.cern.ch:8443/vo/lhcb/vomrs</param>
+                        <param name="homepageUrl">http://lhcb.web.cern.ch/lhcb/</param>
+                        <param name="suggestedAcknowledgment"> The Tier1 computing centres are supported by IN2P3 (France), KIT and BMBF (Germany), INFN (Italy), NWO and SURF (The Netherlands), PIC (Spain), GridPP (United Kingdom). We are thankful for the computing resources put at our disposal by Yandex LLC (Russia), as well as to the communities behind the multiple open source software packages that we depend on. </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::5" label="esr">
+                        <param name="enrollmentUrl">https://voms.grid.sara.nl:8443/voms/esr</param>
+                        <param name="homepageUrl">http://www.euearthsciencegrid.org/content/esr-vo-introduction</param>
+                        <param name="suggestedAcknowledgment"> n/a (List of publications http://www.euearthsciencegrid.org/publications) </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::25" label="inaf">
+                        <param name="enrollmentUrl">https://voms.cnaf.infn.it:8443/voms/inaf</param>
+                        <param name="homepageUrl"> http://www.inaf.it</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::970" label="vo.grid.auth.gr">
+                        <param name="enrollmentUrl">https://voms.grid.auth.gr:8443/voms/vo.grid.auth.gr</param>
+                        <param name="homepageUrl">http://www.grid.auth.gr/en/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::89" label="argo">
+                        <param name="enrollmentUrl">https://voms.cnaf.infn.it:8443/voms/argo</param>
+                        <param name="homepageUrl">http://argo.na.infn.it/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::58" label="see">
+                        <param name="enrollmentUrl">https://www.grid.auth.gr/services/voms/SEE/request.php</param>
+                        <param name="homepageUrl">http://www.hellasgrid.gr/about/see-vo/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10282" label="kzvo.isragrid.org.il">
+                        <param name="enrollmentUrl">https://ngi-il-voms3.isragrid.org.il:8443/voms/isravo.isragrid.org.il/</param>
+                        <param name="homepageUrl">https://www.isragrid.org.il/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10271" label="neurogrid.incf.org">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/neurogrid.incf.org/</param>
+                        <param name="homepageUrl">http://www.incf.org</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::150" label="gaussian">
+                        <param name="enrollmentUrl">https://voms.cyf-kr.edu.pl:8443/voms/gaussian</param>
+                        <param name="homepageUrl">http://egee.grid.cyfronet.pl/gaussian</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::62" label="pheno">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/pheno/user/create!input.action</param>
+                        <param name="homepageUrl">http://www.phenogrid.dur.ac.uk/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::39" label="hermes">
+                        <param name="enrollmentUrl">https://grid-voms.desy.de:8443/voms/hermes</param>
+                        <param name="homepageUrl">http://www-hermes.desy.de</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10256" label="mice">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/mice/register/start.action</param>
+                        <param name="homepageUrl">http://www.mice.iit.edu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::77" label="vo.lal.in2p3.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.lal.in2p3.fr/</param>
+                        <param name="homepageUrl">http://www.lal.in2p3.fr/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::15" label="magic">
+                        <param name="enrollmentUrl">https://voms01.pic.es:8443/voms/magic/register/start.action</param>
+                        <param name="homepageUrl">http://magic.mppmu.mpg.de</param>
+                        <param name="suggestedAcknowledgment"> n/a (List of publications http://magic.mppmu.mpg.de/publications/articles/index.html) </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1952" label="vo.neugrid.eu">
+                        <param name="enrollmentUrl">https://voms.gnubila.fr:8443/voms/vo.neugrid.eu</param>
+                        <param name="homepageUrl">http://neugrid.eu</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1933" label="iber.vo.ibergrid.eu">
+                        <param name="enrollmentUrl">https://voms01.ncg.ingrid.pt:8443/voms/iber.vo.ibergrid.eu/register/start.action</param>
+                        <param name="homepageUrl">http://ibergrid.lip.pt/USP</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::473" label="vo.scotgrid.ac.uk">
+                        <param name="enrollmentUrl">http://www.scotgrid.ac.uk/</param>
+                        <param name="homepageUrl">http://www.scotgrid.ac.uk/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::60" label="geant4">
+                        <param name="enrollmentUrl">https://lcg-voms.cern.ch:8443/vo/geant4/vomrs</param>
+                        <param name="homepageUrl">http://geant4.web.cern.ch/geant4/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::79" label="vo.ipno.in2p3.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.ipno.in2p3.fr</param>
+                        <param name="homepageUrl">http://ipnweb.in2p3.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::76" label="apesci">
+                        <param name="enrollmentUrl">https://voms.grid.sinica.edu.tw:8443/voms/apesci/register/start.action</param>
+                        <param name="homepageUrl">http://www.twgrid.org/aproc/services/vom/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::14" label="compchem">
+                        <param name="enrollmentUrl">https://voms.cnaf.infn.it:8443/voms/compchem/</param>
+                        <param name="homepageUrl">https://www3.compchem.unipg.it</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::68" label="ops">
+                        <param name="enrollmentUrl"> https://lcg-voms.cern.ch:8443/vo/ops/vomrs</param>
+                        <param name="homepageUrl">https://wiki.egi.eu/wiki/OPS_vo</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::461" label="vo.agata.org">
+                        <param name="enrollmentUrl">https://www.agata.org/grid/avo</param>
+                        <param name="homepageUrl">http://www.agata.org/grid/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10270" label="na62.vo.gridpp.ac.uk">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/na62.vo.gridpp.ac.uk/</param>
+                        <param name="homepageUrl">http://na62.web.cern.ch/na62/</param>
+                        <param name="suggestedAcknowledgment"> We acknowledge the use of Grid computing resources deployed and operated by (GridPP in the UK) or (the worldwide LHC computing Grid). </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::452" label="seegrid">
+                        <param name="enrollmentUrl">https://voms.irb.hr:8443/voms/seegrid/webui/request/user/create</param>
+                        <param name="homepageUrl">http://www.see-grid.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2552" label="snoplus.snolab.ca">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/snoplus.snolab.ca</param>
+                        <param name="homepageUrl">http://snoplus.phy.queensu.ca/Home.html</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::497" label="vo.irfu.cea.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.irfu.cea.fr</param>
+                        <param name="homepageUrl">http://irfu.cea.fr/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::110" label="gridpp">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/gridpp</param>
+                        <param name="homepageUrl">http://www.gridpp.ac.uk</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10254" label="ukmhd.ac.uk">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/ukmhd.ac.uk/register/start.action</param>
+                        <param name="homepageUrl">http://www.uksolphys.org/information/computing-resources/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::830" label="euasia.euasiagrid.org">
+                        <param name="enrollmentUrl">http://aproc.twgrid.org/index.php?option=com_content&amp;task=view&amp;id=22&amp;Itemid=31</param>
+                        <param name="homepageUrl">http://www.euasiagrid.org/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2392" label="vo.mure.in2p3.fr">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/vo.mure.in2p3.fr</param>
+                        <param name="homepageUrl">http://lpsc.in2p3.fr/gpr/MURE/html/MURE/MURE.html</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::46" label="icecube">
+                        <param name="enrollmentUrl">https://grid-voms.desy.de:8443/voms/icecube/</param>
+                        <param name="homepageUrl">http://www.icecube.wisc.edu/</param>
+                        <param name="suggestedAcknowledgment"> They suggest to name in addtion to DFG (Deutsche Forschungsgemeinschaft) or NSF (National Science Foundation) also EGI resouces/help. </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::85" label="ghep">
+                        <param name="enrollmentUrl">https://grid-voms.desy.de:8443/voms/ghep/register/start.action</param>
+                        <param name="homepageUrl">http://grid.desy.de/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::19" label="pvier">
+                        <param name="enrollmentUrl">https://voms.grid.sara.nl:8443/voms/pvier</param>
+                        <param name="homepageUrl">http://poc.vl-e.nl/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10275" label="neiss.org.uk">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/neiss.org.uk/admin/home.action</param>
+                        <param name="homepageUrl">http://drupals.humanities.manchester.ac.uk/neiss3/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::271" label="eumed">
+                        <param name="enrollmentUrl">https://voms2.cnaf.infn.it:8443/voms/eumed</param>
+                        <param name="homepageUrl">http://www.eumedgrid.eu</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1730" label="moldyngrid">
+                        <param name="enrollmentUrl">http://moldyngrid.org</param>
+                        <param name="homepageUrl">http://moldyngrid.org</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10259" label="israelvo.isragrid.org.il">
+                        <param name="enrollmentUrl">https://ngi-il-voms1.isragrid.org.il:8443/voms/israel</param>
+                        <param name="homepageUrl">http://www.isragrid.org.il</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::75" label="twgrid">
+                        <param name="enrollmentUrl">https://voms.grid.sinica.edu.tw:8443/voms/twgrid/register/start.action</param>
+                        <param name="homepageUrl">http://www.twgrid.org/aproc/services/vom/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::467" label="enmr.eu">
+                        <param name="enrollmentUrl">https://voms2.cnaf.infn.it:8443/voms/enmr.eu/</param>
+                        <param name="homepageUrl">http://www.wenmr.eu</param>
+                        <param name="suggestedAcknowledgment">"The WeNMR project (European FP7 e-Infrastructure grant, contract no. 261572, www.wenmr.eu), supported by the European Grid Initiative (EGI) through the national GRID Initiatives of Belgium, France, Italy, Germany, the Netherlands (via the Dutch BiG Grid project), Portugal, Spain, UK, South Africa, Taiwan and the Latin America GRID infrastructure via the Gisela project is acknowledged for the use of web portals, computing and storage facilities." and the following article describing the WeNMR portals should be cited: Wassenaar et al. (2012). WeNMR: Structural Biology on the Grid.J. Grid. Comp., 10:743-767. (List of publications http://www.wenmr.eu/wenmr/publications-acknowledging-wenmr)</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::950" label="xfel.eu">
+                        <param name="enrollmentUrl">https://grid-voms.desy.de:8443/voms/xfel.eu</param>
+                        <param name="homepageUrl">http://www.xfel.eu</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2" label="alice">
+                        <param name="enrollmentUrl">http://alien2.cern.ch/index.php?option=com_content&amp;view=article&amp;id=17&amp;Itemid=90</param>
+                        <param name="homepageUrl">http://aliceinfo.cern.ch</param>
+                        <param name="suggestedAcknowledgment"> The ALICE collaboration gratefully acknowledges the resources and support provided by all Grid centres and the Worldwide LHC Computing Grid (WLCG) collaboration. </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::64" label="hungrid">
+                        <param name="enrollmentUrl">https://grid11.kfki.hu:8443/voms/hungrid</param>
+                        <param name="homepageUrl">http://grid.kfki.hu/hungrid</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::105" label="euchina">
+                        <param name="enrollmentUrl">https://voms2.cnaf.infn.it:8443/voms/euchina</param>
+                        <param name="homepageUrl">http://www.euchinagrid.org/euchina_vo.html</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1330" label="meteo.see-grid-sci.eu">
+                        <param name="enrollmentUrl">https://voms.grid.auth.gr:8443/voms/meteo.see-grid-sci.eu/register/start.action</param>
+                        <param name="homepageUrl">http://wiki.egee-see.org/index.php/SG_Meteo_VO</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1270" label="vlemed">
+                        <param name="enrollmentUrl">https://voms.grid.sara.nl:8443/voms/vlemed</param>
+                        <param name="homepageUrl">http://www.ebioscience.amc.nl/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::482" label="vo.gear.cern.ch">
+                        <param name="enrollmentUrl"/>
+                        <param name="homepageUrl"/>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2512" label="vo.aleph.cern.ch">
+                        <param name="enrollmentUrl">https://voms-admin.cern.ch:8443/voms/vo.aleph.cern.ch/</param>
+                        <param name="homepageUrl">http://cern.ch/voaleph</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1570" label="vo.complex-systems.eu">
+                        <param name="enrollmentUrl">https://voms.grid.auth.gr:8443/voms/vo.complex-systems.eu/register/start.action</param>
+                        <param name="homepageUrl">http://wiki.grid.auth.gr/wiki/bin/view/ComplexityScienceSSC/VO</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1" label="atlas">
+                        <param name="enrollmentUrl">https://lcg-voms.cern.ch:8443/vo/atlas/vomrs</param>
+                        <param name="homepageUrl">https://www.racf.bnl.gov/docs/howto/grid/joinvo</param>
+                        <param name="suggestedAcknowledgment">The crucial computing support from all WLCG partners is acknowledged gratefully, in particular from CERN and the ATLAS Tier-1 facilities at TRIUMF (Canada), NDGF (Denmark, Norway, Sweden), CCIN2P3 (France), KIT/GridKA (Germany), INFN-CNAF (Italy), NL-T1 (Netherlands), PIC (Spain), ASGC (Taiwan), RAL (UK) and BNL (USA) and in the Tier-2 facilities worldwide. </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::11" label="virgo">
+                        <param name="enrollmentUrl">https://voms.cnaf.infn.it:8443/voms/virgo</param>
+                        <param name="homepageUrl">http://wwwcascina.virgo.infn.it/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::47" label="enea">
+                        <param name="enrollmentUrl">https://voms.cnaf.infn.it:8443/voms/enea/</param>
+                        <param name="homepageUrl">http://www.afs.enea.it/project/eneaegee/VOenea/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::88" label="aegis">
+                        <param name="enrollmentUrl">https://voms.ipb.ac.rs:8443/voms/aegis/</param>
+                        <param name="homepageUrl">http://www.aegis.rs/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::8" label="cdf">
+                        <param name="enrollmentUrl">https://www.opensciencegrid.org/bin/view/VirtualOrganizations/VOInfo/FERMILAB</param>
+                        <param name="homepageUrl">http://www-cdf.fnal.gov/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10276" label="epic.vo.gridpp.ac.uk">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/epic.vo.gridpp.ac.uk/admin/home.action</param>
+                        <param name="homepageUrl">http://www.sruc.ac.uk/epic/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::610" label="vo.southgrid.ac.uk">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/vo.southgrid.ac.uk/</param>
+                        <param name="homepageUrl">http://www.southgrid.ac.uk/VO/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2173" label="life.vo.ibergrid.eu">
+                        <param name="enrollmentUrl">https://voms01.ncg.ingrid.pt:8443/voms/life.vo.ibergrid.eu/register/start.action</param>
+                        <param name="homepageUrl">http://ibergrid.lip.pt/USP</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1050" label="vo.general.csic.es">
+                        <param name="enrollmentUrl">https://voms.ific.uv.es:8443/voms/vo.general.csic.es</param>
+                        <param name="homepageUrl">http://www.grid.csic.es/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1932" label="tut.vo.ibergrid.eu">
+                        <param name="enrollmentUrl">https://voms01.ncg.ingrid.pt:8443/voms/tut.vo.ibergrid.eu/register/start.action</param>
+                        <param name="homepageUrl">http://ibergrid.lip.pt/USP</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10255" label="vo.france-asia.org">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/vo.france-asia.org/register/start.action</param>
+                        <param name="homepageUrl">http://www.france-asia.org</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1150" label="vo.up.pt">
+                        <param name="enrollmentUrl">https://voms.up.pt:8443/voms/vo.up.pt</param>
+                        <param name="homepageUrl">http://voms.up.pt</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1410" label="lattice.itep.ru">
+                        <param name="enrollmentUrl"/>
+                        <param name="homepageUrl">http://www.lattice.itep.ru/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1891" label="belle2.org">
+                        <param name="enrollmentUrl">https://voms.cc.kek.jp:8443/voms/belle2.org</param>
+                        <param name="homepageUrl">http://belle2.kek.jp/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::61" label="auvergrid">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/auvergrid/register/start.action</param>
+                        <param name="homepageUrl">http://www.auvergrid.fr/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::71" label="fusion">
+                        <param name="enrollmentUrl">http://fusion.bifi.unizar.es/?page_id=122</param>
+                        <param name="homepageUrl">http://fusion.bifi.unizar.es/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1810" label="vo.panda.gsi.de">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.panda.gsi.de</param>
+                        <param name="homepageUrl">http://panda-wiki.gsi.de/cgi-bin/view/Computing/PandaGrid</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2292" label="comput-er.it">
+                        <param name="enrollmentUrl">https://voms2.cnaf.infn.it:8443/voms/comput-er.it/</param>
+                        <param name="homepageUrl">http://www.comput-er.it/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::503" label="nordugrid.org">
+                        <param name="enrollmentUrl">https://voms.ndgf.org:8443/voms/nordugrid.org</param>
+                        <param name="homepageUrl">http://www.nordugrid.org/NorduGridVO</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::443" label="gridmosi.ici.ro">
+                        <param name="enrollmentUrl">https://voms.grid.ici.ro:8443/voms/gridmosi.ici.ro/</param>
+                        <param name="homepageUrl">http://www.gridmosi.ro</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::4" label="cms">
+                        <param name="enrollmentUrl">https://lcg-voms.cern.ch:8443/vo/cms/vomrs</param>
+                        <param name="homepageUrl">http://cms.cern.ch/iCMS/</param>
+                        <param name="suggestedAcknowledgment"> We thank the computing centres in the Worldwide LHC computing Grid for the provisioning and excellent performance of computing infrastructure essential to our analyses. </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10263" label="icarus-exp.org">
+                        <param name="enrollmentUrl">https://vomsmania.cnaf.infn.it:8443/voms/icarus-exp.org</param>
+                        <param name="homepageUrl">http://icarus.lngs.infn.it</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::630" label="vo.renabi.fr">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/vo.renabi.fr</param>
+                        <param name="homepageUrl">http://www.renabi.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1770" label="env.see-grid-sci.eu">
+                        <param name="enrollmentUrl">https://voms.ipp.acad.bg:8443/voms/env.see-grid-sci.eu/</param>
+                        <param name="homepageUrl">http://wiki.egee-see.org/index.php/SG_Environmental_VO</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::437" label="vo.apc.univ-paris7.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.apc.univ-paris7.fr/register/start.action</param>
+                        <param name="homepageUrl">http://www.apc.univ-paris7.fr/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::82" label="calice">
+                        <param name="enrollmentUrl">https://grid-voms.desy.de:8443/voms/calice/register/start.action</param>
+                        <param name="homepageUrl">https://twiki.cern.ch/twiki/bin/view/CALICE/</param>
+                        <param name="suggestedAcknowledgment">The support on the computing elements (CE) from all the worldwide GRID, and the support on the storage elements (SE), in particular Germany DESY GRID SE and France Lyon SE, are acknowledged gratefully. (List of publications https://twiki.cern.ch/twiki/bin/view/CALICE/CalicePapers)</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2072" label="vo.metacentrum.cz">
+                        <param name="enrollmentUrl">http://metavo.metacentrum.cz/en/application/index.html</param>
+                        <param name="homepageUrl">http://vo.metacentrum.cz/</param>
+                        <param name="suggestedAcknowledgment">The access to computing and storage facilities owned by parties and projects contributing to the National Grid Infrastructure MetaCentrum, provided under the programme "Projects of Large Infrastructure for Research, Development, and Innovations" (LM2010005) is highly appreciated/acknowledged.</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::391" label="vo.llr.in2p3.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.llr.in2p3.fr</param>
+                        <param name="homepageUrl">http://polywww.in2p3.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10269" label="vo.ingv.it">
+                        <param name="enrollmentUrl">https://vomsmania.cnaf.infn.it:8443/voms/vo.ingv.it/</param>
+                        <param name="homepageUrl">http://vo.ingv.it</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1790" label="ams02.cern.ch">
+                        <param name="enrollmentUrl">http://ams.cern.ch</param>
+                        <param name="homepageUrl">http://ams.cern.ch</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::84" label="dech">
+                        <param name="enrollmentUrl">https://glite-io.scai.fraunhofer.de:8443/voms/dech/</param>
+                        <param name="homepageUrl">https://twiki.cern.ch/twiki/bin/view/EGEE/DECHFirstJobs</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::93" label="trgrida">
+                        <param name="enrollmentUrl">https://voms.ulakbim.gov.tr:8443/voms/trgrida/</param>
+                        <param name="homepageUrl">https://voms.ulakbim.gov.tr:8443/voms/trgrida/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2272" label="envirogrids.vo.eu-egee.org">
+                        <param name="enrollmentUrl">https://lcg-voms.cern.ch:8443/vo/envirogrids.vo.eu-egee.org/vomrs</param>
+                        <param name="homepageUrl">http://www.envirogrids.net/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::16" label="dteam">
+                        <param name="enrollmentUrl">https://voms.hellasgrid.gr:8443/voms/dteam</param>
+                        <param name="homepageUrl">http://wiki.egi.eu/wiki/Dteam_vo</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::92" label="cesga">
+                        <param name="enrollmentUrl">https://voms.egi.cesga.es:8443/voms/cesga/admin/home.action</param>
+                        <param name="homepageUrl">http://www.egee.cesga.es/vo.html</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::446" label="imath.cesga.es">
+                        <param name="enrollmentUrl">i-math.cesga.es</param>
+                        <param name="homepageUrl">i-math.cesga.es</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::65" label="uscms">
+                        <param name="enrollmentUrl"/>
+                        <param name="homepageUrl"/>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::108" label="pamela">
+                        <param name="enrollmentUrl">https://voms.cnaf.infn.it:8443/voms/pamela/register/start.action</param>
+                        <param name="homepageUrl">http://pamela.roma2.infn.it</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::930" label="vo.formation.idgrilles.fr">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/vo.formation.idgrilles.fr</param>
+                        <param name="homepageUrl">http://www.france-grilles.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::790" label="vo.rhone-alpes.idgrilles.fr">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/vo.rhone-alpes.idgrilles.fr</param>
+                        <param name="homepageUrl">http://www.tidra.org</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::730" label="vo.paus.pic.es">
+                        <param name="enrollmentUrl">https://voms.pic.es:8443/voms/vo.paus.pic.es</param>
+                        <param name="homepageUrl">http://www.ice.csic.es/research/PAU/PAU-welcome.html</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10274" label="fedcloud.egi.eu">
+                        <param name="enrollmentUrl">https://perun.metacentrum.cz/perun-registrar-cert/?vo=fedcloud.egi.eu</param>
+                        <param name="homepageUrl">http://www.egi.eu/infrastructure/cloud/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1972" label="vo.lpta.in2p3.fr">
+                        <param name="enrollmentUrl"/>
+                        <param name="homepageUrl"/>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::590" label="d4science.research-infrastructures.eu">
+                        <param name="enrollmentUrl">https://voms.research-infrastructures.eu:8443/voms/d4science.research-infrastructures.eu/</param>
+                        <param name="homepageUrl">http://www.d4science.org</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10278" label="isravo.isragrid.org.il">
+                        <param name="enrollmentUrl">https://ngi-il-voms3.isragrid.org.il:8443/voms/isravo.isragrid.org.il/</param>
+                        <param name="homepageUrl">http://www.isragrid.org.il</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::491" label="cppm">
+                        <param name="enrollmentUrl">https://marvoms.in2p3.fr:8443/voms/cppm/</param>
+                        <param name="homepageUrl">http://marwww.in2p3.fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::440" label="astro.vo.eu-egee.org">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/astro.vo.eu-egee.org/register</param>
+                        <param name="homepageUrl">https://grid12.lal.in2p3.fr:8443/voms/astro.vo.eu-egee.org/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10288" label="km3net.org">
+                        <param name="enrollmentUrl">https://voms02.scope.unina.it:8443/voms/km3net.org/</param>
+                        <param name="homepageUrl">http://www.km3net.org/home.php</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10266" label="ipv6.hepix.org">
+                        <param name="enrollmentUrl">https://voms2.cnaf.infn.it:8443/voms/ipv6.hepix.org/admin/home.action</param>
+                        <param name="homepageUrl">https://voms2.cnaf.infn.it:8443/voms/ipv6.hepix.org/admin/home.action</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1690" label="atlas.ac.il">
+                        <param name="enrollmentUrl">https://voms.hep.tau.ac.il:8443/voms/atlas.ac.il/</param>
+                        <param name="homepageUrl">https://voms.hep.tau.ac.il:8443/voms/atlas.ac.il/</param>
+                        <param name="suggestedAcknowledgment"> The crucial computing support from all WLCG partners is acknowledged gratefully, in particular from CERN and the ATLAS Tier-1 facilities at TRIUMF (Canada), NDGF (Denmark, Norway, Sweden), CCIN2P3 (France), KIT/GridKA (Germany), INFN-CNAF (Italy), NL-T1 (Netherlands), PIC (Spain), ASGC (Taiwan), RAL (UK) and BNL (USA) and in the Tier-2 facilities worldwide" </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1170" label="vo.ipnl.in2p3.fr">
+                        <param name="enrollmentUrl">http://www.ipnl.in2p3.fr/spip.php?article302&amp;lang=fr</param>
+                        <param name="homepageUrl">http://www.ipnl.in2p3.fr/spip.php?article302&amp;lang=fr</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2012" label="bing.vo.ibergrid.eu">
+                        <param name="enrollmentUrl">https://voms01.ncg.ingrid.pt:8443/voms/bing.vo.ibergrid.eu/admin/home.action</param>
+                        <param name="homepageUrl">http://www.brainimaging.pt</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::488" label="vo.lapp.in2p3.fr">
+                        <param name="enrollmentUrl">https://cclcgvomsli01.in2p3.fr:8443/voms/vo.lapp.in2p3.fr</param>
+                        <param name="homepageUrl">http://lapp.in2p3.fr/spip.php?rubrique80</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::66" label="swetest">
+                        <param name="enrollmentUrl">https://swevo.ific.uv.es:8443/voms/swetest/register/start.action</param>
+                        <param name="homepageUrl">http://swevo.ific.uv.es/vo/swetest/vo-swetest.html</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1870" label="vo.mcia.fr">
+                        <param name="enrollmentUrl">https://grid12.lal.in2p3.fr:8443/voms/vo.mcia.fr</param>
+                        <param name="homepageUrl">http://www.mcia.univ-bordeaux.fr/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1892" label="cometa">
+                        <param name="enrollmentUrl">http://www.consorzio-cometa.it/en/accesso</param>
+                        <param name="homepageUrl">http://www.consorzio-cometa.it/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::91" label="edteam">
+                        <param name="enrollmentUrl">https://voms.lip.pt:8443/voms/edteam/webui/request/user/create</param>
+                        <param name="homepageUrl">http://www.eu-eela.org/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10272" label="verce.eu">
+                        <param name="enrollmentUrl">https://verce-voms.scai.fraunhofer.de:8443/voms/verce.eu/</param>
+                        <param name="homepageUrl">http://www.verce.eu</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::251" label="lofar">
+                        <param name="enrollmentUrl">https://voms.grid.sara.nl:8443/voms/lofar/register/start.action</param>
+                        <param name="homepageUrl">http://www.lofar.org</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::458" label="vo.plgrid.pl">
+                        <param name="enrollmentUrl">https://portal.plgrid.pl</param>
+                        <param name="homepageUrl">http://www.plgrid.pl/en</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10261" label="vo.landslides.mossaic.org">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/vo.landslides.mossaic.org/register/start.action</param>
+                        <param name="homepageUrl">http://mossaic.org/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10" label="dzero">
+                        <param name="enrollmentUrl">https://voms.fnal.gov:8443/voms/dzero/register/start.action</param>
+                        <param name="homepageUrl">http://www-d0.fnal.gov/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1390" label="lsgrid">
+                        <param name="enrollmentUrl"> https://voms.grid.sara.nl:8443/voms/lsgrid</param>
+                        <param name="homepageUrl">http://www.sara.nl/project/life-science-grid</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10286" label="cernatschool.org">
+                        <param name="enrollmentUrl">https://www.gridpp.ac.uk/wiki/CERN%40school#Enrollment</param>
+                        <param name="homepageUrl">http://cernatschool.web.cern.ch/content/cernschool-vo</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::17" label="ukqcd">
+                        <param name="enrollmentUrl">https://grid-voms.desy.de:8443/voms/ildg/</param>
+                        <param name="homepageUrl">http://ukqcd.ac.uk/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1310" label="vo.helio-vo.eu">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/vo.helio-vo.eu</param>
+                        <param name="homepageUrl">http://www.helio-vo.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::870" label="fkppl.kisti.re.kr">
+                        <param name="enrollmentUrl"/>
+                        <param name="homepageUrl"/>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2132" label="vo.ifisc.csic.es">
+                        <param name="enrollmentUrl">https://voms.ific.uv.es:8443/voms/vo.ifisc.csic.es</param>
+                        <param name="homepageUrl">https://voms.ific.uv.es:8443/voms/vo.ifisc.csic.es</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10277" label="vo.dch-rp.eu">
+                        <param name="enrollmentUrl">https://voms.ct.infn.it:8443/voms/vo.dch-rp.eu</param>
+                        <param name="homepageUrl">http://www.dch-rp.eu/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10253" label="dream.hipcat.net">
+                        <param name="enrollmentUrl">https://voms.hpcc.ttu.edu:8443/voms/dream/user/home.action</param>
+                        <param name="homepageUrl">http://highenergy.phys.ttu.edu/dream/</param>
+                        <param name="suggestedAcknowledgment"> n/a (list of publications: http://highenergy.phys.ttu.edu/dream/results/publications/publications.html) </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::102" label="nw_ru">
+                        <param name="enrollmentUrl"> https://gt1.pnpi.nw.ru:8443/voms/nw_ru/</param>
+                        <param name="homepageUrl">http://egee.pnpi.nw.ru</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2175" label="social.vo.ibergrid.eu">
+                        <param name="enrollmentUrl">https://voms01.ncg.ingrid.pt:8443/voms/social.vo.ibergrid.eu/register/start.action</param>
+                        <param name="homepageUrl">http://ibergrid.lip.pt/USP</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10281" label="lsst">
+                        <param name="enrollmentUrl">https://voms.fnal.gov:8443/voms/lsst</param>
+                        <param name="homepageUrl">http://www.lsst.org/lsst/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::57" label="voce">
+                        <param name="enrollmentUrl">https://voce-register.farm.particle.cz/voce/</param>
+                        <param name="homepageUrl">http://egee.cesnet.cz/en/voce/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::12" label="vo.sixt.cern.ch">
+                        <param name="enrollmentUrl">http://sixtrack.web.cern.ch/SixTrack/</param>
+                        <param name="homepageUrl">http://sixtrack.web.cern.ch/SixTrack/</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::2112" label="seismo.see-grid-sci.eu">
+                        <param name="enrollmentUrl">https://voms.ulakbim.gov.tr:8443/voms/seismo.see-grid-sci.eu/register/start.action</param>
+                        <param name="homepageUrl">http://wiki.egee-see.org/index.php/SG_Seismology_VO</param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1890" label="vo.cs.br">
+                        <param name="enrollmentUrl"/>
+                        <param name="homepageUrl"/>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::1530" label="t2k.org">
+                        <param name="enrollmentUrl">https://voms.gridpp.ac.uk:8443/voms/t2k.org/register/start.action</param>
+                        <param name="homepageUrl">http://www.t2k.org</param>
+                        <param name="suggestedAcknowledgment"> n/a (list of publications: http://t2k-experiment.org/publications/) </param>
+                    </concept>
+                    <concept claim="true" id="egi::virtual::10264" label="net.egi.eu">
+                        <param name="enrollmentUrl">https://vomsmania.cnaf.infn.it:8443/voms/net.egi.eu/</param>
+                        <param name="homepageUrl">http://net.egi.eu</param>
+                    </concept>
+                </category>
+            </context>
+        </CONFIGURATION>
+        <STATUS/>
+        <SECURITY_PARAMETERS/>
+    </BODY>
+</RESOURCE_PROFILE>
+
Index: modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/DMFParserTest.java
===================================================================
--- modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/DMFParserTest.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/DMFParserTest.java	(revision 47503)
@@ -0,0 +1,110 @@
+package eu.dnetlib.data.claims.migration.parser;
+
+import eu.dnetlib.data.claims.migration.entity.Context;
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claims.migration.handler.DMFContextHandler;
+import org.junit.Assert;
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPathExpressionException;
+import java.io.IOException;
+
+/**
+ * Created by kiatrop on 23/2/2016.
+ */
+public class DMFParserTest {
+
+    private String publicationDmf= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+            "<record xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:prov=\"http://www.openarchives.org/OAI/2.0/provenance\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:dr=\"http://www.driver-repository.eu/namespace/dr\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" +
+            "  <header xmlns=\"http://namespace.openaire.eu/\">\n" +
+            "    <dri:objIdentifier>crossref____::47593e13b24bcdd0f3d5573499f1d3a9</dri:objIdentifier>\n" +
+            "    <dri:recordIdentifier>10.1088/0004-637X/761/1/34</dri:recordIdentifier>\n" +
+            "    <dri:dateOfCollection></dri:dateOfCollection>\n" +
+            "    <dri:mdFormat></dri:mdFormat>\n" +
+            "    <dri:mdFormatInterpretation></dri:mdFormatInterpretation>\n" +
+            "    <dri:repositoryId></dri:repositoryId>\n" +
+            "    <dr:objectIdentifier></dr:objectIdentifier>\n" +
+            "    <dr:dateOfCollection>2014-10-10T14:59:49+00:00</dr:dateOfCollection>\n" +
+            "    <oaf:datasourceprefix>crossref____</oaf:datasourceprefix>\n" +
+            "  </header>\n" +
+            "  <metadata xmlns=\"http://namespace.openaire.eu/\">\n" +
+            "      <dc:dateAccepted>2012-01-01T00:00:00Z</dc:dateAccepted>\n" +
+            "             <dc:identifier>http://stacks.iop.org/0004-637X/761/i=1/a=34?key=crossref.d14dae8ac205453af63561a69c108e13</dc:identifier>\n" +
+            "          <dc:title>A THREE-DIMENSIONAL VIEW OF THE REMNANT OF NOVA PERSEI 1901 (GK Per)</dc:title>\n" +
+            "             <oaf:collectedDatasourceid>openaire____::crossref</oaf:collectedDatasourceid>\n" +
+            "       <oaf:accessrights></oaf:accessrights>\n" +
+            "       <oaf:hostedBy name=\"Unknown Repository\" id=\"openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18\"/>\n" +
+            "    <oaf:collectedFrom name=\"Crossref\" id=\"openaire____::crossref\" />\n" +
+            "          \n" +
+            "     <dc:creator>Liimets, T.</dc:creator>\n" +
+            "     <dc:creator>Corradi, R. L. M.</dc:creator>\n" +
+            "     <dc:creator>Santander-Garc&#237;a, M.</dc:creator>\n" +
+            "     <dc:creator>Villaver, E.</dc:creator>\n" +
+            "     <dc:creator>Rodr&#237;guez-Gil, P.</dc:creator>\n" +
+            "     <dc:creator>Verro, K.</dc:creator>\n" +
+            "     <dc:creator>Kolka, I.</dc:creator>\n" +
+            " \n" +
+            "        <dc:identifier identifierType=\"doi\">10.1088/0004-637X/761/1/34</dc:identifier>\n" +
+            //"        <dr:CobjIdentifier>10.1088/0004-637X/761/1/34</dr:CobjIdentifier>\n" +
+            "       <dc:identifier identifierType=\"orcidworkid\">0000-0002-1112-1292-12694010</dc:identifier>\n" +
+            //"        <dr:CobjIdentifier>0000-0002-1112-1292-12694010</dr:CobjIdentifier>" +
+            "  </metadata>\n" +
+            "</record>";
+
+    @Test
+    public void dmf2PublicationTest() throws IOException, SAXException, ParserConfigurationException {
+        Result result = DMFParser.dmf2Result(publicationDmf);
+
+        Assert.assertNull(result.getAccessRights());
+        Assert.assertNull(result.getBestLicense());
+        Assert.assertEquals("openaire____::crossref", result.getCollectedFrom());
+        Assert.assertEquals("10.1088/0004-637X/761/1/34", result.getDoi());
+        Assert.assertEquals("0000-0002-1112-1292-12694010", result.getOrcidworkid());
+        Assert.assertNull(result.getOai());
+        Assert.assertEquals("crossref____::47593e13b24bcdd0f3d5573499f1d3a9", result.getOpenaireId());
+        Assert.assertNull(result.getPmcid());
+        Assert.assertEquals("A THREE-DIMENSIONAL VIEW OF THE REMNANT OF NOVA PERSEI 1901 (GK Per)", result.getTitle());
+        Assert.assertEquals("xml", result.getRecordFormat());
+        Assert.assertEquals("http://dx.doi.org/10.1088/0004-637X/761/1/34", result.getExternalUrl());
+        Assert.assertNull(result.getEmbargoEndDate());
+
+    }
+
+    private  String contextDmf = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+            "<record xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:prov=\"http://www.openarchives.org/OAI/2.0/provenance\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:dr=\"http://www.driver-repository.eu/namespace/dr\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" +
+            "  <header xmlns=\"http://namespace.openaire.eu/\">\n" +
+            "    <dri:objIdentifier>od______1031::ec6940963d90d1e275970ed2a0ac2508</dri:objIdentifier>\n" +
+            "    <dri:recordIdentifier>od______1031::ec6940963d90d1e275970ed2a0ac2508</dri:recordIdentifier>\n" +
+            "    <dri:dateOfCollection></dri:dateOfCollection>\n" +
+            "    <dri:mdFormat></dri:mdFormat>\n" +
+            "    <dri:mdFormatInterpretation></dri:mdFormatInterpretation>\n" +
+            "    <dri:repositoryId></dri:repositoryId>\n" +
+            "    <dr:objectIdentifier></dr:objectIdentifier>\n" +
+            "    <dr:dateOfCollection>2015-01-22T11:40:51+00:00</dr:dateOfCollection>\n" +
+            "    <oaf:datasourceprefix>openaire____</oaf:datasourceprefix>\n" +
+            "  </header>\n" +
+            "  <metadata xmlns=\"http://namespace.openaire.eu/\">\n" +
+            "                     <oaf:collectedDatasourceid></oaf:collectedDatasourceid>\n" +
+            "          <oaf:hostedBy name=\"\" id=\"\"/>\n" +
+            "    <oaf:collectedFrom name=\"\" id=\"\" />\n" +
+            "          \n" +
+            "     <oaf:concept id=\"egi::country::gr\" />\n" +
+            "\n" +
+            "\n" +
+            "\n" +
+            "  </metadata>\n" +
+            "</record>";
+
+    @Test
+    public void dmf2ContextTest() throws IOException, SAXException, ParserConfigurationException, XPathExpressionException {
+        DMFParser dmfParser= new DMFParser();
+        DMFContextHandler dmfContextHandler = new DMFContextHandler();
+        Context context = dmfContextHandler.extractContextFromDMF(contextDmf);
+
+        Assert.assertEquals("egi::country::gr", context.getOpenaireId());
+        Assert.assertEquals("EGI> EGI Countries> Greece", context.getTitle());
+    }
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ClaimHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ClaimHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ClaimHandler.java	(revision 47503)
@@ -0,0 +1,325 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import eu.dnetlib.data.claims.migration.ClaimValidation;
+import eu.dnetlib.data.claims.migration.ClaimValidationException;
+import eu.dnetlib.data.claims.migration.entity.Claim;
+import eu.dnetlib.data.claims.migration.entity.OpenaireEntity;
+import eu.dnetlib.data.claims.migration.entity.Project;
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import eu.dnetlib.data.claimsDemo.QueryGenerator;
+import eu.dnetlib.data.claimsDemo.SQLStoreException;
+import eu.dnetlib.data.claimsDemo.SqlDAO;
+import org.apache.log4j.Logger;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by kiatrop on 5/2/2016.
+ */
+public class ClaimHandler {
+
+    SqlDAO sqlDAO = null;
+    QueryGenerator queryGenerator = null;
+    ResultHandler resultHandler = null;
+    DMFContextHandler dmfContextHandler = null;
+    ProjectHandler projectHandler = null;
+    ClaimValidation claimValidation = null;
+
+    private static final Logger logger = Logger.getLogger(ClaimHandler.class);
+
+    /**
+     * Saves a list of claims in DB
+     * @param claims
+     */
+    public void saveClaims(List<Claim> claims){
+        for(Claim claim:claims){
+            try {
+                saveClaim(claim);
+            } catch (SQLStoreException e) {
+                logger.error("Claim couldn't be saved : " + claim.getId() + "\n" + claim.toString(), e);
+            } catch (SQLException e) {
+                logger.error("Claim couldn't be saved : " + claim.getId() + "\n" + claim.toString(), e);
+            }
+        }
+    }
+   public String  generateSaveQueryForClaim(Claim claim){
+
+       String query= null;
+       /*if (claim.getSourceType().equals(ClaimUtils.CONTEXT)) {
+           query = queryGenerator.generateInsertClaimContextQuery(resultHandler.generateSaveQueryForResult(((Result)claim.getTarget())),dmfContextHandler.generateSaveQueryForContext ((Context) claim.getSource()), claim);
+       } else if (claim.getSourceType().equals(ClaimUtils.PROJECT)) {
+           query = queryGenerator.generateInsertClaimProjectQuery(resultHandler.generateSaveQueryForResult((Result)claim.getTarget()), projectHandler.generateSaveQueryForProject((Project) claim.getSource()), claim);
+       } else{
+           query = queryGenerator.generateInsertClaimResultQuery(resultHandler.generateSaveQueryForResult((Result)claim.getTarget()), resultHandler.generateSaveQueryForResult((Result) claim.getSource()), claim);
+       }*/
+       query = queryGenerator.generateInsertFullClaimQuery(claim);
+       return query;
+   }
+    /**
+     * saves a claim in DB
+     * @param claim
+     * @throws Exception
+     */
+    //TODO make private - used in Migration
+    public String saveClaim(Claim claim) throws SQLStoreException, SQLException {
+        logger.info("Saving claim...");
+        String id = null;
+        ResultSet rs=sqlDAO.executePreparedQuery(generateSaveQueryForClaim(claim));
+        if(rs.next()) {
+            id = rs.getString(1);
+        }
+        rs.close();
+        return id;
+    }
+
+    /**
+     * Gets the main information for a claim relation - builds a claim object
+     * exports metadata
+     * and saves the claim relations in the DB
+     * @param user
+     * @param sourceType
+     * @param sourceId
+     * @param sourceCollectedFrom
+     * @param targetType
+     * @param targetId
+     * @param targetCollectedFrom
+     * @throws Exception
+     */
+    public String buildAndInsertClaim(String user, String sourceType, String sourceId, String sourceCollectedFrom, String sourceAccessRights, String sourceEmbargoDate, String targetType, String targetId, String targetCollectedFrom, String targetAccessRights, String targetEmbargoDate) throws Exception, SQLStoreException {
+        String id = null;
+
+        claimValidation.validateCollectedFrom(targetCollectedFrom);
+        claimValidation.validateCollectedFrom(sourceCollectedFrom);
+        logger.info("Trying to create a claim {user:"+user+", sourceType:"+sourceType+", sourceId:"+sourceId+", sourceCollectedFrom:"+sourceCollectedFrom+", sourceAccessRights:"+sourceAccessRights
+                +", sourceEmbargoDate:"+sourceEmbargoDate +", targetType:"+targetType +", targetId:"+targetId +", targetCollectedFrom:"+targetCollectedFrom +", targetAccessRights:"+targetAccessRights
+                +", targetEmbargoDate:"+targetEmbargoDate+"}");
+        Claim claim = buildClaim(user,sourceType,sourceId,sourceCollectedFrom, sourceAccessRights, sourceEmbargoDate, targetType, targetId, targetCollectedFrom, targetAccessRights, targetEmbargoDate);
+        if(claimValidation.validateClaim(claim)) {
+            claim = exportMedatataForClaim(claim);
+            id = saveClaim(claim);
+        }else{
+            logger.info("claim is not valid");
+        }
+        return id;
+    }
+
+    /**
+     * Gets the main information of a relation claim and
+     * builds a claim object
+     * @param user
+     * @param sourceType publication, dataset, project, context
+     * @param sourceId openaireId, doi or orcid workid
+     * @param sourceCollectedFrom only for source with type publication, dataset
+     * @param targetType publication, dataset, project, context
+     * @param targetId openaireId, doi or orcid workid
+     * @param targetCollectedFrom only for target with type publication, dataset
+     * @return a claim object
+     * @throws Exception
+     */
+    public Claim buildClaim(String user, String sourceType,String sourceId,String sourceCollectedFrom, String sourceAccessRights, String sourceEmbargoDate, String targetType,String targetId,String targetCollectedFrom, String targetAccessRights, String targetEmbargoDate ) throws Exception {
+        Claim claim = new Claim();
+        claim.setUserMail(user);
+        claim.setDate(new Date());
+        //date
+        claim.setSourceType(sourceType);
+        claim.setTargetType(targetType);
+        claim.setSource(buildOpenaireEntity(sourceId,sourceType,sourceCollectedFrom,sourceAccessRights, sourceEmbargoDate));
+        claim.setTarget(buildOpenaireEntity(targetId,targetType,targetCollectedFrom, targetAccessRights, targetEmbargoDate));
+
+        if (claim.getSource() == null) {
+           throw new ClaimValidationException("The source id is invalid.");
+        }
+
+        if (claim.getTarget() == null) {
+            throw new ClaimValidationException("The target id is invalid.");
+        }
+        //TODO from external sources need an OPenaireID
+        return claim;
+
+    }
+
+    public boolean updateClaimCurationInfo(String curatedBy, String claimId, boolean approved) throws SQLStoreException, SQLException {
+        logger.info("Updating claim curation info...");
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateUpdateClaimCuration(curatedBy, claimId, approved));
+
+        boolean success = false;
+        while (rs.next())
+        {
+            success = true;
+        }
+        rs.close();
+        return success;
+    }
+
+
+    /**
+     * Gets the main information of an openaire entityinfrastruct_::openaire
+     * and returns a full  object
+     * @param id
+     * @param type
+     * @param collectedFrom
+     * @return openaire Entity (Context, Result, Project)
+     * @throws Exception
+     */
+    private OpenaireEntity buildOpenaireEntity(String id, String type, String collectedFrom, String accessRights, String embargoDate) throws Exception {
+        if(type==null){
+            return null;
+        }
+        else if(type.equals(ClaimUtils.CONTEXT)){
+            return DMFContextHandler.fetchContextById(id);
+        }else if (type.equals(ClaimUtils.PROJECT)){
+            Project project = projectHandler.fetchProjectByID(id);
+            if(project == null){
+                logger.error("Project with id:"+id + " couldn't be fetched.");
+            }
+
+            return project;
+        }else if (type.equals(ClaimUtils.PUBLICATION)||type.equals(ClaimUtils.DATASET)){
+            ExternalRecordHandler externalRecordHandler = new ExternalRecordHandler();
+            if(collectedFrom == null){
+                return null;
+            }else if(collectedFrom.equals(ClaimUtils.CROSSREF)){
+
+                Result result = externalRecordHandler.fetchResultfromCrossref(id);
+                if(result == null){
+                    logger.error("Record with id: " + id + " couldn't be fetched from crossref.");
+                }
+
+                result.setAccessRights(accessRights);
+                result.setEmbargoEndDate(embargoDate);
+                return result;
+            }else if (collectedFrom.equals(ClaimUtils.DATACITE)){
+                Result result = externalRecordHandler.fetchResultfromDatacite(id);
+                if(result == null){
+                    logger.error("Record with id:"+id + " couldn't be fetched from datacite.");
+                }else {
+                    result.setAccessRights(accessRights);
+                    result.setEmbargoEndDate(embargoDate);
+                }
+                return result;
+            }else if (collectedFrom.equals(ClaimUtils.ORCID)){
+                Result result = externalRecordHandler.fetchResultfromOrcid(id);
+                if(result == null){
+                    logger.error("Record with id:"+id + " couldn't be fetched from ORCID.");
+                }else {
+                    result.setAccessRights(accessRights);
+                    result.setEmbargoEndDate(embargoDate);
+                }
+                return result;
+            }else if (collectedFrom.equals(ClaimUtils.OPENAIRE)){
+                IndexResultHandler indexResultHandler = new IndexResultHandler();
+                Result result = indexResultHandler.fetchResultById(id);
+                if(result == null){
+                    logger.error("Record with id:"+id + " couldn't be fetched from openaire.");
+                }
+                return result;
+            }
+        }
+        return null;
+    }
+
+
+    /**
+     * Exports the metadata for the source and the target of a claim and sets the proper field
+     * @param claim
+     * @return claim with the proper metadata path of the result of source and target
+     */
+    public Claim exportMedatataForClaim(Claim claim){
+        if(claim.getTargetType().equals(ClaimUtils.DATASET)||claim.getTargetType().equals(ClaimUtils.PUBLICATION)){
+            String path = resultHandler.exportMetadataFileForResult((Result)claim.getTarget());
+            ((Result) claim.getTarget()).setRecordPath(path);
+        }
+        if(claim.getSourceType().equals(ClaimUtils.DATASET)||claim.getSourceType().equals(ClaimUtils.PUBLICATION)){
+            String path = resultHandler.exportMetadataFileForResult((Result)claim.getSource());
+            ((Result) claim.getSource()).setRecordPath(path);
+        }
+        return claim;
+
+    }
+
+    public void deleteClaim(String user, String claimId) throws SQLStoreException, Exception {
+
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectClaimQuery(claimId,user));
+        if(rs.next()) {
+            String sourceType =rs.getString(2);
+            String sourceId =rs.getString(3);
+            String targetType =rs.getString(4);
+            String targetId =rs.getString(5);
+            sqlDAO.executeUpdateQuery(queryGenerator.generateDeleteFullClaimQuery(claimId,user,sourceType,sourceId,targetType,targetId));
+        }else{
+            logger.error("Claim with id : "+ claimId+" user:  "+user+" couldn't be deleted." );
+        }
+        rs.close();
+    }
+
+    public boolean deleteClaim(String claimId) throws Exception, SQLStoreException {
+
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectClaimQuery(claimId));
+        if(rs.next()) {
+            String sourceType =rs.getString(2);
+            String sourceId =rs.getString(3);
+            String targetType =rs.getString(4);
+            String targetId =rs.getString(5);
+            String user =rs.getString(6);
+            sqlDAO.executeUpdateQuery(queryGenerator.generateDeleteFullClaimQuery(claimId,user,sourceType,sourceId,targetType,targetId));
+            rs.close();
+            return  true;
+        }
+        rs.close();
+        logger.error("Couldn't delete claim with id : " + claimId +". It doesn't not exist.");
+        return false;
+
+    }
+
+    public SqlDAO getSqlDAO() {
+        return sqlDAO;
+    }
+
+    public void setSqlDAO(SqlDAO sqlDAO) {
+        this.sqlDAO = sqlDAO;
+    }
+
+    public QueryGenerator getQueryGenerator() {
+        return queryGenerator;
+    }
+
+    public void setQueryGenerator(QueryGenerator queryGenerator) {
+        this.queryGenerator = queryGenerator;
+    }
+
+    public ResultHandler getResultHandler() {
+        return resultHandler;
+    }
+
+    public void setResultHandler(ResultHandler resultHandler) {
+        this.resultHandler = resultHandler;
+    }
+
+    public DMFContextHandler getDmfContextHandler() {
+        return dmfContextHandler;
+    }
+
+    public void setDmfContextHandler(DMFContextHandler dmfContextHandler) {
+        this.dmfContextHandler = dmfContextHandler;
+    }
+
+    public ProjectHandler getProjectHandler() {
+        return projectHandler;
+    }
+
+    public void setProjectHandler(ProjectHandler projectHandler) {
+        this.projectHandler = projectHandler;
+    }
+
+    public ClaimValidation getClaimValidation() {
+        return claimValidation;
+    }
+
+    public void setClaimValidation(ClaimValidation claimValidation) {
+        this.claimValidation = claimValidation;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DMFResultHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DMFResultHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DMFResultHandler.java	(revision 47503)
@@ -0,0 +1,160 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claims.migration.parser.DMFParser;
+import eu.dnetlib.data.claimsDemo.*;
+import org.apache.log4j.Logger;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPathExpressionException;
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.util.Date;
+
+/**
+ * Created by kiatrop on 5/2/2016.
+ */
+public class DMFResultHandler {
+    private static final Logger logger = Logger.getLogger(DMFResultHandler.class);
+
+    SqlDAO sqlDAO = null;
+    QueryGenerator queryGenerator = null;
+    DMFParser dmfParser = null;
+
+    /**
+     * Given an openaire id decides the datasource that the result was collected from
+     * Default datasource  is openaire
+     * @param openaireId
+     * @return  collectedFrom datasource
+     */
+    public static String identifyCollectedFrom(String openaireId){
+        if(openaireId==null){
+            return null;
+        }
+        if(openaireId.contains("crossref")){
+            return ClaimUtils.COLLECTED_FROM_CROSSREF;
+        }else if (openaireId.contains("datacite")){
+            return ClaimUtils.COLLECTED_FROM_DATACITE;
+        } else if (openaireId.contains("orcid")){
+            return ClaimUtils.COLLECTED_FROM_ORCID;
+        }else{
+            return ClaimUtils.COLLECTED_FROM_OPENAIRE;
+        }
+
+    }
+
+    private String fetchDMFResult(String id) throws SQLStoreException, SQLException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectDMFByIdQuery(id));
+        return rs.getString("xml");
+    }
+
+    public Result fetchResultByDMF(String dmf) throws IOException, SAXException, ParserConfigurationException {
+        return dmfParser.dmf2Result(dmf);
+    }
+
+    public Result fetchResultById(String id) throws SQLStoreException, SQLException, ParserConfigurationException, SAXException, IOException {
+        //TODO check
+       return  fetchResultByDMF(fetchDMFResult(id));
+//        return ParsingClaimUtils.getResultFromDMF(fetchDMFResult(id));
+    }
+
+    /**
+     *
+     * @param dmf
+     * @return DOI from DMF - a *valid* one
+     * @throws IOException
+     * @throws SAXException
+     * @throws ParserConfigurationException
+     * @throws XPathExpressionException
+     */
+    public String fetchDoiByDMF(String dmf) throws IOException, SAXException, ParserConfigurationException, XPathExpressionException {
+
+        return checkDoiValidity(dmfParser.getDOIIdentifierFromDMF(dmf));
+    }
+    public String fetchOrcidWorkByDMF(String dmf) throws IOException, SAXException, ParserConfigurationException, XPathExpressionException {
+        return dmfParser.getOrcidworkIdentifierFromDMF(dmf);
+    }
+    public String fetchEmbargoEndDateByDMF(String dmf) throws IOException, SAXException, ParserConfigurationException, XPathExpressionException {
+        return dmfParser.getEmbargoEndDateFromDMF(dmf);
+    }
+    public String fetchAccessRights(String dmf) throws IOException, SAXException, ParserConfigurationException, XPathExpressionException {
+        return dmfParser.getAccessRightsFromDMF(dmf);
+    }
+
+    /**
+     *
+     *
+     * @param doi
+     * @return DOI String : the given one if it's valid
+     * @throws Exception
+     */
+    public static String checkDoiValidity(String doi)  {
+        if(doi==null){
+            return null;
+        }
+        String newDoi = doi;
+        try{
+            PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("invalid_dois.txt", true)));
+            boolean isValid= SearchUtils.isDoiValid(doi);
+            if(!isValid&&(doi.length() - (doi.replace("_", "")).length() > 1)){
+                String transformDoi = doi.replace("_", "-");
+                isValid=SearchUtils.isDoiValid(transformDoi);
+                if(isValid){
+                    Date date= new java.util.Date();
+                    out.println(new Timestamp(date.getTime())+" - Invalid doi: "+doi+" replaced with : "+transformDoi);
+                    newDoi=transformDoi;
+                }
+            }else if(!isValid&&(doi.length() - (doi.replace("_", "")).length() == 1)) {
+                String transformDoi = doi.replace("_", "-");
+                isValid=SearchUtils.isDoiValid(transformDoi);
+                if(isValid){
+                    Date date= new java.util.Date();
+                    out.println(new Timestamp(date.getTime())+" - Invalid doi: "+doi+" replaced with : "+transformDoi);
+                    newDoi = transformDoi;
+                }
+            }else if(!isValid) {
+                String transformDoi =doi.replaceAll("\\p{C}", "");
+                isValid=SearchUtils.isDoiValid(transformDoi);
+                if(isValid){
+                    Date date= new java.util.Date();
+                    out.println(new Timestamp(date.getTime())+" - Invalid doi: "+doi+" replaced with (zero-width-char): "+transformDoi);
+                    newDoi = transformDoi;
+                }
+            }
+            out.close();
+        }catch (IOException e) {
+            logger.error("Couldn't write to file " + "invalid_dois.txt",e);
+        }
+        return newDoi;
+    }
+
+    public SqlDAO getSqlDAO() {
+        return sqlDAO;
+    }
+
+    public void setSqlDAO(SqlDAO sqlDAO) {
+        this.sqlDAO = sqlDAO;
+    }
+
+    public QueryGenerator getQueryGenerator() {
+        return queryGenerator;
+    }
+
+    public void setQueryGenerator(QueryGenerator queryGenerator) {
+        this.queryGenerator = queryGenerator;
+    }
+
+    public DMFParser getDmfParser() {
+        return dmfParser;
+    }
+
+    public void setDmfParser(DMFParser dmfParser) {
+        this.dmfParser = dmfParser;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DMFContextHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DMFContextHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/DMFContextHandler.java	(revision 47503)
@@ -0,0 +1,93 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import eu.dnetlib.data.claims.migration.entity.Context;
+import eu.dnetlib.data.claims.migration.parser.DMFParser;
+import eu.dnetlib.data.claimsDemo.ContextUtils;
+import eu.dnetlib.data.claimsDemo.QueryGenerator;
+import eu.dnetlib.data.claimsDemo.SQLStoreException;
+import eu.dnetlib.data.claimsDemo.SqlDAO;
+import org.apache.log4j.Logger;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPathExpressionException;
+import java.io.IOException;
+import java.sql.ResultSet;
+
+/**
+ * Created by kiatrop on 5/2/2016.
+ */
+public class DMFContextHandler {
+    private static Logger log = Logger.getLogger(DMFContextHandler.class );
+
+    SqlDAO sqlDAO = null;
+    QueryGenerator queryGenerator = null;
+    DMFParser dmfParser = null;
+
+    private String fetchAllDMFContext(String id) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectConceptDMFClaimsQuery(-1));
+        return rs.getString("xml");
+    }
+
+    private String fetchDMFContext(String id) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectConceptClaimByIdQuery(id));
+        return rs.getString("xml");
+    }
+
+    public Context extractContextFromDMF(String xml) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException {
+        return fetchContextById(dmfParser.getContextIdFromDMF(xml));
+    }
+
+    public Context fetchContextByIdFromDmf(String id) throws Exception, SQLStoreException {
+        return extractContextFromDMF(fetchDMFContext(id));
+    }
+
+    public static Context fetchContextById(String openaireId) {
+        Context context = new Context();
+        if(openaireId == null ){
+            return null;
+        }
+        context.setOpenaireId(openaireId);
+        try {
+            context.setTitle(ContextUtils.extractEgiLabel(context.getOpenaireId()));
+
+        } catch (Exception e) {
+            log.error("ContextUtils: Couldn't get Egi label for id " + context.getOpenaireId(),e);
+        }
+        return context;
+
+    }
+/*    public String generateSaveQueryForContext(Context context){
+
+        return queryGenerator.generateInsertContextQuery(context.getOpenaireId(),context.getTitle());
+    }
+
+    public void saveContext(Context context) throws Exception {
+
+        sqlDAO.executePreparedQuery(generateSaveQueryForContext(context));
+    }*/
+
+    public SqlDAO getSqlDAO() {
+        return sqlDAO;
+    }
+
+    public void setSqlDAO(SqlDAO sqlDAO) {
+        this.sqlDAO = sqlDAO;
+    }
+
+    public QueryGenerator getQueryGenerator() {
+        return queryGenerator;
+    }
+
+    public void setQueryGenerator(QueryGenerator queryGenerator) {
+        this.queryGenerator = queryGenerator;
+    }
+
+    public DMFParser getDmfParser() {
+        return dmfParser;
+    }
+
+    public void setDmfParser(DMFParser dmfParser) {
+        this.dmfParser = dmfParser;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/RelationHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/RelationHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/RelationHandler.java	(revision 47503)
@@ -0,0 +1,96 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import eu.dnetlib.data.claims.migration.entity.Relation;
+import eu.dnetlib.data.claims.migration.parser.RelationParser;
+import eu.dnetlib.data.claimsDemo.QueryGenerator;
+import eu.dnetlib.data.claimsDemo.SQLStoreException;
+import eu.dnetlib.data.claimsDemo.SqlDAO;
+
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by kiatrop on 5/2/2016.
+ */
+public class RelationHandler {
+
+    SqlDAO sqlDAO = null;
+    QueryGenerator queryGenerator = null;
+    RelationParser relationParser = null;
+
+    public List<Relation> fetchAllRelations() throws Exception, SQLStoreException {
+        List<Relation> relations = null;
+
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectRelationEnrichedWithDMFClaimsQuery(-1));
+//        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectRelationClaimsQueryForLattestClaims(-1));
+//        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectRelationClaimByIDEnrichedWithDMFClaimsQuery(-1,"169590"));
+        relations = new ArrayList<Relation>();
+
+        while(rs.next()) {
+            Relation relation = relationParser.xml2Relation(rs.getString("xml"));
+
+            relation.setClaimId(rs.getString("id"));
+            relation.setClaimedBy(rs.getString("agent"));
+            relation.setClaimDate(rs.getDate("date"));
+            String dmf=rs.getString("dmf");
+            if(dmf!=null){
+                relation.setDmf(dmf);
+                relation.setHasDMF(true);
+                relation.setCollectedFrom(DMFResultHandler.identifyCollectedFrom(rs.getString("resultid")));
+
+            }
+
+            relations.add(relation);
+        }
+
+        return relations;
+    }
+    public List<Relation> fetchRelationbyID() throws Exception, SQLStoreException {
+        List<Relation> relations = null;
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectRelationClaimByIDEnrichedWithDMFClaimsQuery(-1,"169149"));
+         relations = new ArrayList<Relation>();
+
+        while(rs.next()) {
+            Relation relation = relationParser.xml2Relation(rs.getString("xml"));
+
+            relation.setClaimId(rs.getString("id"));
+            relation.setClaimedBy(rs.getString("agent"));
+            relation.setClaimDate(rs.getDate("date"));
+            String dmf=rs.getString("dmf");
+            if(dmf!=null){
+                relation.setDmf(dmf);
+                relation.setHasDMF(true);
+                relation.setCollectedFrom(DMFResultHandler.identifyCollectedFrom(rs.getString("resultid")));
+
+            }
+
+            relations.add(relation);
+        }
+
+        return relations;
+    }
+    public SqlDAO getSqlDAO() {
+        return sqlDAO;
+    }
+
+    public void setSqlDAO(SqlDAO sqlDAO) {
+        this.sqlDAO = sqlDAO;
+    }
+
+    public QueryGenerator getQueryGenerator() {
+        return queryGenerator;
+    }
+
+    public void setQueryGenerator(QueryGenerator queryGenerator) {
+        this.queryGenerator = queryGenerator;
+    }
+
+    public RelationParser getRelationParser() {
+        return relationParser;
+    }
+
+    public void setRelationParser(RelationParser relationParser) {
+        this.relationParser = relationParser;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ResultHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ResultHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/ResultHandler.java	(revision 47503)
@@ -0,0 +1,82 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import eu.dnetlib.data.claimsDemo.QueryGenerator;
+import eu.dnetlib.data.claimsDemo.SqlDAO;
+import org.apache.commons.io.FileUtils;
+import org.apache.log4j.Logger;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * Created by kiatrop on 5/2/2016.
+ */
+public class ResultHandler  {
+    private Logger log = Logger.getLogger(this.getClass());
+    SqlDAO sqlDAO = null;
+    QueryGenerator queryGenerator = null;
+    String pathToSaveRecord = null;
+
+/*    public String generateSaveQueryForResult(Result result){
+        return queryGenerator.generateInsertResultQuery(result.getOpenaireId(),result.getResultType(),result.getTitle(),result.getCollectedFrom(),result.getExternalUrl(),result.getDOI(), result.getOrcidworkid(), result.getAccessRights(),result.getEmbargoEndDate(),result.getBestLicense(),result.getRecordPath(), result.getRecordFormat());
+    }
+    public void saveResult(Result result) throws Exception {
+        sqlDAO.executePreparedQuery(generateSaveQueryForResult(result));
+    }*/
+
+    public String exportMetadataFileForResult(Result result)  {
+        if(result.getOpenaireId()!=null && result.getMetadataRecord()!=null){
+            String path=createExportPath(result.getResultType(),result.getCollectedFrom(),result.getOpenaireId());
+            try {
+                //TODO check what should be saved in the path field
+                FileUtils.writeStringToFile(new File(path), result.getMetadataRecord());
+                return path;
+            } catch (IOException e) {
+                log.error("Couldn't write record to file "+ path,e);
+
+            }
+        }
+
+        return null;
+    }
+    private String createExportPath(String type, String collectedFrom, String openaireId){
+        String datasource=ClaimUtils.OPENAIRE;
+        if(collectedFrom.equals(ClaimUtils.COLLECTED_FROM_ORCID)){
+            datasource=ClaimUtils.ORCID;
+        }else if(collectedFrom.equals(ClaimUtils.COLLECTED_FROM_CROSSREF)){
+            datasource=ClaimUtils.CROSSREF;
+        }else if(collectedFrom.equals(ClaimUtils.COLLECTED_FROM_DATACITE)){
+            datasource=ClaimUtils.DATACITE;
+        }
+        //TODO fix this openaireId.replace("/","*") ?? url encode
+        //temporary solution for external results with doi which contain "/" (It creates folders in path)
+        return this.pathToSaveRecord+""+type+"/"+datasource+"/"+openaireId.replace("/","*");
+
+    }
+    public SqlDAO getSqlDAO() {
+        return sqlDAO;
+    }
+
+    public void setSqlDAO(SqlDAO sqlDAO) {
+        this.sqlDAO = sqlDAO;
+    }
+
+    public QueryGenerator getQueryGenerator() {
+        return queryGenerator;
+    }
+
+    public void setQueryGenerator(QueryGenerator queryGenerator) {
+        this.queryGenerator = queryGenerator;
+    }
+
+    public String getPathToSaveRecord() {
+        return pathToSaveRecord;
+    }
+
+    public void setPathToSaveRecord(String pathToSaveRecord) {
+        this.pathToSaveRecord = pathToSaveRecord;
+    }
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/FetchClaimHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/FetchClaimHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/FetchClaimHandler.java	(revision 47503)
@@ -0,0 +1,421 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import eu.dnetlib.data.claims.migration.JsonldBuilder;
+import eu.dnetlib.data.claims.migration.entity.*;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import eu.dnetlib.data.claimsDemo.QueryGenerator;
+import eu.dnetlib.data.claimsDemo.SQLStoreException;
+import eu.dnetlib.data.claimsDemo.SqlDAO;
+import org.apache.log4j.Logger;
+
+import java.sql.Array;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by argirok on 9/3/2016.
+ */
+public class FetchClaimHandler {
+    private Logger log = Logger.getLogger(this.getClass());
+
+    SqlDAO sqlDAO = null;
+    QueryGenerator queryGenerator = null;
+
+    public FetchClaimHandler(){
+//        ApplicationContext context = new ClassPathXmlApplicationContext("../claims/migration/springContext-claimsDemo.xml");
+//        sqlDAO = context.getBean(SqlDAO.class);
+
+    }
+
+    public String claims2JSON(List<Claim> claims) throws Exception {
+        return JsonldBuilder.toJsonld(claims);
+    }
+    public String claim2JSON(Claim claim) throws Exception {
+        return JsonldBuilder.toJsonld(claim);
+    }
+
+    /**
+     *
+     * @param user - user e-mail stored in claims DB
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByUser(String user, Integer limit, Integer offset, List<String> types, boolean addCurationInfo) throws Exception, SQLStoreException {
+        return fetchClaimsByUser(user,limit,offset,null,"claim.claim_date",true, types, addCurationInfo);
+    }
+    /**
+     *
+     * @param user - user e-mail stored in claims DB
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @param keyword filters in specific fields per type (result: {title,doi},project: {name.acronym. funder_name, funder_acronym}, context: {name})
+     * @param orderField
+     * @param descending
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByUser(String user, Integer limit, Integer offset,String keyword,String orderField,boolean descending, List<String> types, boolean addCurationInfo) throws Exception, SQLStoreException {
+        log.info("Fetching claims for user"+user);
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateFetchClaimsByUser(user, limit, offset,keyword,orderField,descending, types));
+        return fetchClaimsByResultSet(rs, addCurationInfo);
+    }
+    /**
+     *
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchAllClaims( Integer limit, Integer offset, boolean addCurationInfo) throws Exception, SQLStoreException {
+        log.info("Fetching all claims");
+         return fetchAllClaims(limit,offset,null,"claim.claim_date",true,new ArrayList<String>(), addCurationInfo);
+    }
+
+    /**
+     *
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @param keyword  filters in specific fields per type (result: {title,doi},project: {name.acronym. funder_name, funder_acronym}, context: {name})
+     * @param orderField
+     * @param descending
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchAllClaims( Integer limit, Integer offset, String keyword, String orderField, boolean descending, List<String> types, boolean addCurationInfo) throws Exception, SQLStoreException {
+        log.info("Fetching all claims");
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateFetchClaims(limit, offset,keyword,orderField,descending,types));
+        return fetchClaimsByResultSet(rs, addCurationInfo);
+    }
+
+    /**
+     *
+     * @param dateFrom
+     * @param dataTo
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByDate(String dateFrom, String dataTo, Integer limit, Integer offset, boolean addCurationInfo) throws Exception, SQLStoreException {
+         return fetchClaimsByDate(dateFrom, dataTo, limit, offset, null, "claim.claim_date",true, new ArrayList<String>(),addCurationInfo);
+    }
+    /**
+     *
+     * @param dateFrom
+     * @param dataTo
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByDate(String dateFrom, String dataTo, Integer limit, Integer offset, String keyword, String orderField, boolean descending, List<String> types, boolean addCurationInfo) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateFetchClaimsByDate(dateFrom, dataTo, limit, offset,keyword, orderField, descending,types));
+        return fetchClaimsByResultSet(rs, addCurationInfo);
+    }
+
+    /**
+     *
+     * @param openaireId for project
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByProject(String openaireId, Integer limit, Integer offset, boolean addCurationInfo) throws Exception, SQLStoreException {
+
+        return fetchClaimsByProject(openaireId,limit, offset, null, "claim.claim_date",true, new ArrayList<String>(), addCurationInfo);
+    }
+    /**
+     *
+     * @param openaireId for project
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @param orderField
+     * @param descending
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByProject(String openaireId, Integer limit, Integer offset, String keyword, String orderField, boolean descending, List<String> types, boolean addCurationInfo) throws Exception, SQLStoreException {
+        log.info("Fetching claims by project ID:"+openaireId);
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateFetchClaimsByProject(openaireId, limit, offset, keyword, orderField,descending,types));
+        return fetchClaimsByResultSet(rs, addCurationInfo);
+    }
+    /**
+     *
+     * @param openaireId of Funder
+     * @param limit
+     * @param offset
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByFunder(String openaireId, Integer limit, Integer offset, boolean addCurationInfo) throws Exception, SQLStoreException {
+         return fetchClaimsByFunder(openaireId,limit,offset,null,"claim.claim_date",true, new ArrayList<String>(), addCurationInfo);
+    }
+    /**
+     *
+     * @param openaireId of Funder
+     * @param limit
+     * @param offset
+     * @param orderField
+     * @param descending
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByFunder(String openaireId, Integer limit, Integer offset,String keyword, String orderField, boolean descending, List<String> types, boolean addCurationInfo) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateFetchClaimsByFunder(openaireId, limit, offset,keyword, orderField,descending,types));
+        return fetchClaimsByResultSet(rs, addCurationInfo);
+    }
+    /**
+     *
+     * @param openaireId for result
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByResult(String openaireId, Integer limit, Integer offset, boolean addCurationInfo) throws Exception, SQLStoreException {
+         return fetchClaimsByResult(openaireId,limit,offset,null, "claim.claim_date",true, new ArrayList<String>(), addCurationInfo);
+    }
+    /**
+     *
+     * @param openaireId for result
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @param orderField
+     * @param descending
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByResult(String openaireId, Integer limit, Integer offset,String keyword, String orderField, boolean descending, List<String> types, boolean addCurationInfo) throws Exception, SQLStoreException {
+        log.info("Fetching claims by result ID:"+openaireId);
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateFetchClaimsByResult(openaireId, limit, offset,keyword, orderField, descending,types));
+        return fetchClaimsByResultSet(rs, addCurationInfo);
+    }
+    /**
+     *
+     * @param openaireId
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByContext(String openaireId, Integer limit, Integer offset, boolean addCurationInfo) throws Exception, SQLStoreException {
+         return fetchClaimsByContext(openaireId,limit,offset,null,"claim.claim_date",true, new ArrayList<String>(), addCurationInfo);
+    }
+    /**
+     *
+     * @param openaireId
+     * @param limit returns at most 'limit' claims  (use -1 or null for no limit)
+     * @param offset returns claims after 'offset' position (null for no offset)
+     * @param orderField
+     * @param descending
+     * @return
+     * @throws Exception
+     */
+    public List<Claim> fetchClaimsByContext(String openaireId, Integer limit, Integer offset, String keyword, String orderField, boolean descending, List<String> types, boolean addCurationInfo) throws Exception, SQLStoreException {
+        log.info("Fetching claims by context ID:"+openaireId);
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateFetchClaimsByContext(openaireId, limit, offset,keyword,orderField, descending,types));
+        return fetchClaimsByResultSet(rs, addCurationInfo);
+    }
+    public Claim fetchClaimById(String claimId, boolean addCurationInfo) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectClaimQuery(claimId));
+        if(rs.next()) {
+            String sourceType =rs.getString(2);
+//            String sourceId =rs.getString(3);
+            String targetType =rs.getString(4);
+//            String targetId =rs.getString(5);
+           rs = sqlDAO.executePreparedQuery(queryGenerator.generateFetchClaimsByClaimId(claimId,sourceType,targetType));
+        }else{
+            log.info("No claim with id : "+ claimId+"\n");
+        }
+        Claim claim = null;
+        List<Claim> claims=fetchClaimsByResultSet(rs, addCurationInfo);
+        if(claims.size()==1){
+            claim=claims.get(0);
+        }
+        return claim;
+    }
+
+    /*
+    public List<Claim> fetchClaimsByToken(String token, String email, Integer limit, Integer offset, boolean addCurationInfo) throws Exception {
+        return fetchClaimsByToken(token, email, limit, offset, null, "claim.claim_date",true, new ArrayList<String>(), addCurationInfo);
+    }
+
+    public List<Claim> fetchClaimsByToken(String token, String email, Integer limit, Integer offset, String keyword, String orderField, boolean descending, List<String> types, boolean addCurationInfo) throws Exception {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateFetchClaimsByProjectToken(token, email, limit, offset, keyword, orderField,descending,types));
+        return fetchClaimsByResultSet(rs, addCurationInfo);
+    }
+    */
+
+
+    public List<Claim> fetchClaimsByResultSet(ResultSet rs, boolean addCurationInfo) throws Exception {
+        List<Claim> claims= new ArrayList<Claim>();
+        while(rs.next()) {
+            Claim claim= new Claim();
+            claims.add(claim);
+            claim.setId(rs.getString(1));
+            DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date date = format.parse(rs.getString(2));
+            claim.setDate(date);
+            claim.setUserMail(rs.getString(3));
+            claim.setSourceType(rs.getString(4));
+            claim.setTargetType(rs.getString(5));
+            claim.setSemantics(rs.getString(6));
+
+            if(addCurationInfo) {
+                String curationDate =rs.getString(7);
+                if(curationDate != null) {
+                    date = format.parse(curationDate);
+                    claim.setCurationDate(date);
+                }
+                claim.setCuratedBy(rs.getString(8));
+            }
+            claim.setApproved(rs.getBoolean(9));
+            claim.setSource(buildEntity(rs,10,claim.getSourceType()));
+            claim.setTarget(buildEntity(rs,20,claim.getTargetType()));
+
+        }
+        return claims;
+    }
+    public Integer countClaimsByResultSet(ResultSet rs) throws Exception {
+
+        while(rs.next()) {
+            return rs.getInt(1);
+        }
+        return null;
+    }
+    public List<Project> getProjectsByResultSet(ResultSet rs, boolean addCurationInfo) throws Exception {
+        List<Project> projects= new ArrayList<Project>();
+        while(rs.next()) {
+            Project project=(Project)(buildEntity(rs, 1, ClaimUtils.PROJECT));
+             projects.add(project);
+        }
+        return projects;
+    }
+    public List<Context> getContextsByResultSet(ResultSet rs, boolean addCurationInfo) throws Exception {
+        List<Context> contexts= new ArrayList<Context>();
+        while(rs.next()) {
+            Context context=(Context)(buildEntity(rs, 1, ClaimUtils.CONTEXT));
+            contexts.add(context);
+        }
+        return contexts;
+    }
+    public Integer countAllClaims(String keyword, List<String> types) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateCountAllClaims(keyword,types));
+        return countClaimsByResultSet(rs);
+    }
+    public Integer countClaimsByUser(String user,String keyword, List<String> types) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateCountByUser(user,keyword,types));
+        return countClaimsByResultSet(rs);
+    }
+    public Integer countClaimsByProject(String projectId,String keyword, List<String> types) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateCountByProject(projectId,keyword,types));
+        return countClaimsByResultSet(rs);
+    }
+    /*
+    public Integer countClaimsByProjectToken(String projectToken,String email,String keyword, List<String> types)throws Exception {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateCountByProjectToken(projectToken,email,keyword,types));
+        return countClaimsByResultSet(rs);
+    }
+    */
+    public Integer countClaimsByFunder(String funderId,String keyword, List<String> types) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateCountByFunder(funderId,keyword,types));
+        return countClaimsByResultSet(rs);
+    }
+    public Integer countClaimsByResult(String resultId,String keyword, List<String> types) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateCountByResult(resultId,keyword,types));
+        return countClaimsByResultSet(rs);
+    }
+    public Integer countClaimsByContext(String contextId,String keyword, List<String> types) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateCountByContext(contextId,keyword,types));
+        return countClaimsByResultSet(rs);
+    }
+    public Integer countClaimsByDate(String dateFrom,String dateTo,String keyword, List<String> types) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateCountByDate(dateFrom,dateTo,keyword,types));
+        return countClaimsByResultSet(rs);
+    }
+
+    public List<Project> getAllclaimedProjects(boolean addCurationInfo) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateFetchAllProjectsQuery());
+        return getProjectsByResultSet(rs,addCurationInfo);
+    }
+    public List<Context> getAllclaimedContexts( boolean addCurationInfo) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateFetchAllContextsQuery());
+        return getContextsByResultSet(rs,addCurationInfo);
+    }
+    /**
+     *
+     * @param rs
+     * @param index
+     * @return
+     * @throws SQLException
+     */
+    private static Result buildResult(ResultSet rs, Integer index) throws SQLException {
+        Result result = new Result();
+        result.setOpenaireId(rs.getString(index));
+        result.setTitle(rs.getString(index + 1));
+        result.setResultType(rs.getString(index + 2));
+        result.setDoi(rs.getString(index + 3));
+        result.setOrcidworkid(rs.getString(index + 4));
+        result.setAccessRights(rs.getString(index + 5));
+        result.setEmbargoEndDate(rs.getString(index + 6));
+        result.setBestLicense(rs.getString(index + 7));
+        result.setExternalUrl(rs.getString(index + 8));
+        result.setCollectedFrom(rs.getString(index + 9));
+        return result;
+
+    }
+    private static Project buildProject(ResultSet rs, Integer index) throws SQLException {
+        Project project = new Project();
+        project.setOpenaireId(rs.getString(index));
+        project.setName(rs.getString(index + 1));
+        project.setAcronym(rs.getString(index + 2));
+        project.setFunderId(rs.getString(index + 3));
+        project.setFunderName(rs.getString(index + 4));
+        return project;
+
+    }
+    private static Context buildContext(ResultSet rs, Integer index) throws SQLException {
+        Context context = new Context();
+        context.setOpenaireId(rs.getString(index));
+        context.setTitle(rs.getString(index + 1));
+        return context;
+
+    }
+    private static OpenaireEntity buildEntity(ResultSet rs, Integer index, String type) throws SQLException {
+        OpenaireEntity openaireEntity = null;
+        if(type == null){
+            openaireEntity = null;
+        }else if(type.equals(ClaimUtils.PUBLICATION)||type.equals(ClaimUtils.DATASET)) {
+            openaireEntity= buildResult(rs, index);
+        }else if(type.equals(ClaimUtils.PROJECT)){
+            openaireEntity = buildProject(rs,index);
+        }else if(type.equals(ClaimUtils.CONTEXT)){
+            openaireEntity = buildContext(rs,index);
+        }
+        return openaireEntity;
+    }
+
+    public SqlDAO getSqlDAO() {
+        return sqlDAO;
+    }
+
+    public void setSqlDAO(SqlDAO sqlDAO) {
+        this.sqlDAO = sqlDAO;
+    }
+
+    public QueryGenerator getQueryGenerator() {
+        return queryGenerator;
+    }
+
+    public void setQueryGenerator(QueryGenerator queryGenerator) {
+        this.queryGenerator = queryGenerator;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/FetchProjectHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/FetchProjectHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/FetchProjectHandler.java	(revision 47503)
@@ -0,0 +1,104 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import eu.dnetlib.data.claims.migration.JsonldBuilder;
+import eu.dnetlib.data.claims.migration.entity.Claim;
+import eu.dnetlib.data.claims.migration.entity.Project;
+import eu.dnetlib.data.claimsDemo.QueryGenerator;
+import eu.dnetlib.data.claimsDemo.SQLStoreException;
+import eu.dnetlib.data.claimsDemo.SqlDAO;
+import org.apache.log4j.Logger;
+
+import java.sql.Array;
+import java.sql.ResultSet;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * Created by konstantina on 10/4/2017.
+ */
+public class FetchProjectHandler {
+    private Logger log = Logger.getLogger(this.getClass());
+
+    SqlDAO sqlDAO = null;
+    QueryGenerator queryGenerator = null;
+
+    public FetchProjectHandler(){
+
+    }
+
+    public String fetchProjectIdByToken(String token, String email) throws Exception, SQLStoreException {
+        String openaireId = null;
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectProjectIdByTokenQuery(token, email));
+
+        if(rs.next()) {
+            openaireId = rs.getString(1);
+        }
+        rs.close();
+        return openaireId;
+    }
+
+    public Project fetchProjectById(String projectId) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectProjectByIdQuery(projectId));
+
+        Project project = fetchProjectByResultSet(rs);
+        if(project == null) {
+            log.info("No project with id : "+ projectId+"\n");
+        }
+
+        return project;
+    }
+
+    public List<String> fetchContactEmailsByProjectId(String projectId) throws Exception, SQLStoreException {
+        ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectContactEmailsByProjectIdQuery(projectId));
+
+        if(rs.next()) {
+//            Array array = ((String[])rs.getArray(1));
+            Array array = rs.getArray(1);
+            if(array != null) {
+                String[] str_array = (String[]) array.getArray();
+
+                List<String> mails = new ArrayList<String>();
+                for (int i = 0; i < str_array.length; i++) {
+                    mails.add(str_array[i]);
+                }
+                return mails;
+            }
+        }
+        return null;
+    }
+
+    public Project fetchProjectByResultSet(ResultSet rs) throws Exception {
+        Project project = null;
+        while(rs.next()) {
+            project = new Project();
+            project.setOpenaireId(rs.getString(1));
+            project.setName(rs.getString(2));
+            project.setAcronym(rs.getString(3));
+            project.setFunderId(rs.getString(4));
+            project.setFunderName(rs.getString(5));
+            project.setFunderShortName(rs.getString(6));
+            //project.setContactEmails((List<String>)rs.getArray(7));
+        }
+        return project;
+    }
+
+    public SqlDAO getSqlDAO() {
+        return sqlDAO;
+    }
+
+    public void setSqlDAO(SqlDAO sqlDAO) {
+        this.sqlDAO = sqlDAO;
+    }
+
+    public QueryGenerator getQueryGenerator() {
+        return queryGenerator;
+    }
+
+    public void setQueryGenerator(QueryGenerator queryGenerator) {
+        this.queryGenerator = queryGenerator;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/IndexResultHandler.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/IndexResultHandler.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/handler/IndexResultHandler.java	(revision 47503)
@@ -0,0 +1,69 @@
+package eu.dnetlib.data.claims.migration.handler;
+
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claims.migration.parser.OafParser;
+import eu.dnetlib.data.claimsDemo.SearchUtils;
+
+/**
+ * Created by kiatrop on 8/2/2016.
+ */
+public class IndexResultHandler {
+
+    SearchUtils searchUtils;
+
+    private String fetchPublicationResult(String id) throws Exception {
+        return searchUtils.fetchPublicationXmlFromIndex(id);
+    }
+
+    private String fetchDatasetResult(String id) throws Exception {
+        return searchUtils.fetchDatasetXmlFromIndex(id);
+    }
+    private String fetchDedupPublicationResult(String id) throws Exception {
+        return searchUtils.fetchDedupPublicationXmlFromIndex(id);
+    }
+
+    private String fetchDedupDatasetResult(String id) throws Exception {
+        return searchUtils.fetchDedupDatasetXmlFromIndex(id);
+    }
+    /**
+     *Searches for both publications and datasets
+     * @param id
+     * @return Result or null
+     * @throws Exception
+     */
+    public Result fetchResultById(String id) throws Exception {
+
+        String oaf = fetchPublicationResult(id);
+
+        if (oaf == null) {
+            oaf = fetchDatasetResult(id);
+        }
+
+        if (oaf == null) {
+            return null;
+        }
+
+        return OafParser.oaf2Result(oaf);
+    }
+    public Result fetchDedupResultById(String id) throws Exception {
+
+        String oaf = fetchDedupPublicationResult(id);
+
+        if (oaf == null) {
+            oaf = fetchDedupDatasetResult(id);
+        }
+
+        if (oaf == null) {
+            return null;
+        }
+
+        return OafParser.oaf2Result(oaf);
+    }
+    public SearchUtils getSearchUtils() {
+        return searchUtils;
+    }
+
+    public void setSearchUtils(SearchUtils searchUtils) {
+        this.searchUtils = searchUtils;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/ClaimValidation.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/ClaimValidation.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/ClaimValidation.java	(revision 47503)
@@ -0,0 +1,318 @@
+package eu.dnetlib.data.claims.migration;
+
+import eu.dnetlib.data.claims.migration.entity.*;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import org.apache.log4j.Logger;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+
+/**
+ * Created by argirok on 21/1/2016.
+ */
+public class ClaimValidation {
+    private PrintWriter out;
+    String pathToSaveReport = null;
+
+    private static Logger logger = Logger.getLogger(ClaimValidation.class);
+
+    /*
+    Claim:
+    Mandatory Fields : id, sourceType,targetType, User e-mail, Date, Target, Source
+
+    */
+    public  boolean validateClaim(Claim claim){
+        logger.info("Validating...");
+        boolean isValid=true;
+        try {
+            out = new PrintWriter(new BufferedWriter(new FileWriter(pathToSaveReport+"/validationFile.txt", true)));
+
+        } catch (Exception e) {
+            out = null;
+            logger.error("Couldn't write to file " + "validationFile.txt", e);
+        }
+
+              if(claim==null){
+                isValid=false;
+                if(out!=null) {
+                    out.println("Claim invalid (null)...");
+                }
+                logger.warn("Claim invalid (null)...");
+//            }else if(claim.getId()==null||claim.getId().isEmpty()){
+//                isValid=false;
+//                 out.println("Claim invalid  (id)..." );
+             }else if(claim.getTargetType()==null||claim.getTargetType().isEmpty()){
+                isValid=false;
+                if(out!=null) {
+                    out.println("Claim invalid (target type): " + claim.getId());
+                }
+                logger.warn("Claim invalid (target type): "+claim.getId());
+
+            }else if(claim.getSourceType()==null||claim.getSourceType().isEmpty()){
+                isValid=false;
+                if(out!=null) {
+                    out.println("Claim invalid (source type): " + claim.getId());
+                }
+                logger.warn("Claim invalid (source type): "+claim.getId());
+
+            }else if(claim.getDate()==null){
+                isValid=false;
+                if(out!=null) {
+                    out.println("Claim invalid (date): " + claim.getId());
+                }
+                logger.warn("Claim invalid (date): "+claim.getId());
+
+            }else if(claim.getUserMail()==null||claim.getUserMail().isEmpty()){
+                isValid=false;
+                 if(out!=null) {
+                     out.println("Claim invalid (mail): " + claim.getId());
+                 }
+                logger.warn("Claim invalid (mail): "+claim.getId());
+
+            }else if(claim.getSource()==null || claim.getTarget()==null){
+                isValid=false;
+                 if(out!=null) {
+                     out.println("Result invalid : " + claim.getId());
+                 }
+                logger.warn("Result invalid : "+claim.getId());
+
+            }else if(claim.getSource()==null || claim.getTarget()==null){
+                isValid=false;
+                 if(out!=null) {
+                     out.println("Result invalid : " + claim.getId());
+                 }
+                logger.warn("Result invalid : "+claim.getId());
+
+            }else if(claim.getSource().getOpenaireId()!=null && claim.getTarget().getOpenaireId()!=null && claim.getSource().getOpenaireId().equals(claim.getTarget().getOpenaireId())){
+                isValid=false;
+                 if(out!=null) {
+                     out.println("Claim invalid (source == target): " + claim.getId());
+                 }
+                logger.warn("Claim invalid (source == target): "+claim.getId());
+
+            }else{
+                boolean sourceIsValid=validateByType(claim.getSource(),claim.getSourceType(),claim.getId());
+                boolean targetIsValid=validateByType(claim.getTarget(),claim.getTargetType(),claim.getId());
+                isValid= isValid&&sourceIsValid&&targetIsValid;
+                 if(!isValid){
+                     if(out!=null) {
+                         out.println("Claim invalid (source /target): " + claim.getId() + "\n");
+                     }
+                     logger.warn("Claim invalid (source /target): "+claim.getId()+"\n");
+                 }
+            }
+            if(out!=null) {
+                out.close();
+            }
+
+        return isValid;
+    }
+    /*
+    Project:
+    Mandatory Fields : id, type, Collected from
+
+     */
+    public  boolean validateResult(Result result, String claimId){
+        boolean isValid=true;
+            if(result==null){
+                isValid=false;
+                out.println("Result invalid (null): - claimId:"+claimId);
+//            }else if(result.getOpenaireId()==null||result.getOpenaireId().isEmpty()){
+//                isValid=false;
+//                out.println("Result invalid (Id): - claimId:"+claimId);
+            }else if(result.getResultType()==null||result.getResultType().isEmpty()){
+                isValid=false;
+                out.println("Result invalid (Type): "+result.getOpenaireId()+"- claimId:"+claimId);
+            }/*
+            //http://services.openaire.eu:8380/search/search?action=search&sTransformer=results_openaire&query=%28%28%28deletedbyinference+%3D+false%29+AND+%28oaftype+exact+result%29%29+and+%28%28resulttypeid+exact+publication%29+or+%28resulttypeid+exact+dataset%29%29%29+and+%28%28objIdentifier+
+            //exact+od______1389%3A%3A6ba133c8460d5a67dfb18f34cc5303fb%29+or+%28resultdupid+exact+od______1389%3A%3A6ba133c8460d5a67dfb18f34cc5303fb%29%29&size=10&locale=en_GB
+            //There are resuts with no title
+            //so I am
+            else if(result.getTitle()==null||result.getTitle().isEmpty()){
+                isValid=false;
+                out.println("Result invalid (title): "+result.getOpenaireId()+"- claimId:"+claimId);
+            }*/else if(result.getCollectedFrom()==null||result.getCollectedFrom().isEmpty()){
+                isValid=false;
+                out.println("Result invalid (collectedFrom) : "+result.getOpenaireId()+"- claimId:"+claimId);
+            }else if (result.getCollectedFrom().equals(ClaimUtils.COLLECTED_FROM_OPENAIRE) && result.getOpenaireId()==null) {
+                isValid = false;
+                out.println("Result invalid (Openaire - no id): - claimId:" + claimId);
+            }else if ((result.getCollectedFrom().equals(ClaimUtils.COLLECTED_FROM_DATACITE)|| result.getCollectedFrom().equals(ClaimUtils.COLLECTED_FROM_CROSSREF) ) && result.getDoi()==null) {
+                isValid = false;
+                out.println("Result invalid (Crossref/Datacite - no doi): - claimId:" + claimId);
+            }else if (result.getCollectedFrom().equals(ClaimUtils.COLLECTED_FROM_ORCID) && result.getOrcidworkid()==null) {
+                isValid = false;
+                out.println("Result invalid (Orcid - no work id): - claimId:" + claimId);
+            }
+
+        return isValid;
+    }
+    /*
+    Project:
+    Mandatory Fields : id, name
+
+     */
+    public  boolean validateProject(Project project, String claimId){
+        boolean isValid=true;
+             if(project==null){
+                isValid=false;
+                out.println("Project invalid (null): - claimId:"+claimId);
+            }else if(project.getOpenaireId()==null||project.getOpenaireId().isEmpty()){
+                isValid=false;
+                out.println("Project invalid (id): - claimId:"+claimId);
+            }else if((project.getName()==null||project.getName().isEmpty())&&(project.getAcronym()==null||project.getAcronym().isEmpty())){
+                isValid=false;
+                out.println("Project invalid (name/acronym): "+project.getOpenaireId()+"- claimId:"+claimId);
+            }else if(project.getFunderId()==null||project.getFunderId().isEmpty()){
+                isValid=false;
+                out.println("Project invalid (funder id): "+project.getOpenaireId()+"- claimId:"+claimId);
+            }
+            else if(project.getFunderName()==null||project.getFunderName().isEmpty()){
+                isValid=false;
+                out.println("Project invalid (funder name): "+project.getOpenaireId()+"- claimId:"+claimId);
+            }
+
+        return isValid;
+    }
+    /*
+    Context:
+    Mandatory Fields : id, title
+
+     */
+    public  boolean validateContext(Context context, String claimId){
+        boolean isValid=true;
+            if(context==null){
+                isValid=false;
+                out.println("Context invalid (null): - claimId:"+claimId);
+            }else if(context.getOpenaireId()==null||context.getOpenaireId().isEmpty()){
+                isValid=false;
+                out.println("Context invalid (id): - claimId:"+claimId);
+            }/*
+            //This is commented since There isn't a way to fill this field right now.
+            else if(context.getTitle()==null||context.getTitle().isEmpty()){
+                isValid=false;
+                out.println("Context invalid : "+context.getOpenaireId()+"- claimId:"+claimId);
+            }*/
+        return isValid;
+    }
+    private boolean validateByType(OpenaireEntity entity,String type , String claimId ){
+        //TODO add more types (e.g. patends) when they are available
+        if(type.equals(ClaimUtils.PUBLICATION)||type.equals(ClaimUtils.DATASET)){
+            return validateResult((Result)entity,claimId);
+        } else if(type.equals(ClaimUtils.CONTEXT)){
+            return validateContext((Context)entity,claimId);
+        }else if(type.equals(ClaimUtils.PROJECT)){
+            return validateProject((Project)entity,claimId);
+        }else{
+            if(entity.getOpenaireId()!=null){
+                out.println("Entity invalid type ("+type+"):"+entity.getOpenaireId()+" - claimId:"+claimId);
+            }else {
+                out.println("Entity invalid type (" + type + "): - claimId:" + claimId);
+            }
+        }
+        return false;
+    }
+
+    public static boolean validateCollectedFrom(String collectedFrom) throws ClaimValidationException {
+        //TODO add more collected from when they are available
+        if (collectedFrom==null || collectedFrom.isEmpty()) {
+            logger.error("CollectedFrom field of source and/or target is null or empty");
+            throw new ClaimValidationException("CollectedFrom field of source and/or target cannot be empty.");
+
+        } else if (!collectedFrom.equals(ClaimUtils.OPENAIRE) &&
+                !collectedFrom.equals(ClaimUtils.DATACITE) &&
+                !collectedFrom.equals(ClaimUtils.CROSSREF) &&
+                !collectedFrom.equals(ClaimUtils.ORCID)) {
+            logger.error("CollectedFrom field of source and/or target is invalid. Value is:"+collectedFrom);
+            throw new ClaimValidationException("CollectedFrom field of source and/or target is invalid. The allowed " +
+                    "types are: " + ClaimUtils.OPENAIRE + ", " + ClaimUtils.DATACITE
+                    + ", " + ClaimUtils.CROSSREF + ", " + ClaimUtils.ORCID +".");
+
+
+        }
+
+        return true;
+    }
+
+    public static boolean validateType(String type)  throws ClaimValidationException {
+        if (type == null || type.isEmpty()) {
+            throw new ClaimValidationException("The type of source and/or target cannot be empty.");
+
+        } else if (!type.equals(ClaimUtils.PUBLICATION) && !type.equals(ClaimUtils.DATASET) &&
+                !type.equals(ClaimUtils.CONTEXT) && !type.equals(ClaimUtils.PROJECT)) {
+            throw new ClaimValidationException("The given type is invalid. The allowed types are: " +
+                    ClaimUtils.PUBLICATION + ", " + ClaimUtils.DATASET + ", " + ClaimUtils.CONTEXT + ", " +
+                    ClaimUtils.PROJECT);
+        }
+
+        return true;
+    }
+
+//    /*
+//   Checks if the doi is valid. If it is not  then replaces the existing  DOI with the valid one.
+//    */
+//    public static void checkForDOI(Result r) throws Exception {
+//        if(r.getDOI()==null){
+//            return ;
+//        }
+//         String validDOI=isValidDoi(r.getDOI());
+//        if(!validDOI.equals(r.getDOI())){
+//            if(r.getMetadataRecord()!=null) {
+//                r.setMetadataRecord(r.getMetadataRecord().replace(r.getDOI(), validDOI));
+//            }
+//            if(r.getExternalUrl()!=null){
+//                r.setExternalUrl(r.getExternalUrl().replace(r.getDOI(), validDOI));
+//            }
+//            r.setDoi(validDOI);
+//        }
+//    }
+//    public static String isValidDoi(String doi) throws Exception {
+//        if(doi==null){
+//            return null;
+//        }
+//        try{
+//            PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("invalid_dois.txt", true)));
+//            boolean valid=SearchUtils.isDoiValid(doi);
+//            if(!valid&&(doi.length() - (doi.replace("_", "")).length() > 1)){
+//                String transformDoi = doi.replace("_", "-");
+//                valid=SearchUtils.isDoiValid(transformDoi);
+//                if(valid){
+//                    Date date= new java.util.Date();
+//                    out.println(new Timestamp(date.getTime())+" - Invalid doi: "+doi+" replaced with : "+transformDoi);
+//                    doi=transformDoi;
+//                }
+//            }else if(!valid&&(doi.length() - (doi.replace("_", "")).length() == 1)) {
+//                String transformDoi = doi.replace("_", "-");
+//                valid=SearchUtils.isDoiValid(transformDoi);
+//                if(valid){
+//                    Date date= new java.util.Date();
+//                    out.println(new Timestamp(date.getTime())+" - Invalid doi: "+doi+" replaced with : "+transformDoi);
+//                    doi = transformDoi;
+//                }
+//            }else if(!valid) {
+//                String transformDoi =doi.replaceAll("\\p{C}", "");
+//                valid=SearchUtils.isDoiValid(transformDoi);
+//                if(valid){
+//                    Date date= new java.util.Date();
+//                    out.println(new Timestamp(date.getTime())+" - Invalid doi: "+doi+" replaced with (zero-width-char): "+transformDoi);
+//                    doi = transformDoi;
+//                }
+//            }
+//            out.close();
+//        }catch (IOException e) {
+//            e.printStackTrace();
+//            System.err.println("Couldn't write to file " + "invalid_dois.txt");
+//        }
+//        return doi;
+//    }
+
+
+    public String getPathToSaveReport() {
+        return pathToSaveReport;
+    }
+
+    public void setPathToSaveReport(String pathToSaveReport) {
+        this.pathToSaveReport = pathToSaveReport;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/ExternalRecordParser.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/ExternalRecordParser.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/ExternalRecordParser.java	(revision 47503)
@@ -0,0 +1,427 @@
+package eu.dnetlib.data.claims.migration.parser;
+
+import com.google.gson.Gson;
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import sun.print.CUPSPrinter;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.math.BigInteger;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.List;
+
+/**
+ * Created by kiatrop on 5/2/2016.
+ */
+
+public class ExternalRecordParser {
+
+    /**
+     * Gets the json response from crossref API
+     * and returns a Result object
+     * *
+     * @param json
+     * @return Result or null
+     */
+    private static final Logger logger = Logger.getLogger(ExternalRecordParser.class);
+
+    public static Result crossref2Result(String json) {
+        Result result = null;
+        if (json == null){
+            return result;
+        }
+
+        BufferedReader br = new BufferedReader(new StringReader(json));
+        //convert the json string back to object
+        Gson gson = new Gson();
+        CrossrefResponse obj = gson.fromJson(br, CrossrefResponse.class);
+
+        if(obj!=null && obj.getMessage().getItems().size()>0){
+            result= new Result();
+            result.setMetadataRecord(json);
+            result.setRecordFormat(ClaimUtils.FORMAT_JSON);
+//            result.setFound(true);
+            result.setCollectedFrom(ClaimUtils.COLLECTED_FROM_CROSSREF);
+            CrossrefResponse.Message.Item item = obj.getMessage().getItems().get(0);
+            if (item.getTitle()!=null && item.getTitle().size()>0){
+                result.setTitle(item.getTitle().get(0));
+                if(item.getAuthor() != null) {
+                    for (int i = 0; i < item.getAuthor().size(); i++) {
+                        result.getAuthors().put(i + "", item.getAuthor().get(i).getGiven() + " " + item.getAuthor().get(i).getFamily());
+                    }
+                }
+            }
+            System.out.println(item.getDOI());
+            result.setDoi(item.getDOI());
+            result.setOpenaireId(createOpenaireId(item.getDOI()));
+            result.setExternalUrl(item.getUrl());
+            if(result.getDoi()!=null&& result.getExternalUrl()==null){
+                result.setExternalUrl(ClaimUtils.PREFIX_URL_FOR_DOI + result.getDoi());
+            }
+            result.setResultType(ClaimUtils.PUBLICATION);
+
+        }
+
+        return result;
+    }
+
+    public static Result dataciteJson2Result(String json) {
+        Result result = null;
+        if (json == null){
+            return result;
+        }
+
+        BufferedReader br = new BufferedReader(new StringReader(json));
+        //convert the json string back to object
+        Gson gson = new Gson();
+
+        DataciteResponse obj = gson.fromJson(br, DataciteResponse.class);
+        System.out.println(json);
+        if(obj!=null && obj.getData() != null ){
+            result= new Result();
+            result.setMetadataRecord(json);
+            result.setRecordFormat(ClaimUtils.FORMAT_JSON);
+//            result.setFound(true);
+            result.setCollectedFrom(ClaimUtils.COLLECTED_FROM_DATACITE);
+            DataciteResponse.Data.Attributes item = obj.getData().getAttributes();
+            if (item.getTitle()!=null){
+                result.setTitle(item.getTitle());
+                if(item.getAuthor() != null) {
+                    for (int i = 0; i < item.getAuthor().size(); i++) {
+                        result.getAuthors().put(i + "", (item.getAuthor().get(i).getGiven() != null)?(item.getAuthor().get(i).getGiven() + " " + item.getAuthor().get(i).getFamily()):item.getAuthor().get(i).getLiteral());
+                    }
+                }
+            }
+            System.out.println(item.getDoi());
+            result.setDoi(item.getDoi());
+            result.setOpenaireId(createOpenaireId(item.getDoi()));
+            if(result.getDoi()!=null&& result.getExternalUrl()==null){
+                result.setExternalUrl(ClaimUtils.PREFIX_URL_FOR_DOI + result.getDoi());
+            }
+            result.setResultType(ClaimUtils.DATASET);
+
+        }
+
+        return result;
+    }
+
+    /**
+     *
+     * @param xml
+     * @param orcidworkid The id from DMF identifier[@identifierType='orcidworkid'] {orcid + work-id}
+     * @return Result or null
+     */
+    public static Result orcid2Result(String xml, String orcidworkid) {
+         Result result = null;
+        if (xml == null || orcidworkid == null){
+            return result;
+        }
+        String orcidwork = orcidworkid.substring(20, orcidworkid.length());
+
+        try {
+            DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+            DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+            InputSource is = new InputSource(new StringReader(xml));
+            Document document = dBuilder.parse(is);
+            XPathFactory xPathfactory= XPathFactory.newInstance();
+            XPath xpath = xPathfactory.newXPath();
+
+            NodeList nl;
+            //worknl is the list with the works we search for
+            NodeList worknl = (NodeList) xpath.compile("//orcid-work[@put-code="+orcidwork+"]").evaluate(document,XPathConstants.NODESET);
+            if (worknl.getLength() > 0) {
+                //worknl contains at least one result
+                // instantiate result
+                result = new Result();
+                result.setResultType(ClaimUtils.PUBLICATION);
+                nl = (NodeList) xpath.compile("//title/text()").evaluate(document, XPathConstants.NODESET);
+                if (nl.getLength() > 0) {
+                    result.setTitle(nl.item(0).getNodeValue());
+                }
+                nl = (NodeList) xpath.compile("//work-external-identifier").evaluate(document, XPathConstants.NODESET);
+                for (int i = 0; i < nl.getLength(); i++) {
+                    NodeList identifiersNl;
+                    String type=null;
+                    String id=null;
+                    identifiersNl = (NodeList) xpath.compile("//work-external-identifier-type/text()").evaluate(nl.item(i), XPathConstants.NODESET);
+                    if (identifiersNl.getLength() > 0) {
+                        type=identifiersNl.item(0).getNodeValue();
+                    }
+                    identifiersNl = (NodeList) xpath.compile("//work-external-identifier-id/text()").evaluate(nl.item(i), XPathConstants.NODESET);
+                    if (identifiersNl.getLength() > 0) {
+                        id=identifiersNl.item(0).getNodeValue();
+                    }
+                    if(type != null && type.equals("doi") && id != null){
+                        result.setDoi(id);
+                        result.setExternalUrl(ClaimUtils.PREFIX_URL_FOR_DOI + id);
+                    }
+                    //more types (isbn)
+
+                }
+                if(result.getExternalUrl()==null) {
+                    nl = (NodeList) xpath.compile("//work-source/uri/text()").evaluate(document, XPathConstants.NODESET);
+                    if (nl.getLength() > 0) {
+                        result.setExternalUrl(nl.item(0).getNodeValue());
+                    }
+                }
+
+                nl = (NodeList) xpath.compile("//orcid-work").evaluate(document, XPathConstants.NODESET);
+                for (int i = 0; i < nl.getLength(); i++) {
+                    if(!worknl.item(0).isEqualNode(nl.item(i))) {
+                        nl.item(i).getParentNode().removeChild(nl.item(i));
+                    }
+                }
+
+                DOMSource domSource = new DOMSource(document);
+                StringWriter writer = new StringWriter();
+                StreamResult streamResult = new StreamResult(writer);
+                TransformerFactory tf = TransformerFactory.newInstance();
+                Transformer transformer = tf.newTransformer();
+                transformer.transform(domSource, streamResult);
+                result.setOrcidworkid(orcidworkid);
+                result.setOpenaireId(createOpenaireId(orcidworkid));
+                result.setMetadataRecord(writer.toString());
+                result.setRecordFormat(ClaimUtils.FORMAT_XML);
+                result.setCollectedFrom(ClaimUtils.COLLECTED_FROM_ORCID);
+//                result.setFound(true);
+            }
+
+        } catch (Exception e) {
+            logger.error("Error parsing Orcid result\n"+xml,e);
+        }
+
+        return result;
+    }
+
+    /**
+     *
+     * @param xml
+     * @return Result object or null
+     */
+    public static Result datacite2Result(String xml) {
+        logger.debug("Datacite xml response:\n"+xml);
+        Result result = null;
+        if (xml != null ) {
+
+            try {
+                DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+                DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+                InputSource is = new InputSource(new StringReader(xml));
+                Document document = dBuilder.parse(is);
+                XPathFactory xPathfactory = XPathFactory.newInstance();
+                XPath xpath = xPathfactory.newXPath();
+                NodeList nl;
+                nl = (NodeList) xpath.compile("//*[local-name()='identifier']/text()").evaluate(document, XPathConstants.NODESET);
+                if (nl.getLength() > 0) {
+                    result = new Result();
+                    result.setResultType(ClaimUtils.DATASET);
+
+                    result.setDoi(nl.item(0).getNodeValue());
+                    result.setExternalUrl("http://dx.doi.org/" + result.getDoi());
+
+                    result.setOpenaireId(createOpenaireId(result.getDoi()));
+                    nl = (NodeList) xpath.compile("//*[local-name()='title']/text()").evaluate(document, XPathConstants.NODESET);
+                    if (nl.getLength() > 0) {
+                        result.setTitle(nl.item(0).getNodeValue());
+                    }
+
+                    nl = (NodeList) xpath.compile("//*[local-name()='creator']/text()").evaluate(document, XPathConstants.NODESET);
+                    if (nl.getLength() > 0) {
+                        for (int i = 0; i < nl.getLength(); i++) {
+                            result.getAuthors().put(i + "", nl.item(i).getNodeValue());
+                        }
+                    }
+
+                    result.setMetadataRecord(xml);
+                    result.setRecordFormat(ClaimUtils.FORMAT_XML);
+                    result.setCollectedFrom(ClaimUtils.COLLECTED_FROM_DATACITE);
+//                result.setFound(true);
+                    logger.debug("Datacite result" + result.toString());
+
+                } else {
+
+                  logger.error("Couldn't parse Datacite result\n" + xml);
+
+                }
+
+                } catch(ParserConfigurationException | IOException | XPathExpressionException |SAXException e){
+                    logger.error("Error parsing Orcid result\n"+xml,e);
+                }
+
+        }
+            return result;
+    }
+    private static String createOpenaireId(String id){
+        System.out.println("createOpenaireId from id:" +id);
+        if(id==null){
+            return null;
+        }
+        String openaireId=id;
+        MessageDigest m= null;
+        try {
+            m = MessageDigest.getInstance("MD5");
+            m.update(id.getBytes(),0,id.length());
+            openaireId = new BigInteger(1,m.digest()).toString(16);
+        } catch (NoSuchAlgorithmException e) {
+            logger.error("Couldn't instatiate md5 algorithm",e);
+        }
+        openaireId ="user:claim__"+openaireId;
+        return openaireId;
+    }
+
+}
+
+/**
+ * The following classes display the crossref structure of API response
+ * They are used for parsing the json CrossrefResponse
+ */
+
+class CrossrefResponse {
+    String status;
+    Message message;
+
+    public String getStatus() {
+        return status;
+    }
+
+    public Message getMessage() {
+        return message;
+    }
+    class Message{
+        List<Item> items;
+
+        public List<Item> getItems() {
+            return items;
+        }
+
+        class Item {
+            private String DOI;
+            private List<String> title;
+            private List<Author> author;
+            private String Url;
+            private String type;
+            private String source;
+
+            public String getDOI() {
+                return DOI;
+            }
+
+            public List<String> getTitle() {
+                return title;
+            }
+
+            public List<Author> getAuthor() { return author;}
+
+            public String getUrl() {
+                return Url;
+            }
+
+            public String getType() {
+                return type;
+            }
+
+            public String getSource() {
+                return source;
+            }
+
+            class Author {
+                String given;
+                String family;
+
+                public String getGiven() {
+                    return given;
+                }
+
+                public String getFamily() {
+                    return family;
+                }
+
+            }
+        }
+    }
+}
+
+class DataciteResponse {
+
+    Data data;
+
+    public Data getData() {
+        return data;
+    }
+
+    class Data{
+
+
+            private Attributes attributes;
+
+            public Attributes getAttributes() {
+                return attributes;
+            }
+
+            class Attributes{
+                private String doi;
+                private String containerTitle;
+                private String published;
+                private String title;
+                private List<Author> author;
+
+                public String getDoi() {
+                    return doi;
+                }
+
+                public String getContainerTitle() {
+                    return containerTitle;
+                }
+
+                public String getPublished() {
+                    return published;
+                }
+
+                public String getTitle() {
+                    return title;
+                }
+
+                public List<Author> getAuthor() {
+                    return author;
+                }
+            }
+            class Author {
+                String given;
+                String family;
+                String literal;
+
+                public String getGiven() {
+                    return given;
+                }
+
+                public String getFamily() {
+                    return family;
+                }
+
+                public String getLiteral() {
+                    return literal;
+                }
+            }
+        }
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/OafParser.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/OafParser.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/OafParser.java	(revision 47503)
@@ -0,0 +1,252 @@
+package eu.dnetlib.data.claims.migration.parser;
+
+import eu.dnetlib.data.claims.migration.Migration;
+import eu.dnetlib.data.claims.migration.entity.Project;
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+
+/**
+ * Created by kiatrop on 5/2/2016.
+ */
+public class OafParser {
+    /**
+     * For external url: returns http://dx.doi.org/ +doi else the first url from websource
+     *
+     * @param oaf
+     * @return
+     * @throws ParserConfigurationException
+     * @throws IOException
+     * @throws SAXException
+     * @throws XPathExpressionException
+     * @throws TransformerException
+     */
+
+    private static final Logger logger = Logger.getLogger(OafParser.class);
+
+    public static Result oaf2Result(String oaf) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException, TransformerException {
+        Result result = null;
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        InputSource is = new InputSource(new StringReader(oaf));
+        Document document= dBuilder.parse(is);
+        XPathFactory xPathfactory= XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+
+        String size = null;
+        NodeList nl = (NodeList) xpath.compile("/response/header/total/text()").evaluate(document, XPathConstants.NODESET);
+        if (nl.getLength() > 0) {
+            size= nl.item(0).getNodeValue();
+        }
+        if(size!=null && Integer.parseInt(size)>0){
+            result = new Result();
+            nl = (NodeList) xpath.compile("//objIdentifier/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                result.setOpenaireId(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//resulttype/@classid").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                result.setResultType(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//bestlicense/@classid").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                result.setBestLicense(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//embargoenddate/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                result.setEmbargoEndDate(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//title/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                result.setTitle(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//pid[@classid='doi']/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                result.setDoi(nl.item(0).getNodeValue());
+                result.setExternalUrl("http://dx.doi.org/" + result.getDoi());
+            }
+            if(result.getExternalUrl()==null){
+//                nl = (NodeList) xpath.compile("//webresource/url/text()").evaluate(document, XPathConstants.NODESET);
+//                if (nl.getLength() > 0) {
+//                    result.setExternalUrl(nl.item(0).getNodeValue());
+//                }
+                nl = (NodeList) xpath.compile("//children/instance/licence[@classid='OPEN']").evaluate(document, XPathConstants.NODESET);
+                if (nl.getLength() > 0) {
+                    NodeList list = (NodeList) xpath.compile("./webresource/url/text()").evaluate(nl.item(0).getParentNode(), XPathConstants.NODESET);
+                    if (list.getLength() > 0) {
+                        result.setExternalUrl(list.item(0).getNodeValue());
+                    }
+                }else{
+                    nl = (NodeList) xpath.compile("//children/instance/licence[@classid='EMBARGO']").evaluate(document, XPathConstants.NODESET);
+                    if (nl.getLength() > 0) {
+                        NodeList list = (NodeList) xpath.compile("./webresource/url/text()").evaluate(nl.item(0).getParentNode(), XPathConstants.NODESET);
+                        if (list.getLength() > 0) {
+                            result.setExternalUrl(list.item(0).getNodeValue());
+                        }
+                    }else{
+                        nl = (NodeList) xpath.compile("//children/instance/licence[@classid='CLOSED']").evaluate(document, XPathConstants.NODESET);
+                        if (nl.getLength() > 0) {
+                            NodeList list = (NodeList) xpath.compile("./webresource/url/text()").evaluate(nl.item(0).getParentNode(), XPathConstants.NODESET);
+                            if (list.getLength() > 0) {
+                                result.setExternalUrl(list.item(0).getNodeValue());
+                            }
+                        }
+                    }
+                }
+            }
+            nl = (NodeList) xpath.compile("//pid[@classid='pmc']/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                result.setPmcid(nl.item(0).getNodeValue());
+
+            }
+            nl = (NodeList) xpath.compile("//pid[@classid='orcidworkid']/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                result.setOrcidworkid(nl.item(0).getNodeValue());
+
+            }
+            nl = (NodeList) xpath.compile("//pid[@classid='oai']/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                result.setOai(nl.item(0).getNodeValue());
+
+            }
+            nl = (NodeList) xpath.compile("//provenanceaction[@classid='user:claim:datacite']/@classid").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                result.setProvenanceaction(nl.item(0).getNodeValue());
+
+            }
+            nl = (NodeList) xpath.compile("//response/header").evaluate(document, XPathConstants.NODESET);
+            if(nl.getLength()>0){
+                    nl.item(0).getParentNode().removeChild(nl.item(0));
+            }
+
+            nl = (NodeList) xpath.compile("//rels/rel/to[@class='hasAuthor']").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                for (int i = 0; i < nl.getLength(); i++) {
+                    String ranking = ((Element)(nl.item(i).getParentNode())).getElementsByTagName("ranking").item(0).getTextContent();
+                    String fullname =  (((Element)(nl.item(i).getParentNode())).getElementsByTagName("fullname").item(0).getTextContent().replace(",", " "));
+                    result.getAuthors().put(ranking,fullname);
+                }
+
+            }
+
+            DOMSource domSource = new DOMSource(document);
+            StringWriter writer = new StringWriter();
+            StreamResult streamResult = new StreamResult(writer);
+            TransformerFactory tf = TransformerFactory.newInstance();
+            Transformer transformer = tf.newTransformer();
+            transformer.transform(domSource, streamResult);
+             result.setMetadataRecord(writer.toString());
+            result.setCollectedFrom(ClaimUtils.COLLECTED_FROM_OPENAIRE);
+            result.setRecordFormat(ClaimUtils.FORMAT_XML);
+//            result.setFound(true);
+
+        }
+        return result;
+    }
+
+
+    public static Project oaf2Project(String oaf) throws Exception {
+        Project project = null;
+        if(oaf == null ){
+            return null;
+
+        }
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = null;
+        try {
+            dBuilder = dbFactory.newDocumentBuilder();
+
+
+        InputSource is = new InputSource(new StringReader(oaf));
+        Document document = dBuilder.parse(is);
+        XPathFactory xPathfactory= XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+
+        String size = null;
+        NodeList nl = (NodeList) xpath.compile("/response/header/total/text()").evaluate(document, XPathConstants.NODESET);
+        if (nl.getLength() > 0) {
+            size= nl.item(0).getNodeValue();
+        }
+        if(size!=null && Integer.parseInt(size)>0){
+            project = new Project();
+            nl = (NodeList) xpath.compile("//objIdentifier/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                project.setOpenaireId(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//title/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                project.setName(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//acronym/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                project.setAcronym(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//funder/name/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                project.setFunderName(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//funder/shortname/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                project.setFunderShortName(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//funder/id/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                project.setFunderId(nl.item(0).getNodeValue());
+            }
+
+            nl = (NodeList) xpath.compile("//funding_level_0/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                project.setFundingStreamLevel0(nl.item(0).getNodeValue());
+            }
+
+            nl = (NodeList) xpath.compile("//code/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                project.setCode(nl.item(0).getNodeValue());
+            }
+
+            nl = (NodeList) xpath.compile("//rels/rel/to[@class='hasContact']").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                project.setContactEmails(new ArrayList<String>());
+                for (int i = 0; i < nl.getLength(); i++) {
+                    if(((Element)(nl.item(i).getParentNode())).getElementsByTagName("email").getLength() > 0) {
+                        String email = ((Element) (nl.item(i).getParentNode())).getElementsByTagName("email").item(0).getTextContent();
+                        project.getContactEmails().add(email);
+                    }
+                }
+            }
+
+//            project.setFound(true);
+
+        }
+        } catch (Exception e) {
+           logger.error("Error while parsing project",e);
+            throw new Exception(e);
+        }
+
+        return project;
+
+    }
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/DMFParser.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/DMFParser.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/DMFParser.java	(revision 47503)
@@ -0,0 +1,206 @@
+package eu.dnetlib.data.claims.migration.parser;
+
+import eu.dnetlib.data.claims.migration.entity.Context;
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claims.migration.handler.DirectIndexHandler;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import eu.dnetlib.data.claimsDemo.ContextUtils;
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import java.io.IOException;
+import java.io.StringReader;
+
+/**
+ * Created by kiatrop on 5/2/2016.
+ */
+public class DMFParser {
+    private static final Logger logger = Logger.getLogger(DMFParser.class);
+
+    public static Result dmf2Result(String xml) throws ParserConfigurationException, IOException, SAXException {
+        Result r = new Result();
+        r.setMetadataRecord(xml);
+        r.setRecordFormat(ClaimUtils.FORMAT_XML);
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        InputSource inputSource = new InputSource(new StringReader(xml));
+        Document document = dBuilder.parse(inputSource);
+        XPathFactory xPathfactory = XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+        try {
+            NodeList nl = (NodeList) xpath.compile("//*[local-name()=\"identifier\"][@identifierType='doi']/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                r.setDoi(nl.item(0).getNodeValue());
+                r.setExternalUrl("http://dx.doi.org/" + r.getDoi());
+            }
+            nl = (NodeList) xpath.compile("//*[local-name()=\"identifier\"][@identifierType='orcidworkid']/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                r.setOrcidworkid(nl.item(0).getNodeValue());
+            }
+
+            // DON'T DELETE following lines for orcidworkid!!
+            // @identiferType typo is made on purpose -> there are dmf xml with this typo.
+            if (r.getMetadataRecord().contains("@identiferType='orcidworkid'")) {
+                r.setMetadataRecord(r.getMetadataRecord().replace("@identiferType='orcidworkid'", "@identifierType='orcidworkid'"));
+                nl = (NodeList) xpath.compile("//*[local-name()=\"identifier\"][@identiferType='orcidworkid']/text()").evaluate(document, XPathConstants.NODESET);
+                if (nl.getLength() > 0) {
+                    r.setOrcidworkid(nl.item(0).getNodeValue());
+                }
+            }
+            nl = (NodeList) xpath.compile("//*[local-name()='objIdentifier']/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                r.setOpenaireId(nl.item(0).getNodeValue());
+            }
+            if(r.getExternalUrl() == null) {
+                nl = (NodeList) xpath.compile("//*[local-name()='identifier']/text()").evaluate(document, XPathConstants.NODESET);
+                if (nl.getLength() > 0) {
+                    r.setExternalUrl(nl.item(0).getNodeValue());
+                }
+            }
+            nl = (NodeList) xpath.compile("//*[local-name()='accessrights']/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                r.setAccessRights(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//embargoenddate/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                r.setEmbargoEndDate(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//*[local-name()='title']/text()").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                r.setTitle(nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//*[local-name()='collectedFrom']/@id").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                r.setCollectedFrom(nl.item(0).getNodeValue());
+            }
+
+        } catch (Exception e) {
+            logger.error("Error Parsing dmf result:\n "+xml,e);
+            return null;
+
+        }
+        return r;
+    }
+
+
+    /**
+     *
+     * @param xml of a context DMF
+     * @return context id
+     * @throws ParserConfigurationException
+     * @throws IOException
+     * @throws SAXException
+     * @throws XPathExpressionException
+     */
+    public  static String getContextIdFromDMF(String xml) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException {
+        String id=null;
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        InputSource inputSource = new InputSource(new StringReader(xml));
+        Document document = dBuilder.parse(inputSource);
+        XPathFactory xPathfactory = XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+
+        NodeList nl = (NodeList) xpath.compile("//*[local-name()='concept']/@id").evaluate(document, XPathConstants.NODESET);
+        if (nl.getLength() > 0) {
+            id = (nl.item(0).getNodeValue());
+        }
+
+        return id;
+    }
+    /**
+     *
+     * @param xml
+     * @return DOI
+     * @throws ParserConfigurationException
+     * @throws IOException
+     * @throws SAXException
+     * @throws XPathExpressionException
+     */
+    public static String getDOIIdentifierFromDMF(String xml) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException {
+        String id=null;
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        InputSource inputSource = new InputSource(new StringReader(xml));
+        Document document = dBuilder.parse(inputSource);
+        XPathFactory xPathfactory = XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+
+                NodeList nl = (NodeList) xpath.compile("//*[local-name()=\"identifier\"][@identifierType='doi']/text()").evaluate(document, XPathConstants.NODESET);
+                if (nl.getLength() > 0) {
+                    id = (nl.item(0).getNodeValue());
+                }
+
+        return id;
+    }
+
+    public static String getOrcidworkIdentifierFromDMF(String xml) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException {
+        String id=null;
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        InputSource inputSource = new InputSource(new StringReader(xml));
+        Document document = dBuilder.parse(inputSource);
+        XPathFactory xPathfactory = XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+
+        NodeList nl = (NodeList) xpath.compile("//*[local-name()=\"identifier\"][@identifierType='orcidworkid']/text()").evaluate(document, XPathConstants.NODESET);
+                if (nl.getLength() > 0) {
+                    id = (nl.item(0).getNodeValue());
+                }
+
+                // DON'T DELETE following lines for orcidworkid!!
+                // @identiferType typo is made on purpose -> there are dmf xml with this typo.
+                if (id== null) {
+                     nl = (NodeList) xpath.compile("//*[local-name()=\"identifier\"][@identiferType='orcidworkid']/text()").evaluate(document, XPathConstants.NODESET);
+                    if (nl.getLength() > 0) {
+                        id = nl.item(0).getNodeValue();
+                    }
+                }
+
+        return id;
+    }
+    public static String getAccessRightsFromDMF(String xml) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException {
+        String accessRights=null;
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        InputSource inputSource = new InputSource(new StringReader(xml));
+        Document document = dBuilder.parse(inputSource);
+        XPathFactory xPathfactory = XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+
+        NodeList nl;
+        nl = (NodeList) xpath.compile("//*[local-name()='accessrights']/text()").evaluate(document, XPathConstants.NODESET);
+        if (nl.getLength() > 0) {
+            accessRights=nl.item(0).getNodeValue();
+        }
+        return accessRights;
+    }
+
+    public static String getEmbargoEndDateFromDMF(String xml) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException {
+        String embargoDate=null;
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        InputSource inputSource = new InputSource(new StringReader(xml));
+        Document document = dBuilder.parse(inputSource);
+        XPathFactory xPathfactory = XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+
+        NodeList nl;
+        nl = (NodeList) xpath.compile("//embargoenddate/text()").evaluate(document, XPathConstants.NODESET);
+        if (nl.getLength() > 0) {
+            embargoDate=nl.item(0).getNodeValue();
+        }
+        return embargoDate;
+    }
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/RelationParser.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/RelationParser.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/parser/RelationParser.java	(revision 47503)
@@ -0,0 +1,123 @@
+package eu.dnetlib.data.claims.migration.parser;
+
+import eu.dnetlib.data.claims.migration.entity.Relation;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathFactory;
+import java.io.StringReader;
+
+/**
+ * Created by kiatrop on 5/2/2016.
+ */
+public class RelationParser {
+
+    private static final Logger logger = Logger.getLogger(RelationParser.class);
+
+    static public Relation xml2Relation(String xml) {
+        String relationType = "";
+        String sourceId = ""; //Annotation source
+        String targetId = ""; //Annotation target
+
+        try {
+            DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+            DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+            InputSource inputSource = new InputSource(new StringReader(xml));
+            Document document = dBuilder.parse(inputSource);
+            XPathFactory xPathfactory = XPathFactory.newInstance();
+            XPath xpath = xPathfactory.newXPath();
+            NodeList nl = (NodeList) xpath.compile("//RELATION/@type").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                relationType = (nl.item(0).getNodeValue());
+            }
+            nl = (NodeList) xpath.compile("//RELATION/@source").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                targetId = (nl.item(0).getNodeValue());
+                if (targetId != null && targetId.contains("|")) {
+                    targetId = targetId.split("\\|")[1];
+                }
+            }
+            nl = (NodeList) xpath.compile("//RELATION/@target").evaluate(document, XPathConstants.NODESET);
+            if (nl.getLength() > 0) {
+                sourceId = (nl.item(0).getNodeValue());
+                if (sourceId != null && sourceId.contains("|")) {
+                    sourceId = sourceId.split("\\|")[1];
+                }
+            }
+
+        } catch (Exception e) {
+            logger.error("Unable to parse Relation XML: " + xml);
+            //TODO update report file
+            return null;
+        }
+
+        Relation relation = new Relation();
+        relation.setTargetType(getTargetType(relationType));
+        relation.setTargetId(targetId);
+        relation.setSourceType(getSourceType(relationType));
+        relation.setSourceId(sourceId);
+
+        return relation;
+    }
+
+    /*
+        Get the type of the target of an annotation /
+        Get the type of the source of a claim /
+     */
+    private static String getTargetType(String relationType) {
+        String sourceType = ClaimUtils.PUBLICATION;
+
+        if (relationType.equals("resultResult_publicationpublication_isRelatedTo")) {
+            sourceType = ClaimUtils.PUBLICATION;
+
+        } else if (relationType.equals("resultResult_publicationdataset_isRelatedTo")) {
+            sourceType = ClaimUtils.PUBLICATION;
+
+        } else if (relationType.equals("resultProject")) {
+            sourceType = ClaimUtils.PUBLICATION;
+
+            //could be a dataset too
+        } else if (relationType.equals("resultResult_datasetpublication_isRelatedTo")) {
+            sourceType = ClaimUtils.DATASET;
+
+        } else if (relationType.equals("resultResult_datasetdataset_isRelatedTo")) {
+            sourceType = ClaimUtils.DATASET;
+        }
+
+        return sourceType;
+    }
+
+    /*
+        Get the type of the body of an annotation /
+        Get the type of the target of a claim /
+    */
+    private static String getSourceType(String relationType) {
+        String sourceType = ClaimUtils.PUBLICATION;
+
+        if (relationType.equals("resultResult_publicationpublication_isRelatedTo")) {
+            sourceType = ClaimUtils.PUBLICATION;
+
+        } else if (relationType.equals("resultResult_publicationdataset_isRelatedTo")) {
+            sourceType = ClaimUtils.DATASET;
+
+        } else if (relationType.equals("resultProject")) {
+            sourceType = ClaimUtils.PROJECT;
+
+            //could be a dataset too
+        } else if (relationType.equals("resultResult_datasetpublication_isRelatedTo")) {
+            sourceType = ClaimUtils.PUBLICATION;
+
+        } else if (relationType.equals("resultResult_datasetdataset_isRelatedTo")) {
+            sourceType = ClaimUtils.DATASET;
+        }
+
+        return sourceType;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Migration.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Migration.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Migration.java	(revision 47503)
@@ -0,0 +1,422 @@
+package eu.dnetlib.data.claims.migration;
+
+import eu.dnetlib.data.claims.migration.entity.*;
+import eu.dnetlib.data.claims.migration.handler.*;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import eu.dnetlib.data.claimsDemo.SQLStoreException;
+import org.apache.log4j.Logger;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
+
+import java.io.*;
+import java.math.BigInteger;
+import java.security.MessageDigest;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by kiatrop on 4/2/2016.
+ */
+
+public class Migration {
+    private static final Logger logger = Logger.getLogger(Migration.class);
+
+    RelationHandler relationHandler = null;
+    ContextRelationHandler contextRelationHandler = null;
+    ProjectHandler projectHandler = null;
+    DMFContextHandler dmfContextHandler = null;
+    DMFResultHandler dmfResultHandler = null;
+    IndexResultHandler indexResultHandler = null;
+    ExternalRecordHandler externalRecordHandler = null;
+    ResultHandler resultHandler = null;
+
+    ClaimHandler claimHandler = null;
+    ClaimValidation claimValidation = new ClaimValidation();
+
+
+    public Migration() {
+        ApplicationContext context = new ClassPathXmlApplicationContext("eu/dnetlib/data/claims/migration/springContext-claimsDemo.xml");
+        relationHandler = context.getBean(RelationHandler.class);
+        contextRelationHandler = context.getBean(ContextRelationHandler.class);
+        projectHandler = context.getBean(ProjectHandler.class);
+        dmfContextHandler = context.getBean(DMFContextHandler.class);
+        dmfResultHandler = context.getBean(DMFResultHandler.class);
+        externalRecordHandler = context.getBean(ExternalRecordHandler.class);
+        indexResultHandler = context.getBean(IndexResultHandler.class);
+        resultHandler = context.getBean(ResultHandler.class);
+        claimHandler = context.getBean(ClaimHandler.class);
+        claimValidation = context.getBean(ClaimValidation.class);
+
+    }
+
+
+    public List<Claim> createRelationsClaims() throws Exception, SQLStoreException {
+
+
+        List<Relation> relations = relationHandler.fetchAllRelations();
+        List<Claim> claims = new ArrayList<Claim>();
+        for (Relation relation : relations) {
+
+            Claim claim= new Claim();
+
+            claim.setUserMail(relation.getClaimedBy());
+            claim.setDate(relation.getClaimDate());
+            claim.setId(relation.getClaimId());
+            System.out.println("Claim id:" + claim.getId());
+            OpenaireEntity source = null;
+            //first work with the Source
+            if (relation.getSourceType().equals(ClaimUtils.PROJECT)) {
+                source= buildProject(relation.getSourceId(),relation.getClaimId());
+                claim.setSourceType(ClaimUtils.PROJECT);
+            } else if (relation.getSourceType().equals(ClaimUtils.CONTEXT)) {
+                Context context = dmfContextHandler.fetchContextByIdFromDmf(relation.getSourceId());
+                source = context;
+                claim.setSourceType(ClaimUtils.CONTEXT);
+            } else if (relation.getSourceType().equals(ClaimUtils.DATASET) || relation.getSourceType().equals(ClaimUtils.PUBLICATION)) {
+                Result result = buildResult(relation.getDmf(), relation.getCollectedFrom(), relation.getSourceId(), relation.getClaimId());
+                source = result;
+                claim.setSourceType(result.getResultType());
+            }
+            claim.setSource(source);
+
+            Result target = null;
+            if (relation.getTargetType().equals(ClaimUtils.DATASET) || relation.getTargetType().equals(ClaimUtils.PUBLICATION)) {
+                target = buildResult(relation.getDmf(), relation.getCollectedFrom(), relation.getTargetId(), relation.getClaimId());
+
+            }
+            if( target != null) {
+                claim.setTarget(target);
+                claim.setTargetType(target.getResultType());
+            }
+            if(claimValidation.validateClaim(claim)){ // is valid
+//                System.out.println(claim);
+                claims.add(claim);
+            }
+
+        }
+        return claims;
+
+    }
+    public List<Claim> createContextRelationClaims() throws Exception, SQLStoreException {
+
+
+        List<ContextRelation> relations = contextRelationHandler.fetchAllConceptRelations();
+        List<Claim> claims = new ArrayList<Claim>();
+        for (ContextRelation relation : relations) {
+
+            Claim claim= new Claim();
+            claim.setId(relation.getClaimId());
+            claim.setUserMail(relation.getClaimedBy());
+            claim.setDate(relation.getClaimDate());
+            System.out.println("Claim id:" + claim.getId());
+
+            //first work with the Source
+            Context context = dmfContextHandler.extractContextFromDMF(relation.getContextDmf());
+            claim.setSourceType(ClaimUtils.CONTEXT);
+            claim.setSource(context);
+
+            Result target =  buildResult(relation.getResultDmf(), relation.getCollectedFrom(), relation.getResultId(), relation.getClaimId());
+            if( target != null){
+                claim.setTarget(target);
+                claim.setTargetType(target.getResultType());
+            }
+            if(claimValidation.validateClaim(claim)){ // is valid
+                claims.add(claim);
+            }
+
+        }
+        return claims;
+
+
+    }
+
+    /**
+     *Returns a project from Openaire.
+     * In case the project id has a "welcometrust" prefix changes it to "wt__________", before search for it in the index.
+     *
+     * @param projectId
+     * @param claimId
+     * @return Project
+     * @throws Exception
+     */
+    public Project buildProject(String projectId, String claimId) throws Exception {
+        String id = projectId;
+        if(projectId != null && projectId.contains("welcometrust")){
+            id=projectId.replace("welcometrust","wt__________");
+        }
+        Project project = projectHandler.fetchProjectByID(id);
+        if (project == null) {
+            try{
+                PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("missing_projects.txt", true)));
+                Date date= new java.util.Date();
+                out.println(new Timestamp(date.getTime())+"  ProjectId: "+id+ " ClaimId: "+claimId);
+                out.close();
+            }catch (IOException e) {
+                logger.error("Couldn't write to file " + "missing_projects.txt",e);
+            }
+        }
+        return project;
+
+    }
+    /**
+     * *If there is a dmf, the result is extracted from the external sources (crossRef, Datacite, Orcid)
+     * Otherwise Result is extracted from Openaire
+     * @param dmf
+     * @param collectedFrom
+     * @param resultId
+     * @param claimId
+     * @return Result or null
+     */
+    private Result buildResult(String dmf, String collectedFrom, String resultId, String claimId){
+        Result result = null;
+        String external_id= null; // testing
+        if((dmf !=null && collectedFrom != null)&& !collectedFrom.equals(ClaimUtils.COLLECTED_FROM_OPENAIRE)){
+
+            if (collectedFrom.equals(ClaimUtils.COLLECTED_FROM_CROSSREF)) {
+                try {
+                    String doi= dmfResultHandler.fetchDoiByDMF(dmf);
+                    external_id=doi;
+                    if(doi != null) {
+                        result = externalRecordHandler.fetchResultfromCrossref(doi);
+                    }
+                } catch (Exception e) {
+                    logger.error("Error fetching result from Crossref",e);
+                }
+
+            } else if (collectedFrom.equals(ClaimUtils.COLLECTED_FROM_ORCID)) {
+                try {
+                    String orcidwork= dmfResultHandler.fetchOrcidWorkByDMF(dmf);
+                    external_id=orcidwork;
+                     if(orcidwork != null) {
+                        result = externalRecordHandler.fetchResultfromOrcid(orcidwork);
+                    }
+                } catch (Exception e) {
+                    logger.error("Error fetching result from Orcid",e);
+                }
+            } else if (collectedFrom.equals(ClaimUtils.COLLECTED_FROM_DATACITE)) {
+                try {
+                    String doi= dmfResultHandler.fetchDoiByDMF(dmf);
+                    external_id=doi;
+                    if(doi != null) {
+                        result = externalRecordHandler.fetchResultfromDatacite(doi);
+                    }
+                } catch (Exception e) {
+                    logger.error("Error fetching result from Datacite",e);
+                }
+            }
+            if(result == null){
+                //report missing external results
+                try{
+                    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(claimValidation.getPathToSaveReport()+"missing_results_external_sources.txt", true)));
+                    Date date= new java.util.Date();
+                    out.println(new Timestamp(date.getTime())+"  OpenaireId: "+resultId+ " collectedFrom: "+collectedFrom +" externalId: "+external_id+" claimId: "+claimId);
+                    out.close();
+                }catch (IOException e) {
+                    logger.error("Couldn't write to file " + "missing_results_external_sources.txt",e);
+                }
+                //give a second chance - search index
+                result = buildOpenaireResult(resultId,claimId);
+                if(result!=null) {
+                    try {
+                        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(claimValidation.getPathToSaveReport()+"external_results_found_inOpenaire.txt", true)));
+                        Date date = new java.util.Date();
+                        out.println(new Timestamp(date.getTime()) + "  OpenaireId: " + resultId + " collectedFrom: " + collectedFrom + " externalId: " + external_id + " claimId: " + claimId);
+                        out.close();
+                    } catch (IOException e) {
+                        logger.error("Couldn't write to file " + "external_results_found_inOpenaire.txt",e);
+                    }
+                }
+
+            }
+            if(result!=null){
+                // if result found enriched with access rights/ embargo date from DMF
+                try {
+                    result.setAccessRights(dmfResultHandler.fetchAccessRights(dmf));
+                    result.setEmbargoEndDate(dmfResultHandler.fetchEmbargoEndDateByDMF(dmf));
+                } catch (Exception e) {
+                    logger.error("Error fetching Access or Embargo end date from DMF",e);
+                }
+            }
+        } else { //If dmf/ collecteFrom  is null or is collected from openaire search in the  index
+            result = buildOpenaireResult(resultId,claimId);
+        }
+
+
+        return result;
+    }
+
+    /**
+     *
+     * @param resultId
+     * @param claimId
+     * @return target Result from Openaire or null
+     */
+    public Result buildOpenaireResult(String resultId, String claimId  ){
+
+        Result result = null;
+
+        try {
+           result = indexResultHandler.fetchResultById(resultId);
+        } catch (Exception e) {
+            logger.error("Error fetching result from Openaire",e);
+        }
+
+        //If it is not found in the index
+        if (result == null) {
+           //give a second chance as dedup
+            try {
+                result = indexResultHandler.fetchDedupResultById(resultId);
+            } catch (Exception e) {
+                logger.error("Error fetching dedup Result",e);
+            }
+            if (result != null) {
+                try {
+                    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(claimValidation.getPathToSaveReport()+"dedup_results_found.txt", true)));
+                    Date date = new java.util.Date();
+                    out.println(new Timestamp(date.getTime()) + "  OpenaireId: " + resultId + " claimId: " + claimId);
+                    out.close();
+                } catch (IOException e) {
+                    logger.error("Couldn't write to file " + "external_results_found_inOpenaire.txt",e);
+                }
+            }else {
+                //report it as missing
+                try {
+                    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(claimValidation.getPathToSaveReport()+"missing_results.txt", true)));
+                    Date date = new java.util.Date();
+                    out.println(new Timestamp(date.getTime()) + "  OpenaireId: " + resultId + " ClaimId: " + claimId);
+                    out.close();
+                } catch (IOException e) {
+                    logger.error("Couldn't write to file " + "missing_results.txt",e);
+                }
+            }
+
+        }else{
+            //FOUND report results that came from datacite but are publications
+            //TODO deal with them as externals?
+
+            if(result.getProvenanceaction() != null && result.getProvenanceaction().equals("user:claim:datacite")&&result.getOai()!=null){
+                try{
+                    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(claimValidation.getPathToSaveReport()+"datacite_claim_results.txt", true)));
+                    Date date= new java.util.Date();
+                    out.println(new Timestamp(date.getTime())+"  openaireId:"+resultId+" aoi: " +result.getOai() +" provenanceactions: "+result.getProvenanceaction()+" type: "+result.getResultType()+ " ClaimId: "+claimId);
+                    out.close();
+                    try {
+                        result= externalRecordHandler.fetchResultfromDatacite(result.getOai());
+                        result.setOpenaireId(resultId);
+                    }catch(Exception e){
+                        logger.error("Couldn't get Result from Datacite "+result.getOai(),e);
+                    }
+                }catch (IOException e) {
+                    logger.error("Couldn't write to file " + "datacite_claim_results.txt",e);
+                }
+
+            }
+        }
+
+        return result;
+    }
+
+
+    /**
+     * For each claim of the list
+     * if there are results in the relation exports their metadaa file
+     * Save the claim in DB
+     * @param claims
+     * @throws Exception
+     */
+    private void saveClaims(List<Claim> claims) throws Exception, SQLStoreException {
+        for(Claim claim : claims){
+           /* if(claim.getTargetType().equals(ClaimUtils.DATASET)||claim.getTargetType().equals(ClaimUtils.PUBLICATION)){
+                String path = resultHandler.exportMetadataFileForResult((Result)claim.getTarget());
+                ((Result) claim.getTarget()).setRecordPath(path);
+            }
+            if(claim.getSourceType().equals(ClaimUtils.DATASET)||claim.getSourceType().equals(ClaimUtils.PUBLICATION)){
+                String path = resultHandler.exportMetadataFileForResult((Result)claim.getSource());
+                ((Result) claim.getSource()).setRecordPath(path);
+            }*/
+            claim = claimHandler.exportMedatataForClaim(claim);
+            claimHandler.saveClaim(claim);
+        }
+
+    }
+
+
+
+    public static void main(String[] args) throws IOException {
+
+        Migration migration = new Migration();
+        try {
+            migration.claimHandler.getQueryGenerator().setMigrationTable("claims_view");
+            List<Claim> claims = null;
+            claims = migration.createContextRelationClaims();
+//            claims = migration.createRelationsClaims();
+
+            migration.printStatistics(claims);
+            migration.saveClaims(claims);
+
+        } catch (Exception e) {
+            logger.error("Error in migration",e);
+        } catch (SQLStoreException e) {
+            e.printStackTrace();
+        }
+
+    }
+    public void printStatistics(List<Claim> claims){
+
+        //testing
+        List<Claim> claimsOp= new ArrayList<Claim>();
+        List<Claim> claimsCr= new ArrayList<Claim>();
+        List<Claim> claimsDat= new ArrayList<Claim>();
+        List<Claim> claimsOrc= new ArrayList<Claim>();
+        Integer targetOp=0;
+        Integer targetCr=0;
+        Integer targetDat=0;
+        Integer targetOrc=0;
+        Integer sourceRes=0;
+        Integer sourceOp=0;
+        Integer sourceCr=0;
+        Integer sourceDat=0;
+        Integer sourceOrc=0;
+        Integer projects=0;
+        Integer contexts=0;
+        Integer totalClaims=0;
+        for(Claim claim: claims){
+//            System.out.println(claim.toString());
+            if(((Result)claim.getTarget()).getCollectedFrom().equals(ClaimUtils.COLLECTED_FROM_CROSSREF)){
+                targetCr++;
+            }else if(((Result)claim.getTarget()).getCollectedFrom().equals(ClaimUtils.COLLECTED_FROM_DATACITE)){
+                targetDat++;
+            }else if(((Result)claim.getTarget()).getCollectedFrom().equals(ClaimUtils.COLLECTED_FROM_ORCID)){
+                targetOrc++;
+            }else {
+                targetOp++;
+            }
+            if(claim.getSourceType().equals(ClaimUtils.PUBLICATION)||claim.getSourceType().equals(ClaimUtils.DATASET)){
+                sourceRes++;
+                if(((Result)claim.getSource()).getCollectedFrom().equals(ClaimUtils.COLLECTED_FROM_CROSSREF)){
+                    sourceCr++;
+                }else if(((Result)claim.getSource()).getCollectedFrom().equals(ClaimUtils.COLLECTED_FROM_DATACITE)){
+                    sourceDat++;
+                }else if(((Result)claim.getSource()).getCollectedFrom().equals(ClaimUtils.COLLECTED_FROM_ORCID)){
+                    sourceOrc++;
+                }else {
+                    sourceOp++;
+                }
+            }else if(claim.getSourceType().equals(ClaimUtils.PROJECT)) {
+                projects++;
+            }else if(claim.getSourceType().equals(ClaimUtils.CONTEXT)){
+                contexts++;
+            }
+        }
+        totalClaims=claims.size();
+        System.out.println("\n\nTargets:\n\nCrossref : "+targetCr+ " DataCite :"+targetDat+" Orcid : "+targetOrc+" OpenAire : "+targetOp);
+        System.out.println("\n\nSources:\n\nAll : "+sourceRes+" Crossref : "+sourceCr+ " DataCite :"+sourceDat+" Orcid : "+sourceOrc+" OpenAire : "+sourceOp);
+        System.out.println("\n\nTotalClaims: "+totalClaims+" Projects: "+projects+ " Contexts :"+contexts);
+
+    }
+
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Context.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Context.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Context.java	(revision 47503)
@@ -0,0 +1,39 @@
+package eu.dnetlib.data.claims.migration.entity;
+
+/**
+
+
+ import eu.dnetlib.data.claims.migration.entity.OpenaireEntity; Created by kiatrop on 20/11/2015.
+ */
+public class Context implements   OpenaireEntity{
+private String title;
+    private String openaireId;
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getOpenaireId() {
+        return openaireId;
+    }
+
+    public void setOpenaireId(String openaireId) {
+        this.openaireId = openaireId;
+    }
+
+    /*private String export(){
+        return "";
+    }*/
+
+    @Override
+    public String toString() {
+        return "Context{" +
+                "title='" + title + '\'' +
+                ", openaireId='" + openaireId + '\'' +
+                '}';
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Project.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Project.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Project.java	(revision 47503)
@@ -0,0 +1,131 @@
+package eu.dnetlib.data.claims.migration.entity;
+
+import java.util.List;
+
+/**
+
+
+ import eu.dnetlib.data.claims.migration.entity.OpenaireEntity; Created by kiatrop on 20/11/2015.
+ */
+public class Project implements  OpenaireEntity{
+    private String name;
+    private String acronym;
+    private String openaireId;
+    private String code;
+    private String funderName;
+    private String funderShortName;
+    private String funderId;
+    private String token;
+    private List<String> contactEmails;
+    private String fundingStreamLevel0;
+
+//    private boolean found=true;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAcronym() {
+        return acronym;
+    }
+
+    public void setAcronym(String acronym) {
+        this.acronym = acronym;
+    }
+
+    public String getOpenaireId() {
+        return openaireId;
+    }
+
+    public void setOpenaireId(String openaireId) {
+        this.openaireId = openaireId;
+     }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getFunderName() {
+        return funderName;
+    }
+
+    public void setFunderName(String funderName) {
+        this.funderName = funderName;
+    }
+
+    public String getFunderId() {
+        return funderId;
+    }
+
+    public void setFunderId(String funderId) {
+        this.funderId = funderId;
+    }
+
+    public List<String> getContactEmails() {
+        return contactEmails;
+    }
+
+    public void setContactEmails(List<String> contactEmails) {
+        this.contactEmails = contactEmails;
+    }
+
+
+    public String getFundingStreamLevel0() {
+        return fundingStreamLevel0;
+    }
+
+    public void setFundingStreamLevel0(String fundingStreamLevel0) {
+        this.fundingStreamLevel0 = fundingStreamLevel0;
+    }
+
+    /*
+    public boolean isFound() {
+        return found;
+    }
+
+    public void setFound(boolean found) {
+        this.found = found;
+    }*/
+
+    public String getFunderShortName() {
+        return funderShortName;
+    }
+
+    public void setFunderShortName(String funderShortName) {
+        this.funderShortName = funderShortName;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    @Override
+    public String toString() {
+        return "Project{" +
+                "\nname='" + name + '\'' +
+                "\n, acronym='" + acronym + '\'' +
+                "\n, openaireId='" + openaireId + '\'' +
+                "\n, code='" + code + '\'' +
+                "\n, funderName='" + funderName + '\'' +
+                "\n, funderShortName='" + funderShortName + '\'' +
+                "\n, funderId='" + funderId + '\'' +
+                "\n, contactEmails=" + contactEmails +
+                "\n, fundingStreamLevel0='" + fundingStreamLevel0 + '\'' +
+                '}';
+    }
+//method to ask from API of search to get the fields
+    //then parse the fields
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Claim.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Claim.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Claim.java	(revision 47503)
@@ -0,0 +1,134 @@
+package eu.dnetlib.data.claims.migration.entity;
+
+import java.text.SimpleDateFormat;
+
+import com.google.gson.annotations.SerializedName;
+import eu.dnetlib.data.claims.migration.entity.OpenaireEntity;
+
+import java.util.Date;
+
+/**
+ * Created by kiatrop on 20/11/2015.
+ */
+ public class Claim {
+
+    private String id;
+    private String userMail;
+    private Date date;
+    private String sourceType;
+    private String targetType;
+    private String semantics;
+    private Date curationDate;
+    private String curatedBy;
+    private boolean approved;
+    private OpenaireEntity source;
+    private OpenaireEntity target;
+
+
+
+    public OpenaireEntity getTarget() {
+        return target;
+    }
+
+    public void setTarget(OpenaireEntity target) {
+        this.target = target;
+    }
+
+    public OpenaireEntity getSource() {
+        return source;
+    }
+
+    public void setSource(OpenaireEntity source) {
+        this.source = source;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getUserMail() {
+        return userMail;
+    }
+
+    public void setUserMail(String userMail) {
+        this.userMail = userMail;
+    }
+
+    public Date getDate() {
+        return date;
+    }
+
+    public void setDate(Date date) {
+        this.date = date;
+    }
+
+    public String getSourceType() {
+        return sourceType;
+    }
+
+    public void setSourceType(String sourceType) {
+        this.sourceType = sourceType;
+    }
+
+    public String getTargetType() {
+        return targetType;
+    }
+
+    public void setTargetType(String targetType) {
+        this.targetType = targetType;
+    }
+
+    public String getSemantics() {
+        return semantics;
+    }
+
+    public void setSemantics(String semantics) {
+        this.semantics = semantics;
+    }
+
+    public Date getCurationDate() {
+        return curationDate;
+    }
+
+    public void setCurationDate(Date curationDate) {
+        this.curationDate = curationDate;
+    }
+
+    public String getCuratedBy() {
+        return curatedBy;
+    }
+
+    public void setCuratedBy(String curatedBy) {
+        this.curatedBy = curatedBy;
+    }
+
+    public boolean isApproved() {
+        return approved;
+    }
+
+    public void setApproved(boolean approved) {
+        this.approved = approved;
+    }
+
+    @Override
+    public String toString() {
+        return "Claim{" +
+                "\nid='" + id + '\'' +
+                ",\n userMail='" + userMail + '\'' +
+                ",\n date=" + date +
+                ",\n sourceType='" + sourceType + '\'' +
+                ",\n targetType='" + targetType + '\'' +
+                ",\n semantics='" + semantics + '\'' +
+                ",\n curationDate='" + curationDate + '\'' +
+                ",\n curatedBy='" + curatedBy + '\'' +
+                ",\n approved=" + approved +
+                ",\ntarget={" +   ((target==null)?"null":target.toString())+
+                "},\n source={" + ((source==null)?"null":source.toString())  +
+                '}';
+    }
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Result.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Result.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Result.java	(revision 47503)
@@ -0,0 +1,223 @@
+package eu.dnetlib.data.claims.migration.entity;
+
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+
+import java.util.TreeMap;
+
+/**
+ * Created by kiatrop on 20/11/2015.
+ */
+public class Result implements  OpenaireEntity{
+    private String title;
+    private TreeMap<String, String> authors = new TreeMap<String, String>();
+
+//external url: url+doi (if doi exists) or url from websources
+    private String externalUrl;
+    private String openaireId;
+    private String doi;
+    private String orcidworkid;
+    private String pmcid;
+    //accessRights : set by user
+    private String accessRights;
+    //bestLicence : from search
+    private String bestLicense;
+
+    private String collectedFrom;
+    private String metadataRecord;
+
+//for the metadataRecord file
+    private String recordPath;
+    private String recordFormat;
+
+    private String resultType;
+//    private boolean found=false;
+    private String embargoEndDate;
+
+//Used for Datacite
+    private String oai;
+    private String provenanceaction;
+
+    public TreeMap<String, String> getAuthors() {
+        return authors;
+    }
+
+    public void setAuthors(TreeMap<String, String> authors) {
+        this.authors = authors;
+    }
+
+    public String getDoi() {
+		return doi;
+	}
+
+	public void setDoi(String doi) {
+		this.doi = doi;
+	}
+
+	public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getExternalUrl() {
+        return externalUrl;
+    }
+
+    public void setExternalUrl(String externalUrl) {
+        this.externalUrl = externalUrl;
+    }
+
+    public String getOpenaireId() {
+        return openaireId;
+    }
+
+    public void setOpenaireId(String openaire_id) {
+        this.openaireId = openaire_id;
+    }
+
+    public String getAccessRights() {
+        return accessRights;
+    }
+
+    public void setAccessRights(String accessRights) {
+        this.accessRights = accessRights;
+    }
+
+    public String getBestLicense() {
+        return bestLicense;
+    }
+
+    public void setBestLicense(String bestLicense) {
+        this.bestLicense = bestLicense;
+    }
+
+    public String getCollectedFrom() {
+        return collectedFrom;
+    }
+
+    public void setCollectedFrom(String collectedFrom) {
+        if(!collectedFrom.contains("____::")) {
+            if (collectedFrom.equals("Datacite")) {
+                collectedFrom = ClaimUtils.COLLECTED_FROM_DATACITE;
+
+            } else if (collectedFrom.equals("Crossref")) {
+                collectedFrom = ClaimUtils.COLLECTED_FROM_CROSSREF;
+
+            } else if (collectedFrom.equals("Orcid")) {
+                collectedFrom = ClaimUtils.COLLECTED_FROM_ORCID;
+
+            } else {
+                collectedFrom = ClaimUtils.COLLECTED_FROM_OPENAIRE;
+            }
+        }
+        this.collectedFrom = collectedFrom;
+    }
+
+    public String getMetadataRecord() {
+        return metadataRecord;
+    }
+
+    public void setMetadataRecord(String metadataRecord) {
+        this.metadataRecord = metadataRecord;
+    }
+
+    public String getResultType() {
+        return resultType;
+    }
+
+    public void setResultType(String resultType) {
+        this.resultType = resultType;
+    }
+
+
+
+/*    public boolean isFound() {
+        return found;
+    }
+
+    public void setFound(boolean found) {
+        this.found = found;
+    }*/
+
+    public String getPmcid() {
+        return pmcid;
+    }
+
+    public void setPmcid(String pmcid) {
+        this.pmcid = pmcid;
+    }
+
+    public String getOrcidworkid() {
+        return orcidworkid;
+    }
+
+    public void setOrcidworkid(String orcidworkid) {
+        this.orcidworkid = orcidworkid;
+    }
+
+    public String getEmbargoEndDate() {
+        return embargoEndDate;
+    }
+
+    public void setEmbargoEndDate(String embargoEndDate) {
+        this.embargoEndDate = embargoEndDate;
+    }
+
+    public String getOai() {
+        return oai;
+    }
+
+    public void setOai(String oai) {
+        this.oai = oai;
+    }
+
+    public String getProvenanceaction() {
+        return provenanceaction;
+    }
+
+    public void setProvenanceaction(String provenanceaction) {
+        this.provenanceaction = provenanceaction;
+    }
+
+    public String getRecordPath() {
+        return recordPath;
+    }
+
+    public void setRecordPath(String recordPath) {
+        this.recordPath = recordPath;
+    }
+
+    public String getRecordFormat() {
+        return recordFormat;
+    }
+
+    public void setRecordFormat(String recordFormat) {
+        this.recordFormat = recordFormat;
+    }
+
+    @Override
+    public String toString() {
+        return "\nResult{" +
+                "title='" + title + '\'' +
+                ",\n external_url='" + externalUrl + '\'' +
+                ",\n openaire_id='" + openaireId + '\'' +
+                ",\n doi='" + doi + '\'' +
+                ",\n pmcid='" + pmcid + '\'' +
+                ",\n orcidworkid='" + orcidworkid + '\'' +
+                ",\n accessRights='" + accessRights + '\'' +
+                ",\n embargoEndDate='" + embargoEndDate + '\'' +
+                ",\n bestLicense='" + bestLicense + '\'' +
+                ",\n collectedFrom='" + collectedFrom + '\'' +
+                ",\n oai='" + oai + '\'' +
+                ",\n provenanceaction='" + provenanceaction + '\'' +
+                ",\n metadataRecord='" + ((metadataRecord!=null)?metadataRecord.substring(0,60):null) + "...\'" +
+                ",\n recordPath='" + recordPath + '\'' +
+                ",\n recordFormat='" + recordFormat + '\'' +
+                ",\n resultType='" + resultType + '\'' +
+                '}';
+    }
+//method to ask from API of search to get the metadataRecord
+    //then parse the fields
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/OpenaireEntity.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/OpenaireEntity.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/OpenaireEntity.java	(revision 47503)
@@ -0,0 +1,8 @@
+package eu.dnetlib.data.claims.migration.entity;
+/**
+ * Created by argirok on 10/12/2015.
+ */
+public interface OpenaireEntity {
+    public String getOpenaireId();
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/ContextRelation.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/ContextRelation.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/ContextRelation.java	(revision 47503)
@@ -0,0 +1,95 @@
+package eu.dnetlib.data.claims.migration.entity;
+
+import java.util.Date;
+
+/**
+ * Created by argirok on 10/2/2016.
+ */
+public class ContextRelation {
+
+    private String claimId = null;
+    private String contextId = null;
+
+    private String resultId = null;
+
+    private boolean hasDMF = false;
+    private String resultDmf = null;
+    private String contextDmf = null;
+
+
+    private String collectedFrom = null;
+    private String claimedBy = null;
+    private Date claimDate = null;
+
+    public String getClaimId() {
+        return claimId;
+    }
+
+    public void setClaimId(String claimId) {
+        this.claimId = claimId;
+    }
+
+    public String getContextId() {
+        return contextId;
+    }
+
+    public void setContextId(String contextId) {
+        this.contextId = contextId;
+    }
+
+    public String getResultId() {
+        return resultId;
+    }
+
+    public void setResultId(String resultId) {
+        this.resultId = resultId;
+    }
+
+    public boolean isHasDMF() {
+        return hasDMF;
+    }
+
+    public void setHasDMF(boolean hasDMF) {
+        this.hasDMF = hasDMF;
+    }
+
+    public String getResultDmf() {
+        return resultDmf;
+    }
+
+    public void setResultDmf(String resultDmf) {
+        this.resultDmf = resultDmf;
+    }
+
+    public String getContextDmf() {
+        return contextDmf;
+    }
+
+    public void setContextDmf(String contextDmf) {
+        this.contextDmf = contextDmf;
+    }
+
+    public String getCollectedFrom() {
+        return collectedFrom;
+    }
+
+    public void setCollectedFrom(String collectedFrom) {
+        this.collectedFrom = collectedFrom;
+    }
+
+    public String getClaimedBy() {
+        return claimedBy;
+    }
+
+    public void setClaimedBy(String claimedBy) {
+        this.claimedBy = claimedBy;
+    }
+
+    public Date getClaimDate() {
+        return claimDate;
+    }
+
+    public void setClaimDate(Date claimDate) {
+        this.claimDate = claimDate;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Relation.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Relation.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/entity/Relation.java	(revision 47503)
@@ -0,0 +1,108 @@
+package eu.dnetlib.data.claims.migration.entity;
+
+/**
+ * Created by kiatrop on 5/2/2016.
+ */
+
+import java.util.Date;
+
+/**
+ * This is the old claim representation
+ */
+public class Relation {
+
+    private String claimId = null;
+    private String targetId = null;
+    private String targetType = null;
+
+    private String sourceId = null;
+    private String sourceType = null;
+
+    private boolean hasDMF = false;
+    private String dmf = null;
+
+    private String collectedFrom = null;
+
+    private String claimedBy = null;
+    private Date claimDate = null;
+
+    public String getClaimId() {
+        return claimId;
+    }
+
+    public void setClaimId(String claimId) {
+        this.claimId = claimId;
+    }
+
+    public String getTargetId() {
+        return targetId;
+    }
+
+    public void setTargetId(String targetId) {
+        this.targetId = targetId;
+    }
+
+    public String getTargetType() {
+        return targetType;
+    }
+
+    public void setTargetType(String targetType) {
+        this.targetType = targetType;
+    }
+
+    public String getSourceId() {
+        return sourceId;
+    }
+
+    public void setSourceId(String sourceId) {
+        this.sourceId = sourceId;
+    }
+
+    public String getSourceType() {
+        return sourceType;
+    }
+
+    public void setSourceType(String sourceType) {
+        this.sourceType = sourceType;
+    }
+
+    public boolean isHasDMF() {
+        return hasDMF;
+    }
+
+    public void setHasDMF(boolean hasDMF) {
+        this.hasDMF = hasDMF;
+    }
+
+    public String getCollectedFrom() {
+        return collectedFrom;
+    }
+
+    public void setCollectedFrom(String collectedFrom) {
+        this.collectedFrom = collectedFrom;
+    }
+
+    public String getClaimedBy() {
+        return claimedBy;
+    }
+
+    public void setClaimedBy(String claimedBy) {
+        this.claimedBy = claimedBy;
+    }
+
+    public Date getClaimDate() {
+        return claimDate;
+    }
+
+    public void setClaimDate(Date claimDate) {
+        this.claimDate = claimDate;
+    }
+
+    public String getDmf() {
+        return dmf;
+    }
+
+    public void setDmf(String dmf) {
+        this.dmf = dmf;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Test.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Test.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/Test.java	(revision 47503)
@@ -0,0 +1,36 @@
+package eu.dnetlib.data.claims.migration;
+
+import eu.dnetlib.data.claims.migration.entity.Project;
+import eu.dnetlib.data.claims.migration.entity.Result;
+
+import java.util.Calendar;
+
+public class Test {
+
+	public static void main(String[] args) {
+
+		ClaimGenerics<Object, Result> claim = new ClaimGenerics<Object, Result>();
+		claim.setDate(Calendar.getInstance().getTime());
+		claim.setId("claimId");
+		claim.setUserMail("claim mail");
+		Project project = new Project();
+		project.setFunderName("EC");
+		project.setOpenaireId("openaireID1234");
+		project.setName("PrTitle");
+		Result result = new Result();
+		result.setAccessRights("accessRights");
+		result.setCollectedFrom("collectedFrom");
+		result.setExternalUrl("external_url");
+		result.setOpenaireId("openaire_id");
+		result.setTitle("title");
+		result.setResultType("type");
+		result.setMetadataRecord("xmlString");
+		claim.setBody(project);
+		claim.setTarget(result);
+		System.out.println("test");
+		System.out.println(JsonldBuilder.toJsonld(claim));
+
+	}
+
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/ClaimGenerics.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/ClaimGenerics.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claims/migration/ClaimGenerics.java	(revision 47503)
@@ -0,0 +1,147 @@
+package  eu.dnetlib.data.claims.migration;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.Date;
+
+public class ClaimGenerics<S extends Object, T extends Object> {
+
+	@SerializedName("@context")
+	private final String context = "https://dl.dropboxusercontent.com/u/19168406/oa-openaire.jsonld";
+
+	@SerializedName("@type")
+	private final String type = "oa:Annotation";
+			
+	@SerializedName("@id")
+	private String id;
+	
+	@SerializedName("annotatedBy")
+	private Person person = new Person();
+
+	private Date date;
+    private String sourceType;
+    private String targetType;
+
+	@SerializedName("hasTarget")
+	private T target;
+	@SerializedName("hasSource")
+	private S body;
+	
+	public T getTarget() {
+		return target;
+	}
+
+	public void setTarget(T target) {
+		this.target = target;
+	}
+
+	public S getBody() {
+		return body;
+	}
+
+	public void setBody(S body) {
+		this.body = body;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = "http://www.openaire.eu/annotations/" + id;
+	}
+
+//	public String getUserMail() {
+//		return userMail;
+//	}
+
+	public void setUserMail(String userMail) {
+//		this.userMail = userMail;
+		this.person.setId(userMail.split("@")[0]);
+		this.person.getMbox().setId(userMail);
+	}
+    public String getUserMail() {
+        return this.person.getMbox().getId();
+    }
+	public Date getDate() {
+		return date;
+	}
+
+	public void setDate(Date date) {
+		this.date = date;
+	}
+
+    public String getSourceType() {
+        return sourceType;
+    }
+
+    public void setSourceType(String sourceType) {
+        this.sourceType = sourceType;
+    }
+
+    public String getTargetType() {
+        return targetType;
+    }
+
+    public void setTargetType(String targetType) {
+        this.targetType = targetType;
+    }
+
+    public void getClaimFromDB() {
+		// query rel2action
+		// parse to get ids;
+	}
+
+    @Override
+    public String toString() {
+        return "ClaimGenerics{" +
+                "\ntarget=" + target.toString() +
+                ",\n body=" + body.toString() +
+                ", \nid='" + id + '\'' +
+//                ", userMail='" + userMail + '\'' +
+                ", date=" + date +
+                '}';
+    }
+    private class Person {
+    	@SerializedName("@id")
+    	private String id;
+    	
+    	@SerializedName("@type")
+    	private final String type = "foaf:Person";
+    	
+    	private Mbox mbox = new Mbox();
+    	
+		public String getId() {
+			return id;
+		}
+
+		public void setId(String id) {
+			this.id = "http://www.openaire.eu/people/"+id;
+		}
+
+		public Mbox getMbox() {
+			return mbox;
+		}
+		
+		public void setMbox(Mbox mbox) {
+			this.mbox = mbox;
+		}
+    	
+    	private class Mbox {
+    		
+    		@SerializedName("@id")
+    		private String id;
+
+			public String getId() {
+				return id;
+			}
+
+			public void setId(String id) {
+				this.id = "mailto:" + id;
+			}
+    		
+    	}
+    }
+    
+}
+
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/emailSender/EmailSender.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/emailSender/EmailSender.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/emailSender/EmailSender.java	(revision 47503)
@@ -0,0 +1,199 @@
+package eu.dnetlib.data.emailSender;
+
+import eu.dnetlib.data.claims.migration.entity.Claim;
+import eu.dnetlib.data.claims.migration.entity.Project;
+import eu.dnetlib.data.claims.migration.handler.FetchClaimHandler;
+import eu.dnetlib.data.claims.migration.handler.ProjectHandler;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import eu.dnetlib.data.claimsDemo.SQLStoreException;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.mail.*;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+public class EmailSender implements Runnable {
+
+    private static final Logger logger = Logger.getLogger(EmailSender.class);
+
+    @Autowired
+    private FetchClaimHandler fetchClaimHandler = null;
+
+    @Autowired
+    private ProjectHandler projectHandler = null;
+
+    private static String openaireClaimsPage;
+    private static String username;
+    private static String password;
+    private static String host;
+    private static String port;
+    private static String from;
+    private static String specialRecipients;
+
+    private static String dateFrom;
+    private static String dateTo;
+
+    @Override
+    public void run() {
+        logger.info("EmailSender thread is running. " + host);
+        logger.info("Special Recipients  " + specialRecipients);
+
+
+        Project project = null;
+        List<Claim> claims = null;
+        List<String> types = new ArrayList<String>();
+
+        Map<String, List<String>> managersOfProject = new HashMap<String, List<String>>();
+
+        types.add(ClaimUtils.PROJECT);
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = null;
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.add(Calendar.HOUR_OF_DAY, -23);
+        calendar.add(Calendar.MINUTE, -59);
+        calendar.add(Calendar.SECOND, -59);
+        date = calendar.getTime();
+        dateFrom=(format.format(date));
+
+        date = new Date();
+        dateTo = (format.format(date));
+
+        logger.debug("Sending emails for claims between " + dateFrom + " and "+dateTo);
+
+        try {
+            // Get all claims between dateFrom and dateTo which satisfy source_type == "project" or target_type == "project"
+            claims = fetchClaimHandler.fetchClaimsByDate(dateFrom, dateTo, null, null, "", "source", true, types, false);
+        } catch (SQLStoreException|Exception e) {
+            logger.error("Could not fetch claims by date from "+dateFrom+" to "+dateTo, e);
+        }
+
+        for (Claim claim: claims) {
+            if (claim.getSourceType().equals("project")) {
+                project = (Project)claim.getSource();
+            } else {
+                project = (Project)claim.getSource();
+            }
+
+            if (!managersOfProject.containsKey(project.getOpenaireId())) {
+
+                // specialRecipients are used currently for testing purposes
+                List<String> tmpManagers = null;
+                if (specialRecipients != null && !specialRecipients.isEmpty()) {
+                    tmpManagers = Arrays.asList(specialRecipients.split("\\s*,\\s*"));
+                    logger.debug("Special recipients: " + specialRecipients);
+                    managersOfProject.put(project.getOpenaireId(), tmpManagers);
+                }
+
+                // Send emails to actual project managers instead of special recipients
+                //List<String> managers = projectFetcher.getFetchProjectHandler().fetchContactEmailsByProjectId(project.getOpenaireId());
+                //logger.debug("Managers of project " + project.getOpenaireId() + ": "+managers);
+                //managersOfProject.put(project.getOpenaireId(), managers);
+
+                String token = UUID.randomUUID().toString();
+                logger.debug("UUID Token for project " + project.getOpenaireId() + ": " + token);
+                try {
+                    projectHandler.updateTokenByProjectId(project.getOpenaireId(), token);
+
+                    if (managersOfProject.get(project.getOpenaireId()) != null &&
+                            !managersOfProject.get(project.getOpenaireId()).isEmpty()) {
+                        send(project, token, managersOfProject.get(project.getOpenaireId()));
+                    }
+                } catch (SQLStoreException|Exception e) {
+                    logger.error("Could update token for project with id "+ project.getOpenaireId(), e);
+                }
+            }
+        }
+    }
+
+    public void send(Project project, String token, List<String> managers) {
+        final String openaireClaimsPageUrl = openaireClaimsPage + token;
+
+        // Get system properties
+        Properties properties = System.getProperties();
+        properties.setProperty("mail.smtp.host", host);
+        properties.put("mail.smtp.port", port);
+        properties.put("mail.smtp.auth", "true"); //enable authentication
+        properties.put("mail.smtp.starttls.enable", "true");
+
+        Session session = Session.getInstance(properties,
+            new javax.mail.Authenticator() {
+                protected PasswordAuthentication getPasswordAuthentication() {
+                    return new PasswordAuthentication(username, password);
+                }
+            });
+
+        try {
+            // Create a default MimeMessage object.
+            MimeMessage message = new MimeMessage(session);
+
+            // Set From: header field of the header.
+            message.setFrom(new InternetAddress(from));
+
+            // Set To: header field of the header.
+            for(String to : managers) {
+                message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
+            }
+
+            // Set Subject: header field
+            message.setSubject("Openaire Claims Notification");
+
+            // For simple text setText() can be used instead of setContent()
+
+            // Send the actual HTML message, as big as you like
+            message.setContent("There are new Claims for the project: '" + project.getName() +"' for which you seem to be a contact person." +
+                                        "<br>Click <a href=\""+openaireClaimsPageUrl+"\">here</a> to curate these Claims.", "text/html");
+
+            // Send message
+            Transport.send(message);
+            logger.debug("Sent message successfully....\n");
+
+        } catch (AddressException ae) {
+            logger.error("Email could not be send.", ae);
+
+        } catch (MessagingException me) {
+            logger.error("Email could not be send.", me);
+        }
+    }
+
+    public void setFetchClaimHandler(FetchClaimHandler fetchClaimHandler) {
+        this.fetchClaimHandler = fetchClaimHandler;
+    }
+
+    public void setProjectHandler(ProjectHandler projectHandler) {
+        this.projectHandler = projectHandler;
+    }
+
+    public static void setOpenaireClaimsPage(String openaireClaimsPage) {
+        EmailSender.openaireClaimsPage = openaireClaimsPage;
+    }
+
+    public static void setUsername(String username) {
+        EmailSender.username = username;
+    }
+
+    public static void setPassword(String password) {
+        EmailSender.password = password;
+    }
+
+    public static void setHost(String host) {
+        EmailSender.host = host;
+    }
+
+    public static void setPort(String port) {
+        EmailSender.port = port;
+    }
+
+    public static void setFrom(String from) {
+        EmailSender.from = from;
+    }
+
+    public static void setSpecialRecipients(String specialRecipients) {
+        EmailSender.specialRecipients = specialRecipients;
+    }
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/TestClass.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/TestClass.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/TestClass.java	(revision 47503)
@@ -0,0 +1,435 @@
+package eu.dnetlib.data.claimsDemo;
+
+/**
+ * Created by Eri on 18/11/2015.
+ */
+
+
+
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.sun.org.apache.xerces.internal.xs.StringList;
+import eu.dnetlib.data.claims.migration.ClaimValidation;
+import eu.dnetlib.data.claims.migration.JsonldBuilder;
+import eu.dnetlib.data.claims.migration.Migration;
+import eu.dnetlib.data.claims.migration.entity.Claim;
+import eu.dnetlib.data.claims.migration.entity.Project;
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claims.migration.handler.*;
+import eu.dnetlib.data.claims.migration.parser.DMFParser;
+import org.apache.log4j.BasicConfigurator;
+import org.apache.log4j.Logger;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.xpath.XPathExpressionException;
+import java.io.IOException;
+import java.math.BigInteger;
+import java.security.MessageDigest;
+import java.sql.ResultSet;
+import java.util.*;
+
+import static junit.framework.Assert.assertNotNull;
+
+/**
+ * @author eri
+ */
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations = {"../claims/migration/springContext-claimsDemo.xml"})
+@PropertySource("../claims/migration/springContext-claimsDemo.properties")
+public class TestClass {
+	private Logger log = Logger.getLogger(this.getClass());
+
+
+	private SqlDAO sqlDAO;
+    private SqlStore sqlStore;
+
+    private QueryGenerator queryGenerator;
+
+    RelationHandler relationHandler = null;
+    ContextRelationHandler contextRelationHandler = null;
+    ProjectHandler projectHandler = null;
+    DirectIndexHandler directIndexHandler = null;
+    FetchProjectHandler fetchProjectHandler = null;
+    DMFContextHandler dmfContextHandler = null;
+    DMFResultHandler dmfResultHandler = null;
+    IndexResultHandler indexResultHandler = null;
+    ExternalRecordHandler externalRecordHandler = null;
+    ResultHandler resultHandler = null;
+
+    FetchClaimHandler fetchClaimHandler = null;
+    ClaimHandler claimHandler = null;
+    ClaimValidation claimValidation = null;
+
+
+    @Before
+	public void init() throws Exception {
+		BasicConfigurator.configure();
+        ApplicationContext context = new ClassPathXmlApplicationContext("eu/dnetlib/data/claims/migration/springContext-claimsDemo.xml");
+
+        relationHandler = context.getBean(RelationHandler.class);
+        directIndexHandler = context.getBean(DirectIndexHandler.class);
+        contextRelationHandler = context.getBean(ContextRelationHandler.class);
+        projectHandler = context.getBean(ProjectHandler.class);
+        fetchProjectHandler = context.getBean(FetchProjectHandler.class);
+        dmfContextHandler = context.getBean(DMFContextHandler.class);
+        dmfResultHandler = context.getBean(DMFResultHandler.class);
+        externalRecordHandler = context.getBean(ExternalRecordHandler.class);
+        indexResultHandler = context.getBean(IndexResultHandler.class);
+        resultHandler = context.getBean(ResultHandler.class);
+        claimHandler = context.getBean(ClaimHandler.class);
+        sqlDAO = context.getBean(SqlDAO.class);
+        sqlStore = context.getBean(SqlStore.class);
+        queryGenerator = context.getBean(QueryGenerator.class);
+        fetchClaimHandler = context.getBean(FetchClaimHandler.class);
+        claimValidation = context.getBean(ClaimValidation.class);
+
+        assertNotNull(sqlDAO);
+
+	}
+    @Test
+    public void testRollback(){
+        List <String> commands = new ArrayList<String>();
+        commands.add("UPDATE claim SET claimedBy = 'argirok1' WHERE  id = 93");
+        commands.add("EXCEPTION");
+        commands.add("UPDATE claim SET claimedBy = 'argirok2' WHERE  id = 95");
+        try {
+            sqlStore.executeUpdateWithRollback(commands);
+        } catch (Exception e) {
+            log.error("",e);
+        }
+    }
+    @Test
+    public void testJson(){
+        Claim claim = new Claim();
+        Project project= new Project();
+        claim.setDate(Calendar.getInstance().getTime());
+        claim.setId("claimId");
+        claim.setUserMail("claim mail");
+
+        project.setFunderName("EC");
+        project.setOpenaireId("openaireID1234");
+        project.setName("PrTitle");
+        claim.setSource(project);
+        Result result = new Result();
+        result.setAccessRights("accessRights");
+        result.setCollectedFrom("collectedFrom");
+        result.setExternalUrl("external_url");
+        result.setOpenaireId("openaire_id");
+        result.setTitle("title");
+        result.setResultType("type");
+        result.setMetadataRecord("xmlString");
+        claim.setTarget(result);
+        System.out.println("test");
+        System.out.println(JsonldBuilder.toJsonld(claim));
+    }
+
+    @Test
+    public void testFetch() throws Exception {
+
+        try {
+            List<Claim> claims = null;
+            List<String> types= new ArrayList<String>();
+//            types.add(ClaimUtils.CONTEXT);
+            types.add(ClaimUtils.PROJECT);
+          types.add(ClaimUtils.DATASET);
+            types.add(ClaimUtils.PUBLICATION);
+
+
+//            claims = fetchClaimHandler.fetchClaimsByUser("i.fava@cineca.it",30,0,types);
+//            claims = fetchClaimHandler.fetchClaimsByUser("argirok@di.uoa.gr",3,0,null,"claim.claim_date",false,types,false);
+//
+//            claims = fetchClaimHandler.fetchClaimsByProject("corda_______::ab9c77ce02967b24fc9c1a74276e4677",5,0);
+            claims = fetchClaimHandler.fetchClaimsByProject("corda__h2020::94c962e736df90a5075a7f660ba3d7f6",12,0,null, "claim.claim_date",false,types,true);
+            //claims = fetchClaimHandler.fetchClaimsByToken("corda__h2020::94c962e736df90a5075a7f660ba3d7f6","argiro@gmail.com",12,0,null, "claim.claim_date",false,types,false);
+
+//            claims = fetchClaimHandler.fetchClaimsByDate("2016-01-14 14:53:50","2016-04-21",10,0);
+//            claims = fetchClaimHandler.fetchClaimsByDate("2016-01-14 14:53:50","2017-04-21",10,0,"", "source",true,types, false);
+//            // 2016-04-20 14:53:50.276
+//            claims = fetchClaimHandler.fetchClaimsByContext("egi::country::gr",5,0,null,"claim.claim_date",false,types);
+//            claims = fetchClaimHandler.fetchAllClaims(5,3);
+//            claims = fetchClaimHandler.fetchClaimsByResult("od_______233::235960bb401207cb9595a79a1bc8e867",5,0,null, "claim.claim_date",false,types);
+//            claims = fetchClaimHandler.fetchClaimsByFunder("fct_________::FCT",5,0);
+//            claims= fetchClaimHandler.fetchClaimsByUser("kiatrop@di.uoa.gr",20,0,types);
+//            claims = fetchClaimHandler.fetchAllClaims(10,0,"","date",true,types);
+
+            System.out.println(fetchClaimHandler.claims2JSON(claims)+"\n\n\n "+claims.size());
+//          Claim claim = fetchClaimHandler.fetchClaimById("5821");
+//          System.out.println(fetchClaimHandler.claim2JSON(claim) );
+//          System.out.println("ALL:"+fetchClaimHandler.countClaimsByUser("argirok@di.uoa.gr","EGI", types));
+//          System.out.println("ALL:"+fetchClaimHandler.countClaimsByContext("egi::country::gr",null,types));
+//            System.out.println("ALL:"+fetchClaimHandler.countClaimsByProject("corda_______::ab9c77ce02967b24fc9c1a74276e4677",null,types));
+
+//        System.out.println("ALL:"+fetchClaimHandler.countAllClaims("", types));
+//                +"\n Project: "+fetchClaimHandler.countClaimsByProject("corda_______::ab9c77ce02967b24fc9c1a74276e4677")+
+//                " \n Result:"+fetchClaimHandler.countClaimsByResult("dedup_wf_001::541b1cef0d38d519e98a3b7a5b60bc75")+" \n Context:"+fetchClaimHandler.countClaimsByContext("egi::country::de")
+//        +" \n Date:"+fetchClaimHandler.countClaimsByDate("2014-04-14","2015-04-14")+" \n Funder:"+fetchClaimHandler.countClaimsByFunder("fct_________::FCT"));
+        } catch (Exception e) {
+            log.error("",e);
+        } catch (SQLStoreException e) {
+            e.printStackTrace();
+        }
+    }
+    @Test
+    public void testContext(){
+        System.out.print(DMFContextHandler.fetchContextById("egi::organisation::uom"));
+    }
+    @Test
+    public void testInsert() throws Exception, SQLStoreException {
+ //acm_________::31e0e5e7cbd6e2556336d7e795f55c49
+//dedup_wf_001::64ca1e3a4d1590456ad3dd7df8a18cd7
+ 
+//        String id=claimHandler.buildAndInsertClaim("argirok@di.uoa.gr", "project", "corda_______::2c37878a0cede85dbbd1081bb9b4a2f8", "openaire", "OPEN", null,"dataset", "10.5281/ZENODO.154647", "datacite", "EMBARGO","2017-05-01");
+
+
+        String id=claimHandler.buildAndInsertClaim("argirok@di.uoa.gr", "context", "egi::country::gr",
+                "openaire", null, null,"dataset", "10.4225/41/55A111BDE741C", "datacite", "OPEN","2017-05-01");
+    }
+    @Test
+    public void testDelete() throws Exception {
+
+//            claimHandler.deleteClaim("argirok@di.uoa.gr","94");
+//        claimHandler.deleteClaim("argirok@di.uoa.gr","3101");
+        }
+
+    @Test
+	public void testJob() throws Exception, SQLStoreException {
+        String selectcountDMFClaims =" Select count(*) from claims  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%' ";
+        String selectCountConceptClaims =" Select count(*) from claims  where ( type='dmf2actions' or type='updates2actions' ) and xml LIKE '%<oaf:concept%' ";
+        String selectCountRelationClaims =" Select count(*) from claims  where type='rels2actions'  ";
+
+        ResultSet rs = sqlDAO.executePreparedQuery(selectCountConceptClaims);
+
+        while(rs.next()) {
+            log.info("Concept claims: "+rs.getInt(1));
+        }
+         rs = sqlDAO.executePreparedQuery(selectCountRelationClaims);
+
+        while(rs.next()) {
+            log.info("Relation claims: "+rs.getInt(1));
+        }
+         rs = sqlDAO.executePreparedQuery("Select count(*) from claim");
+
+        while(rs.next()) {
+            log.info("Migrated claims: "+rs.getInt(1));
+        }
+        rs = sqlDAO.executePreparedQuery("Select count(*) from result");
+
+        while(rs.next()) {
+            log.info("Results: "+rs.getInt(1));
+        }
+
+	}
+
+    @Test
+    public void testHttpRequest() throws Exception {
+        SearchUtils searchUtils= new SearchUtils();
+        log.info(searchUtils.fetchPublicationXmlFromIndex("doajarticles::eb8a123eb82b25013b0001d0e2d1842b"));
+        log.info(searchUtils.fetchDatasetXmlFromIndex("doajarticles::eb8a123eb82b25013b0001d0e2d1842b"));
+    }
+
+    @Test
+    public void testXpath() throws Exception {
+            Result r=indexResultHandler.fetchResultById("dedup_wf_001::88a1eedd1ffce63dccf51d8ce2053c85");
+     }
+
+    @Test
+    public void testParsingDMF() throws IOException, SAXException, ParserConfigurationException, XPathExpressionException, TransformerException {
+        Result r=DMFParser.dmf2Result("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+                "<record xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:prov=\"http://www.openarchives.org/OAI/2.0/provenance\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:dr=\"http://www.driver-repository.eu/namespace/dr\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" +
+                "  <header xmlns=\"http://namespace.openaire.eu/\">\n" +
+                "    <dri:objIdentifier>crossref____::47593e13b24bcdd0f3d5573499f1d3a9</dri:objIdentifier>\n" +
+                "    <dri:recordIdentifier>10.1088/0004-637X/761/1/34</dri:recordIdentifier>\n" +
+                "    <dri:dateOfCollection></dri:dateOfCollection>\n" +
+                "    <dri:mdFormat></dri:mdFormat>\n" +
+                "    <dri:mdFormatInterpretation></dri:mdFormatInterpretation>\n" +
+                "    <dri:repositoryId></dri:repositoryId>\n" +
+                "    <dr:objectIdentifier></dr:objectIdentifier>\n" +
+                "    <dr:dateOfCollection>2014-10-10T14:59:49+00:00</dr:dateOfCollection>\n" +
+                "    <oaf:datasourceprefix>crossref____</oaf:datasourceprefix>\n" +
+                "  </header>\n" +
+                "  <metadata xmlns=\"http://namespace.openaire.eu/\">\n" +
+                "      <dc:dateAccepted>2012-01-01T00:00:00Z</dc:dateAccepted>\n" +
+                "             <dc:identifier>http://stacks.iop.org/0004-637X/761/i=1/a=34?key=crossref.d14dae8ac205453af63561a69c108e13</dc:identifier>\n" +
+                "          <dc:title>A THREE-DIMENSIONAL VIEW OF THE REMNANT OF NOVA PERSEI 1901 (GK Per)</dc:title>\n" +
+                "             <oaf:collectedDatasourceid>openaire____::crossref</oaf:collectedDatasourceid>\n" +
+                "       <oaf:accessrights></oaf:accessrights>\n" +
+                "       <oaf:hostedBy name=\"Unknown Repository\" id=\"openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18\"/>\n" +
+                "    <oaf:collectedFrom name=\"Crossref\" id=\"openaire____::crossref\" />\n" +
+                "\n" +
+                "     <dc:creator>Liimets, T.</dc:creator>\n" +
+                "   generateCreateClaimTablesQuery  <dc:creator>Corradi, R. L. M.</dc:creator>\n" +
+                "     <dc:creator>Santander-Garc&#237;a, M.</dc:creator>\n" +
+                "     <dc:creator>Villaver, E.</dc:creator>\n" +
+                "     <dc:creator>Rodr&#237;guez-Gil, P.</dc:creator>\n" +
+                "     <dc:creator>Verro, K.</dc:creator>\n" +
+                "     <dc:creator>Kolka, I.</dc:creator>\n" +
+                "\n" +
+                "        <dc:identifier identifierType=\"doi\">10.1088/0004-637X/761/1/34</dc:identifier>\n" +
+                "        <dr:CobjIdentifier>10.1088/0004-637X/761/1/34</dr:CobjIdentifier>\n" +
+                "  </metadata>\n" +
+                "</record>");
+        log.info(r.toString());
+
+    }
+    @Test
+    public void dropClaimTables() throws Exception {
+//        sqlDAO.executeUpdateQuery(queryGenerator.generateDeleteClaimTablesQuery());
+    }
+    @Test
+    public void createClaimTables() throws Exception {
+//        sqlDAO.executeUpdateQuery(queryGenerator.generateCreateClaimTablesQuery());
+    }
+
+    @Test
+    public void validDoiTest() throws Exception {
+        String doi="10.1523/​JNEUROSCI.2900-11.2012";
+        doi="10.1523/​JNEUROSCI.2900-11.2012";
+        String tr_doi=doi=dmfResultHandler.checkDoiValidity(doi);
+        System.out.println("Initial doi:"+doi+" "+((doi.equals(tr_doi))?"":" Transformed to"+tr_doi));
+
+    }
+
+    @Test
+    public void buildProject() throws Exception {
+        String id = "arc_________::089188bbc5db213fb2b00a0d93043fc4";
+        Project pr = projectHandler.fetchProjectByID(id);
+        log.info(pr.toString());
+        id="corda_______::404d91e07cd4d32fddd8fc636ad4daf7";
+        pr = projectHandler.fetchProjectByID(id);
+        log.info(pr.toString());
+
+    }
+    @Test
+    public void test() throws Exception {
+String xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?><response>\t  <header>\t\t    <query>(((deletedbyinference = false) AND (oaftype exact result)) and (resulttypeid exact publication)) and (objidentifier exact od______1266::af81022e9c489007a8f9ab27c2c725cb)</query>\t\t\t\t  <locale>en_GB</locale>\t\t\t\t\t\t<size>10</size>\t\t\t   <page>1</page>\t\t\t   <total>1</total>\t\t\t\t\t</header>\t  <results>\t\t\t\t\t\t\t\t\t<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"              xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\"              xmlns:oaf=\"http://namespace.openaire.eu/oaf\">         <header>            <dri:objIdentifier>od______1266::af81022e9c489007a8f9ab27c2c725cb</dri:objIdentifier>            <dri:dateOfCollection>2015-08-14T07:08:53.549Z</dri:dateOfCollection>            <counters>\t              <counter_authorship value=\"2\"/>               <counter_outcome value=\"1\"/>\t           </counters>         </header>         <metadata>            <oaf:entity xsi:schemaLocation=\"http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/0.3/oaf-0.3.xsd\">\t\t             <oaf:result>\t\t\t               <subject classid=\"keyword\" classname=\"keyword\" schemeid=\"dnet:result_subject\"                           schemename=\"dnet:result_subject\">MATLAB</subject>                  <subject classid=\"keyword\" classname=\"keyword\" schemeid=\"dnet:result_subject\"                           schemename=\"dnet:result_subject\">Lecture</subject>                  <subject classid=\"keyword\" classname=\"keyword\" schemeid=\"dnet:result_subject\"                           schemename=\"dnet:result_subject\">Exercises</subject>                  <subject classid=\"keyword\" classname=\"keyword\" schemeid=\"dnet:result_subject\"                           schemename=\"dnet:result_subject\">Exercises in Linear Vibration Theory</subject>                  <subject classid=\"keyword\" classname=\"keyword\" schemeid=\"dnet:result_subject\"                           schemename=\"dnet:result_subject\">System Conditions</subject>                  <subject classid=\"keyword\" classname=\"keyword\" schemeid=\"dnet:result_subject\"                           schemename=\"dnet:result_subject\">MATLAB</subject>                  <subject classid=\"keyword\" classname=\"keyword\" schemeid=\"dnet:result_subject\"                           schemename=\"dnet:result_subject\">Exercises</subject>                  <subject classid=\"keyword\" classname=\"keyword\" schemeid=\"dnet:result_subject\"                           schemename=\"dnet:result_subject\">Exercises in Linear Vibration Theory</subject>                  <subject classid=\"keyword\" classname=\"keyword\" schemeid=\"dnet:result_subject\"                           schemename=\"dnet:result_subject\">System Conditions</subject>                  <subject classid=\"keyword\" classname=\"keyword\" schemeid=\"dnet:result_subject\"                           schemename=\"dnet:result_subject\">Damping Coefficient</subject>                  <subject classid=\"keyword\" classname=\"keyword\" schemeid=\"dnet:result_subject\"                           schemename=\"dnet:result_subject\">Lecture</subject>                  <title classid=\"main title\" classname=\"main title\" schemeid=\"dnet:dataCite_title\"                         schemename=\"dnet:dataCite_title\">Vibration Theory, Vol. 1B:linear vibration theory, MATLAB exercises</title>                  <dateofacceptance>1996-02-01</dateofacceptance>                  <publisher>Department of Mechanical Engineering, Aalborg University</publisher>                  <resulttype classid=\"publication\" classname=\"publication\" schemeid=\"dnet:result_typologies\"                              schemename=\"dnet:result_typologies\"/>                  <language classid=\"eng\" classname=\"English\" schemeid=\"dnet:languages\"                            schemename=\"dnet:languages\"/>                  <format>application/pdf</format>                  <description>The present collection of MATLAB exercises has been published as a supplement to the textbook, Svingningsteori, Bind 1 and the collection of exercises in Vibration theory, Vol. 1A, Solved Problems. Throughout the exercise references are made to these books.&lt;br/&gt;&lt;br/&gt;The purpose of the MATLAB exercises is to give a better understanding of the physical problems in linear vibration theory and to surpress the mathematical analysis used to solve the problems. For this purpose the MATLAB environment is excellent.</description>                  <description>The present collection of MATLAB exercises has been published as a supplement to the textbook, Svingningsteori, Bind 1 and the collection of exercises in Vibration theory, Vol. 1A, Solved Problems. Throughout the exercise references are made to these books.&lt;br/&gt;&lt;br/&gt;The purpose of the MATLAB exercises is to give a better understanding of the physical problems in linear vibration theory and to surpress the mathematical analysis used to solve the problems. For this purpose the MATLAB environment is excellent.</description>                  <source>Asmussen , J C &amp; Nielsen , S R K 1996 , Vibration Theory, Vol. 1B : linear vibration theory, MATLAB exercises . Department of Mechanical Engineering, Aalborg University , Aalborg . U/ , no. 9601</source>                  <country classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>                  <relevantdate classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>                  <embargoenddate/>                  <fulltext/>                  <storagedate/>                  <resourcetype classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>                  <device/>                  <size/>                  <version/>                  <lastmetadataupdate/>                  <metadataversionnumber/>                  <originalId>oai:pure.atira.dk:publications/0b993280-a86a-11da-8341-000ea68e967b</originalId>                  <collectedfrom name=\"VBN\" id=\"opendoar____::8e2cfdc275761edc592f73a076197c33\"/>                  <pid classid=\"oai\" classname=\"oai\" schemeid=\"dnet:pid_types\"                       schemename=\"dnet:pid_types\">oai:pure.atira.dk:publications/0b993280-a86a-11da-8341-000ea68e967b</pid>                  <bestlicense classid=\"OPEN\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"                               schemename=\"dnet:access_modes\"/>                  <context id=\"FCT\" label=\"Fundação para a Ciência e a Tecnologia, I.P.\" type=\"funding\">                     <category id=\"FCT::3599-PPCDT\" label=\"3599-PPCDT\"/>                  </context>                  <datainfo>                     <inferred>false</inferred>                     <deletedbyinference>false</deletedbyinference>                     <trust>0.9</trust>                     <inferenceprovenance/>                     <provenanceaction classid=\"sysimport:crosswalk:repository\"                                       classname=\"sysimport:crosswalk:repository\"                                       schemeid=\"dnet:provenanceActions\"                                       schemename=\"dnet:provenanceActions\"/>                  </datainfo>\t\t                <rels>\t\t                   <rel inferred=\"false\" trust=\"0.9\" inferenceprovenance=\"\"                          provenanceaction=\"user:claim:search\">\t\t                      <to class=\"isProducedBy\" scheme=\"dnet:result_project_relations\" type=\"project\">fct_________::0432268334291febec6d0dbc1f8bae5d</to>\t\t                      <websiteurl>http://www.fct.pt/apoios/projectos/consulta/vglobal_projecto.phtml.en?idProjecto=83907&amp;idElemConcurso=2612</websiteurl>                        <code>83907</code>                        <acronym>MIT-Pt/BS-CTRM/0051/2008</acronym>                        <title>Smart small-scale devices: systems for controlled delivery of bioactive molecules, cell expansion and for sensing cell environment.</title>                        <contracttype classid=\"UNKNOWN\" classname=\"UNKNOWN\" schemeid=\"fct:contractTypes\"                                      schemename=\"fct:contractTypes\"/>                        <funding>                           <funder id=\"fct_________::FCT\" shortname=\"FCT\"                                   name=\"Fundação para a Ciência e a Tecnologia, I.P.\"                                   jurisdiction=\"PT\"/>                           <funding_level_0 name=\"3599-PPCDT\">fct_________::FCT::3599-PPCDT</funding_level_0>                        </funding>\t\t                   </rel>                     <rel inferred=\"true\" trust=\"0.9\" inferenceprovenance=\"\"                          provenanceaction=\"sysimport:crosswalk:repository\">\t\t                      <to class=\"hasAuthor\" scheme=\"dnet:personroles\" type=\"person\">dedup_wf_001::b3bccc606f9dfe608199defb1f89b4d2</to>\t\t                      <ranking>1</ranking>                        <fullname>Asmussen, J.C.</fullname>\t\t                   </rel>                     <rel inferred=\"true\" trust=\"0.9\" inferenceprovenance=\"\"                          provenanceaction=\"sysimport:crosswalk:repository\">\t\t                      <to class=\"hasAuthor\" scheme=\"dnet:personroles\" type=\"person\">dedup_wf_001::facd63932e76860852cdd2ca9d33f45c</to>\t\t                      <ranking>2</ranking>                        <fullname>Søren R. K. Nielsen</fullname>\t\t                   </rel>\t\t                </rels>\t\t                <children>\t\t\t                  <instance id=\"opendoar____::8e2cfdc275761edc592f73a076197c33\">\t\t\t                     <licence classid=\"OPEN\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"                                 schemename=\"dnet:access_modes\"/>                        <instancetype classid=\"0002\" classname=\"Book\" schemeid=\"dnet:publication_resource\"                                      schemename=\"dnet:publication_resource\"/>                        <hostedby name=\"VBN\" id=\"opendoar____::8e2cfdc275761edc592f73a076197c33\"/>\t\t\t\t                    <webresource>\t\t\t\t                       <url>http://vbn.aau.dk/da/publications/vibration-theory-vol-1b(0b993280-a86a-11da-8341-000ea68e967b).html</url>\t\t\t\t                    </webresource>\t\t\t\t                    <webresource>\t\t\t\t                       <url>http://vbn.aau.dk/ws/files/57794257/vibration_theory_vol._1b_linear_vibration_theory_MATLAB_exercises.pdf</url>\t\t\t\t                    </webresource>\t\t\t                  </instance>\t\t                </children>\t\t             </oaf:result>            </oaf:entity>         </metadata>      </result>\t\t\t\t\t\t</results>\t  <browseResults>\t\t\t</browseResults></response>\n";
+
+        SearchUtils searchUtils = new SearchUtils();
+        Integer size=searchUtils.getNumberOfResultsInAPIXML(xml);
+        log.info(size);
+        xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+                "<record xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:prov=\"http://www.openarchives.org/OAI/2.0/provenance\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:dr=\"http://www.driver-repository.eu/namespace/dr\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" +
+                "  <header xmlns=\"http://namespace.openaire.eu/\">\n" +
+                "    <dri:objIdentifier>orcid_______::4f9638b3f0fecbe3de2f9dde824c36d1</dri:objIdentifier>\n" +
+                "    <dri:recordIdentifier>0000-0002-3477-3082-5288651</dri:recordIdentifier>\n" +
+                "    <dri:dateOfCollection></dri:dateOfCollection>\n" +
+                "    <dri:mdFormat></dri:mdFormat>\n" +
+                "    <dri:mdFormatInterpretation></dri:mdFormatInterpretation>\n" +
+                "    <dri:repositoryId></dri:repositoryId>\n" +
+                "    <dr:objectIdentifier></dr:objectIdentifier>\n" +
+                "    <dr:dateOfCollection>2015-08-19T14:40:37+00:00</dr:dateOfCollection>\n" +
+                "    <oaf:datasourceprefix>openaire____</oaf:datasourceprefix>\n" +
+                "  </header>\n" +
+                "  <metadata xmlns=\"http://namespace.openaire.eu/\">\n" +
+                "      <dc:dateAccepted>2012-01-01T00:00:00Z</dc:dateAccepted>\n" +
+                "             <dc:identifier>http://dx.doi.org/10.1007/978_3_642_27169_4_2</dc:identifier>\n" +
+                "          <dc:title>A Survey of Context-Aware Cross-Digital Library Personalization</dc:title>\n" +
+                "             <oaf:collectedDatasourceid>openaire____::orcid</oaf:collectedDatasourceid>\n" +
+                "       <oaf:accessrights>OPEN</oaf:accessrights>\n" +
+                "         <oaf:embargoenddate></oaf:embargoenddate>\n" +
+                "       <oaf:hostedBy name=\"Unknown Repository\" id=\"openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18\"/>\n" +
+                "    <oaf:collectedFrom name=\"ORCID\" id=\"openaire____::orcid\" />\n" +
+                "          \n" +
+                "     <dc:creator>Manola, Natalia</dc:creator>\n" +
+                "     <dc:creator>Nika, Ana</dc:creator>\n" +
+                "     <dc:creator>Catarci, Tiziana</dc:creator>\n" +
+                "     <dc:creator>Ioannidis, Yannis</dc:creator>\n" +
+                "     <dc:creator>Katifori, Akrivi</dc:creator>\n" +
+                "     <dc:creator>Koutrika, Georgia</dc:creator>\n" +
+                "     <dc:creator>Manola, Natalia</dc:creator>\n" +
+                "     <dc:creator>N&#252;rnberger, Andreas</dc:creator>\n" +
+                "     <dc:creator>Thaller, Manfred</dc:creator>\n" +
+                " \n" +
+                "\n" +
+                "        <oaf:identifier identiferType=\"orcidworkid\">0000-0002-3477-3082-5288651</oaf:identifier>\n" +
+                "\n" +
+                "  </metadata>\n" +
+                "</record>";
+        dmfResultHandler.fetchAccessRights(xml);
+        dmfResultHandler.fetchDoiByDMF(xml);
+        dmfResultHandler.fetchEmbargoEndDateByDMF(xml);
+        dmfResultHandler.fetchOrcidWorkByDMF(xml);
+
+
+    }
+
+    @Test
+    public void buildOpenaireResult() throws Exception {
+
+        Migration migration= new Migration();
+        Result r=migration.buildOpenaireResult("datacite____::ddbd5c4c76598f27793bccf4a99843f7","");
+        log.info(r);
+
+    }
+    @Test
+    public void buildOpenaireProject() throws Exception {
+        String projetcId = "corda_______::2c37878a0cede85dbbd1081bb9b4a2f8";
+        Migration migration= new Migration();
+        Project r=migration.buildProject(projetcId,"");
+        log.info(r);
+//        this.fetchProjectHandler.updateContactEmailsByProjectId(projetcId,r.getContactEmails());
+
+    }
+    @Test
+    public void testProject() throws Exception, SQLStoreException {
+//        List<String> mails = new ArrayList<String>();
+//        mails.add("test1@mail.com");
+//        mails.add("test2@mail.com");
+//        mails.add("test3@mail.com");
+//        sqlDAO.executePreparedQuery(queryGenerator.generateInsertProjectQuery("123","test project","TEstP","","","",mails));
+        System.out.println("\n"+this.fetchProjectHandler.fetchContactEmailsByProjectId("corda__h2020::94c962e736df90a5075a7f660ba3d7f6")+"\n");
+        List<String> mails = new ArrayList<String>();
+        mails.add("test11111@mail.com");
+        mails.add("test122222@mail.com");
+//        this.projectHandler.updateContactEmailsByProjectId("123",mails);
+//        System.out.println("\n"+this.projectHandler.fetchContactEmailsByProjectId("123")+"\n");
+//        String token = UUID.randomUUID().toString();
+//        this.projectHandler.updateTokenByProjectId("123",token);
+
+
+
+    }
+    @Test
+    public void testMD5() throws Exception {
+        String id = "10.1371/journal.pone.0130756";
+        MessageDigest m = MessageDigest.getInstance("MD5");
+        m.update(id.getBytes(), 0, id.length());
+        id = new BigInteger(1, m.digest()).toString(16);
+        System.out.println(id);
+        System.out.println(this.resultHandler.getPathToSaveRecord());
+
+    }
+    @Test
+    public void testCuration() throws Exception, SQLStoreException {
+        boolean updated = claimHandler.updateClaimCurationInfo("argiro@gmail.com","1",true);
+        System.out.println(updated);
+    }
+
+    @Test
+    public void testFetchProjectIdByToken() throws Exception, SQLStoreException {
+        String openaireId = this.fetchProjectHandler.fetchProjectIdByToken("dedc6979-1967-4ea2-a2ad-5135f95285ae", "test11111@mail.com");
+        System.out.println(openaireId);
+    }
+
+    @Test
+    public void directIndexClaim() throws Exception {
+        System.out.println(this.claimValidation.getPathToSaveReport());
+        String json = "{\"originalId\":\"user:claim__d1e668dc81fa714aa98a558d9ce515fa\",\"title\":\"Expression of Ik6 and Ik8 Isoforms and Their Association with Relapse and Death in Mexican Children with Acute Lymphoblastic Leukemia\",\"authors\":[\"Reyes-León Adriana\",\"Juárez-Velázquez Rocío\",\"Medrano-Hernández Alma\",\"Cuenca-Roldán Teresa\",\"Salas-Labadía Consuelo\",\"del Pilar Navarrete-Meneses María\",\"Rivera-Luna Roberto\",\"López-Hernández Gerardo\",\"Paredes-Aguilera Rogelio\",\"Pérez-Vera Patricia\"],\"publisher\":\"Public Library of Science (PLoS)\",\"type\":\"publication\",\"pids\":[{\"type\":\"doi\",\"value\":\"10.1371/journal.pone.0130756\"}],\"licenseCode\":\"OPEN\",\"resourceType\":\"0001\",\"url\":\"http://dx.doi.org/10.1371/journal.pone.0130756\",\"hostedById\":\"openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18\",\"collectedFromId\":\"openaire____::crossref\",\"contexts\":[\"egi::country::gr\"]}";
+//        System.out.println("\n\nFeed Response is: "+directIndexHandler.insertRecord(json));
+
+//        System.out.println("\n\nDelete Response is: "+directIndexHandler.deleteRecord("user:claim__d1e668dc81fa714aa98a558d9ce515fa","openaire____::crossref"));
+    }
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/ContextUtils.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/ContextUtils.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/ContextUtils.java	(revision 47503)
@@ -0,0 +1,120 @@
+package eu.dnetlib.data.claimsDemo;
+
+import eu.dnetlib.api.enabling.ISLookUpService;
+import eu.dnetlib.data.claims.migration.handler.ClaimHandler;
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.*;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Created by kiatrop on 27/1/2016.
+ */
+public class ContextUtils {
+    private static final Logger logger = Logger.getLogger(ClaimHandler.class);
+
+        private static Document document = null;
+
+        //private static String isLookUpAddress = "http://node6.t.openaire.research-infrastructures.eu:8280/is/services/isLookUp";
+        //String registryAddress = "http://node6.t.openaire.research-infrastructures.eu:8280/is/services/isRegistry";
+
+    private ISLookUpService isLookUpService = null;
+
+    static {
+
+        InputStream inputStream = ContextUtils.class.getClassLoader().getResourceAsStream("eu/dnetlib/data/claimsDemo/egi.xml");
+
+        DocumentBuilderFactory factory =  DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = null;
+        try {
+            builder = factory.newDocumentBuilder();
+
+        } catch (ParserConfigurationException e) {
+            logger.error("Parse configuration Exception",e);
+        }
+
+        //StringBuilder xmlStringBuilder = new StringBuilder();
+        try {
+            document = builder.parse(inputStream);
+
+        } catch (SAXException e) {
+            logger.error("SAXException",e);
+
+        } catch (IOException e) {
+            logger.error("IOException",e);
+        }
+    }
+
+    public static String extractEgiLabel(String code) throws XPathExpressionException {
+        String[] codeParts = code.split("::");
+        StringBuilder builder = new StringBuilder();
+
+        StringBuilder reconstructedCode = new StringBuilder();
+        if (codeParts.length > 0) {
+            reconstructedCode.append(codeParts[0]);
+        }
+
+        for(int i=0; i< codeParts.length; i++) {
+            if (i == 0) {
+                //System.out.println("1");
+                builder.append(findContextLabel(reconstructedCode.toString()));
+
+            } else if (i == 1) {
+                reconstructedCode.append("::").append(codeParts[1]);
+                builder.append("> ").append(findCategoryLabel(reconstructedCode.toString()));
+
+            } else {
+                reconstructedCode.append("::").append(codeParts[i]);
+                builder.append("> ").append(findConceptLabel(reconstructedCode.toString()));
+            }
+        }
+
+        return builder.toString();
+    }
+
+
+    private static String findContextLabel(String conceptCode) throws XPathExpressionException {
+//        System.out.println("concept code: " + conceptCode) ;
+        XPathFactory xPathfactory = XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+
+        XPathExpression expr = xpath.compile("//context[@id='"+ conceptCode + "']");
+        NodeList nodeList = (NodeList)expr.evaluate(document,  XPathConstants.NODESET);
+
+        Node nNode = nodeList.item(0);
+        return nNode.getAttributes().getNamedItem("label").getTextContent();
+    }
+
+    private static String findCategoryLabel(String categoryCode) throws XPathExpressionException {
+//      System.out.println("Category code: " + categoryCode) ;
+        XPathFactory xPathfactory = XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+
+        XPathExpression expr = xpath.compile("//category[@id='"+ categoryCode + "']");
+        NodeList nodeList = (NodeList)expr.evaluate(document,  XPathConstants.NODESET);
+
+        Node nNode = nodeList.item(0);
+        return nNode.getAttributes().getNamedItem("label").getTextContent();
+    }
+
+    private static String findConceptLabel(String conceptCode) throws XPathExpressionException {
+//        System.out.println("Concept code: " + conceptCode) ;
+        XPathFactory xPathfactory = XPathFactory.newInstance();
+        XPath xpath = xPathfactory.newXPath();
+
+        XPathExpression expr = xpath.compile("//concept[@id='"+ conceptCode + "']");
+        NodeList nodeList = (NodeList)expr.evaluate(document,  XPathConstants.NODESET);
+
+        Node nNode = nodeList.item(0);
+        return nNode.getAttributes().getNamedItem("label").getTextContent();
+    }
+
+}
Index: modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/QueryGenerator.java
===================================================================
--- modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/QueryGenerator.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/QueryGenerator.java	(revision 47503)
@@ -0,0 +1,964 @@
+package eu.dnetlib.data.claimsDemo;
+
+import eu.dnetlib.data.claims.migration.entity.*;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import org.apache.log4j.Logger;
+
+
+public class QueryGenerator {
+    boolean updateOnInsert;
+    String migrationTable ="claims"; //a table or a view containing old schema claims - But only user claims, not those where agent='inference'
+    private static final Logger logger = Logger.getLogger(QueryGenerator.class);
+
+    public boolean isUpdateOnInsert() {
+        return updateOnInsert;
+    }
+
+    public void setUpdateOnInsert(boolean updateOnInsert) {
+        this.updateOnInsert = updateOnInsert;
+    }
+
+    /**
+  ** Insert Queries **
+  **/
+    private String generateInsertResultQuery(String openaire_id, String result_type, String title, String collected_from , String external_url, String doi, String orcidworkid, String access_rights , String embargo_end_date, String best_license, String record_path, String record_format) {
+        if(title!=null&&title.contains("'")){
+            title=title.replace("'","''");
+        }
+        String fields="openaire_id";
+        if(result_type!=null){
+            fields+=", result_type";
+        }
+        if(title!=null){
+            fields+=", title";
+        }
+        if(collected_from!=null){
+            fields+=", collected_from";
+        }
+        if(external_url!=null){
+            fields+=", external_url";
+        }
+        if(doi!=null){
+            fields+=", doi";
+        }
+        if(orcidworkid!=null){
+            fields+=", orcidworkid";
+        }
+        if(access_rights!=null){
+            fields+=", access_rights";
+        }
+        if(embargo_end_date!=null){
+            fields+=", embargo_end_date";
+        }
+        if(best_license!=null){
+            fields+=", best_license";
+        }
+        if(record_path!=null){
+            fields+=", record_path";
+        }
+        if(record_format!=null){
+            fields+=", record_format";
+        }
+        String values="'"+openaire_id+"'";
+        if(result_type!=null){
+            values+=",'"+result_type+"'";
+        }
+        if(title!=null){
+            values+=",'"+title+"'";
+        }
+        if(collected_from!=null){
+            values+=",'"+collected_from+"'";
+        }
+        if(external_url!=null){
+            values+=",'"+external_url+"'";
+        }
+        if(doi!=null){
+            values+=",'"+doi+"'";
+        }
+        if(orcidworkid!=null){
+            values+=",'"+orcidworkid+"'";
+        }
+        if(access_rights!=null){
+            values+=",'"+access_rights+"'";
+        }
+        if(embargo_end_date!=null){
+            values+=",'"+embargo_end_date+"'";
+        }
+        if(best_license!=null){
+            values+=",'"+best_license+"'";
+        }
+        if(record_path!=null){
+            values+=",'"+record_path+"'";
+        }
+        if(record_format!=null){
+            values+=",'"+record_format+"'";
+        }
+        return "INSERT INTO result("+fields+")\n" +
+                "    Select "+values+
+                "    where not exists (select openaire_id from result where openaire_id='"+openaire_id+"')\n" +
+                "    RETURNING openaire_id";
+        //TODO update on insert when exists
+    }
+    public String generateInsertProjectQuery(String openaire_id, String name, String acronym, String funder_id, String funder_name, String funder_acronym, List<String> contactEmails) {
+        if(name!=null) {
+            name = name.replace("'", "''");
+        }
+        String fields="openaire_id";
+        if(name!=null){
+            fields+=",name";
+        }
+        if(acronym!=null){
+            fields+=",acronym";
+        }
+        if(funder_id!=null){
+            fields+=",funder_id";
+        }
+        if(funder_name!=null){
+            fields+=",funder_name";
+        }
+        if(funder_acronym!=null){
+            fields+=",funder_acronym";
+        }
+        if(contactEmails != null && contactEmails.size() > 0){
+            fields+=",contact_person";
+        }
+        String values="'"+openaire_id+"'";
+        if(name!=null){
+            values+=",'"+name+"'";
+        }
+        if(acronym!=null){
+            values+=",'"+acronym+"'";
+        }
+        if(funder_id!=null){
+            values+=",'"+funder_id+"'";
+        }
+        if(funder_name!=null){
+            values+=",'"+funder_name+"'";
+        }
+        if(funder_acronym!=null){
+            values+=",'"+funder_acronym+"'";
+        }
+        if(contactEmails != null && contactEmails.size() > 0){
+            values+=",'{";
+            for(int i = 0; i< contactEmails.size(); i++){
+
+                values+="\""+contactEmails.get(i)+"\""+((i < contactEmails.size() -1 )?",":"");
+            }
+            values+="}'";
+        }
+        return "INSERT INTO project("+fields+")\n" +
+                "    Select "+values +
+                "    where not exists (select openaire_id from project where openaire_id='"+openaire_id+"')\n" +
+                "    RETURNING openaire_id";
+        //TODO update on insert when exists
+    }
+    private String generateInsertContextQuery(String openaire_id, String name) {
+        String fields="openaire_id";
+        if(name!=null){
+            fields+=",name";
+        }
+        String values="'"+openaire_id+"'";
+        if(name!=null){
+            values+=",'"+name+"'";
+        }
+        return "INSERT INTO context("+fields+")\n" +
+                "    Select "+values+
+                "    where not exists (select openaire_id from context where openaire_id='"+openaire_id+"')\n" +
+                "    RETURNING openaire_id";
+        //TODO update on insert when exists
+    }
+    private String generateInsertClaimQuery(Date date, String claimedBy, String source_type, String target_type , String source_id , String target_id, String semantics) {
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateStr=null;
+        dateStr=(format.format(date));
+        String fields="claim_date,claimedBy,source_type,target_type, source_id, target_id";
+        if(semantics!=null){
+            fields+=",semantics";
+        }
+        String values="'"+dateStr+"','"+claimedBy+"','"+source_type+"', '"+target_type+"','"+source_id+"','"+target_id+"'";
+        if(semantics!=null){
+            values+=",'"+semantics+"'";
+        }
+
+        return "     INSERT INTO claim( "+fields+")\n" +
+                "    VALUES ( "+values+")\n" +
+                "    RETURNING id, source_id, target_id\n";
+    }
+
+    private  String generateInsertFullClaimQuery(String targetQuery, String sourceQuery, Claim claim) {
+        if (claim ==null || targetQuery ==null || sourceQuery == null){
+            return null;
+        }
+        String sourceTableName= getSourceTableName(claim.getSourceType());
+        String targetTableName= getTargetTableName(claim.getTargetType());
+        if (sourceTableName ==null || targetTableName ==null ){
+            return null;
+        }
+        return " WITH target AS (\n" +
+                targetQuery+
+                "    ),\n source AS (\n" +
+                sourceQuery+
+                "   ),\n myclaim AS (\n" +
+                generateInsertClaimQuery(claim.getDate(), claim.getUserMail(), claim.getSourceType(), claim.getTargetType(), claim.getSource().getOpenaireId(), claim.getTarget().getOpenaireId(),this.createSemanticsType(claim.getSourceType(),claim.getTargetType())) +
+                "   ),\n ins4 AS (\n" +
+                "    INSERT INTO "+sourceTableName+" (claim_id, openaire_id)\n" +
+                "    SELECT id, source_id\n" +
+                "    FROM   myclaim) \n"+
+                "    INSERT INTO "+targetTableName+"(claim_id, openaire_id)\n" +
+                "    SELECT id, target_id\n" +
+                "    FROM   myclaim "+
+                " RETURNING claim_id;";
+    }
+    public  String generateInsertFullClaimQuery( Claim claim) {
+        String targetQuery =null;
+        String sourceQuery=null;
+        targetQuery=generateInsertEntityQuery(claim.getTarget(),claim.getTargetType());
+        sourceQuery=generateInsertEntityQuery(claim.getSource(),claim.getSourceType());
+        return generateInsertFullClaimQuery(targetQuery,sourceQuery,claim);
+
+    }
+    private String generateInsertEntityQuery(OpenaireEntity openaireEntity, String type){
+        String query=null;
+        if(type==null){
+            return null;
+        }
+        if(type.equals(ClaimUtils.DATASET)||type.equals(ClaimUtils.PUBLICATION)){
+            Result result=(Result)openaireEntity;
+            query=generateInsertResultQuery(result.getOpenaireId(),result.getResultType(),result.getTitle(),result.getCollectedFrom(),result.getExternalUrl(),result.getDoi(), result.getOrcidworkid(), result.getAccessRights(),result.getEmbargoEndDate(),result.getBestLicense(),result.getRecordPath(), result.getRecordFormat());
+        }else if(type.equals(ClaimUtils.PROJECT)){
+            Project project=(Project)openaireEntity;
+            query=generateInsertProjectQuery(project.getOpenaireId(),project.getName(),project.getAcronym(),project.getFunderId(),project.getFunderName(),project.getFunderShortName(),project.getContactEmails());
+        }else if(type.equals(ClaimUtils.CONTEXT)){
+            Context context= (Context)openaireEntity;
+            query=generateInsertContextQuery(context.getOpenaireId(),context.getTitle());
+        }
+
+        return query;
+    }
+
+    private String getSourceTableName(String type){
+        String tablename="has_source_";
+        if(type==null){
+            return null;
+        }else{
+            tablename+=getTypeForTable(type);
+        }
+        return tablename;
+    }
+    private String getTargetTableName(String type){
+        String tablename="has_target_";
+        if(type==null){
+            return null;
+        }else{
+            tablename+=getTypeForTable(type);
+        }
+        return tablename;
+    }
+    public  String generateInsertClaimResultQuery(String targetQuery, String sourceQuery, Claim claim) {
+
+        return " WITH ins1 AS (\n" +
+                targetQuery+
+                "    ),\n ins2 AS (\n" +
+                sourceQuery+
+                "   ),\n ins3 AS (\n" +
+               generateInsertClaimQuery(claim.getDate(), claim.getUserMail(), claim.getSourceType(), claim.getTargetType(), claim.getSource().getOpenaireId(), claim.getTarget().getOpenaireId(),this.createSemanticsType(claim.getSourceType(),claim.getTargetType())) +
+                "   ),\n ins4 AS (\n" +
+                "    INSERT INTO has_source_result (claim_id, openaire_id)\n" +
+                "    SELECT id, source_id\n" +
+                "    FROM   ins3) \n"+
+                "    INSERT INTO has_target_result(claim_id, openaire_id)\n" +
+                "    SELECT id, target_id\n" +
+                "    FROM   ins3;";
+    }
+
+    /**
+     *
+     * @param sourceType
+     * @param targetType
+     * @return "resultResult_"+targetType+sourceType+"_isRelatedTo"
+     */
+    private String createSemanticsType(String sourceType,String targetType){
+        String semantics=null;
+        if((targetType.equals(ClaimUtils.PUBLICATION)||targetType.equals(ClaimUtils.DATASET))&&(sourceType.equals(ClaimUtils.PUBLICATION)||sourceType.equals(ClaimUtils.DATASET))){
+            semantics="resultResult_"+targetType+sourceType+"_isRelatedTo";
+        }
+        else if((targetType.equals(ClaimUtils.PUBLICATION)||targetType.equals(ClaimUtils.DATASET))&&(sourceType.equals(ClaimUtils.PROJECT))){
+            semantics="resultProject_outcome_isProducedBy";
+        }
+
+
+        return semantics;
+    }
+   /* public  String generateInsertClaimResultQuery(Result targetResult, Result sourceResult, Claim claim) {
+
+        return generateInsertClaimResultQuery(generateInsertResultQuery(targetResult.getOpenaireId(), targetResult.getResultType(), targetResult.getTitle(), targetResult.getCollectedFrom(), targetResult.getExternalUrl(), targetResult.getDOI(),targetResult.getOrcidworkid(), targetResult.getAccessRights(), targetResult.getEmbargoEndDate(), targetResult.getBestLicense(), targetResult.getRecordPath(), targetResult.getRecordFormat()),
+                generateInsertResultQuery(sourceResult.getOpenaireId(), sourceResult.getResultType(), sourceResult.getTitle(), sourceResult.getCollectedFrom(), sourceResult.getExternalUrl(), sourceResult.getDOI(), sourceResult.getOrcidworkid(), sourceResult.getAccessRights(), targetResult.getEmbargoEndDate(), sourceResult.getBestLicense(), sourceResult.getRecordPath(),sourceResult.getRecordFormat()),claim);
+    }
+    public  String generateInsertClaimProjectQuery(String   targetQuery, String projectQuery, Claim claim) {
+
+        return " WITH ins1 AS (\n" +
+                targetQuery+
+                "    ),\n ins2 AS (\n" +
+                projectQuery+
+                "    ),\n ins3 AS (\n" +
+                generateInsertClaimQuery(claim.getDate(), claim.getUserMail(), claim.getSourceType(), claim.getTargetType(), claim.getSource().getOpenaireId(), claim.getTarget().getOpenaireId(),"resultProject_outcome_isProducedBy") +
+                "    ),\n ins4 AS (\n" +
+                "    INSERT INTO has_source_project (claim_id, openaire_id)\n" +
+                "    SELECT id, source_id\n" +
+                "    FROM   ins3) \n"+
+                "    INSERT INTO has_target_result(claim_id, openaire_id)\n" +
+                "    SELECT id, target_id\n" +
+                "    FROM   ins3;";
+    }
+    public  String generateInsertClaimProjectQuery(Result targetResult, Project project, Claim claim) {
+
+        return
+                generateInsertClaimProjectQuery(generateInsertResultQuery(targetResult.getOpenaireId(), targetResult.getResultType(), targetResult.getTitle(), targetResult.getCollectedFrom(), targetResult.getExternalUrl(), targetResult.getDOI(), targetResult.getOrcidworkid(), targetResult.getAccessRights(), targetResult.getEmbargoEndDate(), targetResult.getBestLicense(), targetResult.getRecordPath(),targetResult.getRecordFormat()),
+                        generateInsertProjectQuery(project.getOpenaireId(), project.getName(), project.getAcronym(), project.getFunderId(), project.getFunderName(), project.getFunderShortName()), claim);
+    }
+    public  String generateInsertClaimContextQuery(Result targetResult, Context context, Claim claim) {
+
+        return generateInsertClaimContextQuery
+                (generateInsertResultQuery(targetResult.getOpenaireId(), targetResult.getResultType(), targetResult.getTitle(), targetResult.getCollectedFrom(), targetResult.getExternalUrl(), targetResult.getDOI(), targetResult.getOrcidworkid(), targetResult.getAccessRights(), targetResult.getEmbargoEndDate(), targetResult.getBestLicense(), targetResult.getRecordPath(),targetResult.getRecordFormat())
+                        ,generateInsertContextQuery(context.getOpenaireId(), context.getTitle()),claim);
+    }
+    public  String generateInsertClaimContextQuery(String targetQuery,String sourceQuery, Claim claim) {
+
+        return " WITH ins1 AS (\n" +targetQuery+
+                "    ),\n ins2 AS (\n" +
+                sourceQuery+
+                "   ),\n ins3 AS (\n" +
+                generateInsertClaimQuery(claim.getDate(), claim.getUserMail(), claim.getSourceType(), claim.getTargetType(), claim.getSource().getOpenaireId(), claim.getTarget().getOpenaireId(),"") +
+                "    ), ins4 AS (\n" +
+                "    INSERT INTO has_source_context(claim_id, openaire_id)\n" +
+                "    SELECT id, source_id\n" +
+                "    FROM   ins3) \n"+
+                "    INSERT INTO has_target_result(claim_id, openaire_id)\n" +
+                "    SELECT id, target_id\n" +
+                "    FROM   ins3;";
+    }
+*/
+    /**
+     ** Delete Tables Queries **
+     **/
+
+    public String generateDeleteClaimTablesQuery() {
+        return "drop table  if exists has_source_context;\n" +
+                "drop table if exists has_source_project;\n" +
+                "drop table if exists has_source_result;\n" +
+                "drop table if exists has_target_project;\n" +
+                "drop table if exists has_target_result;\n" +
+                "drop table if exists claim;\n" +
+                "drop table if exists project;\n" +
+                "drop table if exists result;\n" +
+                "drop table if exists context;\n" +
+                "\n ";
+
+    }
+
+    /**
+     ** Create Tables Queries **
+     **/
+
+    public String generateCreateClaimTablesQuery() {
+        return "CREATE TABLE project (\n" +
+                "        openaire_id varchar(60) primary key NOT NULL,\n" +
+                "        name text NOT NULL,\n" +
+                "        acronym text,\n" +
+                "        funder_id varchar(60) NOT NULL,\n" +
+                "        funder_name text NOT NULL,\n" +
+                "        funder_acronym text NOT NULL,\n" +
+                "        notify boolean DEFAULT TRUE,\n" +
+                "        contact_person text[],\n" +
+                "        token varchar(60)\n" +
+                ");\n" +
+                "\n" +
+                "CREATE TABLE result (\n" +
+                " id  serial  NOT NULL,\n" +
+                " openaire_id varchar(60) primary key NOT NULL,\n" +
+                "\t\tresult_type varchar(30) NOT NULL,\n" +
+                "\t\tdoi text,\n" +
+                "\t\torcidworkid text,\n" +
+                "\t\ttitle text,\n" +
+                "\t\taccess_rights varchar(30),\n" +
+                "\t\tembargo_end_date date,\n" +
+                "\t\tbest_license varchar(30),\t\t\n" +
+                "\t\texternal_url text,\n" +
+                "\t\tcollected_from varchar(60) ,\n" +
+                "\t\trecord_path text , \n" +
+                "\t\trecord_format varchar(10)\n" +
+                ");\n" +
+                "\n" +
+                "CREATE TABLE context (\n" +
+                "        openaire_id varchar(60) primary key,\n" +
+                "        name text\n" +
+                ");\n" +
+                "CREATE TABLE claim (\n" +
+                "        id serial primary key NOT NULL,\n" +
+                "        claim_date timestamp without time zone NOT NULL,\n" +
+                "        claimedBy text NOT NULL,\n" +
+                "        source_type varchar(30) NOT NULL,\n" +
+                "        target_type varchar(30) NOT NULL,\n" +
+                "        source_id varchar(60) NOT NULL,\n" +
+                "        target_id varchar(60) references result(openaire_id) NOT NULL,\n" +
+                "        curation_date  timestamp without time zone,\n" +
+                "        curated_by text,\n" +
+                "        approved boolean DEFAULT TRUE,\n" +
+                "        claim_status varchar(30),\n" +
+                "        semantics varchar(60)\n" +
+                ");\n" +
+                "\n" +
+                "CREATE TABLE has_source_context(\n" +
+                "\tclaim_id int references claim(id) NOT NULL,\n" +
+                "\topenaire_id varchar(60) references context(openaire_id) NOT NULL\n" +
+                ");\n" +
+                "CREATE TABLE has_source_project(\n" +
+                "\tclaim_id int references claim(id) NOT NULL,\n" +
+                "\topenaire_id varchar(60) references project(openaire_id) NOT NULL\n" +
+                ");\n" +
+                "CREATE TABLE has_source_result(\n" +
+                "\tclaim_id int references claim(id) NOT NULL,\n" +
+                "\topenaire_id varchar(60) references result(openaire_id) NOT NULL\n" +
+                ");\n"+
+                "CREATE TABLE has_target_project(\n" +
+                "\tclaim_id int references claim(id) NOT NULL,\n" +
+                "\topenaire_id varchar(60) references project(openaire_id) NOT NULL\n" +
+                ");\n" +
+                "CREATE TABLE has_target_result(\n" +
+                "\tclaim_id int references claim(id) NOT NULL,\n" +
+                "\topenaire_id varchar(60) references result(openaire_id) NOT NULL\n" +
+                ");\n"
+
+                ;
+
+    }
+
+    /**
+     ** Select Queries *Old* Database **
+     **/
+
+
+    public String generateSelectDMFByIdQuery(String id) {
+        return " Select * from "+this.migrationTable+"  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%' and  resultid='"+id+"'  order by date desc limit 1";
+    }
+
+    public String generateSelectConceptDMFClaimsQuery(Integer limit) {
+        return " Select * from "+this.migrationTable+"  where ( type='dmf2actions' or type='updates2actions' ) and xml LIKE '%<oaf:concept%' "+(limit>0?" limit "+limit:"");
+    }
+    /**
+     *
+     * @param limit : for limit > 0 the query adds limit clause, for limit < 0 query skips limit clause
+     * @return
+     */
+    public String generateSelectRelationEnrichedWithDMFClaimsQuery(Integer limit) {
+        return " select rel.*, dmf.dmf from (Select * from "+this.migrationTable+"  where type='rels2actions' order by id) as rel left outer join \n" +
+                        "(Select DISTINCT ON (resultid) resultid,date, xml as dmf from "+this.migrationTable+"  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%'   order by resultid,date desc , xml) as dmf on rel.resultid=dmf.resultid"
+                +(limit>0?" limit "+limit:"");
+
+    }
+
+    /**
+     *
+     * @param limit : for limit > 0 the query adds limit clause, for limit < 0 query skips limit clause
+     * @return
+     */
+    public String generateSelectConceptClaimsEnrichedWithDMFClaimsQuery(Integer limit) {
+        return " select rel.*, dmf.dmf from (Select * from "+this.migrationTable+"  where  ( type='dmf2actions' or type='updates2actions' ) and xml LIKE '%<oaf:concept%' order by id) as rel left outer join \n" +
+                "(Select DISTINCT ON (resultid) resultid,date, xml as dmf from "+this.migrationTable+"  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%'   order by resultid,date desc , xml) as dmf on rel.resultid=dmf.resultid"
+                +(limit>0?" limit "+limit:"");
+
+    }
+    
+    public String generateSelectConceptClaimByIDEnrichedWithDMFClaimsQuery(Integer limit, String claimID) {
+        return " select rel.*, dmf.dmf from (Select * from "+this.migrationTable+"  where id='"+claimID+"' and  ( type='dmf2actions' or type='updates2actions' ) and xml LIKE '%<oaf:concept%') as rel left outer join \n" +
+                "(Select DISTINCT ON (resultid) resultid,date, xml as dmf from "+this.migrationTable+"  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%'   order by resultid,date desc , xml)  as dmf on rel.resultid=dmf.resultid"
+                +(limit>0?" limit "+limit:"");
+    }
+    public String generateSelectRelationClaimByIDEnrichedWithDMFClaimsQuery(Integer limit, String claimID) {
+        return " select rel.*, dmf.dmf from (Select * from "+this.migrationTable+"   where id='"+claimID+"' and type='rels2actions' ) as rel left outer join \n" +
+                "(Select DISTINCT ON (resultid) resultid,date, xml as dmf from "+this.migrationTable+"  where type='dmf2actions' and xml NOT ILIKE '%<oaf:concept%'   order by resultid,date desc , xml) as dmf on rel.resultid=dmf.resultid"
+                +(limit>0?" limit "+limit:"");
+    }
+
+
+    public  String generateSelectConceptClaimByIdQuery(String id) {
+        return " Select * from "+this.migrationTable+"  where ( type='dmf2actions' or type='updates2actions' ) and xml LIKE '%<oaf:concept%' and id='"+id+"'";
+
+    }
+    public  String generateSelectRelationClaimByIdQuery(String id) {
+        return " Select * from "+this.migrationTable+"  where type='rels2actions' and id='"+id+"'";
+
+    }
+
+
+    /**
+     ** Select - Fetch Queries *New* Database **
+     **/
+
+
+    private  String addPagingClause(Integer limit, Integer offset) {
+        if(limit==null && offset==null){
+            return "";
+        }
+        else if((limit==null || offset==null || offset <0 || limit<=0)){
+            limit=10;
+            offset=0;
+        }
+        return  " limit  "+limit+ "  offset "+offset;
+
+    }
+    private  String addOrderByClause( String orderBy, boolean desc) {
+        if(orderBy==null){
+            return null;
+        }else if(orderBy.equals("date")){
+            return  " order by claim.claim_date "+((desc)?"desc":"asc");
+        }else if(orderBy.equals("user")){
+            return  " order by claim.claimedBy "+((desc)?"desc":"asc");
+
+        }else if(orderBy.equals("source")){
+            return  " order by claim.source_title "+((desc)?"desc":"asc");
+
+        }else if(orderBy.equals("target")){
+            return  " order by claim.target_title "+((desc)?"desc":"asc");
+
+        }else{
+            return  " order by claim.claim_date  desc";
+        }
+ 
+    }
+
+    private  String addFilterByType( List<String> types) {
+        if(types == null || types.isEmpty()){
+            return null;
+        }else if (types.contains(ClaimUtils.PUBLICATION) && types.contains(ClaimUtils.DATASET) && types.contains(ClaimUtils.PROJECT) && types.contains(ClaimUtils.CONTEXT) ){
+            //it's all types - no need to filter
+            return null;
+        }
+        else{
+            String filter = "";
+            for(String type: types){
+                   filter+=((filter.length()>0)?" or  ":"")+" claim.source_type = '"+type+"' or claim.target_type = '"+type+"' ";
+            }
+            return filter;
+        }
+    }
+
+    public  String generateCountByUser(String user ,String  keyword,List<String> types ) {
+        if((keyword == null || keyword.equals(""))&&types.isEmpty()){
+            return " select count(*) from claim where "+ " claim.claimedBy='" + user + "'";
+        }
+        return " select count(*) from claim where  claim.id in ( select claim.id from ("+generateFetchClaimsByUser(user, null,null,keyword,null,false,types)+")as claim )";
+    }
+    public  String generateCountByDate(String dateFrom, String dateTo ,String  keyword,List<String> types) {
+        if((keyword == null || keyword.equals(""))&&types.isEmpty()){
+            return " select count(*) from claim where "+ " claim.claim_date >= '" + dateFrom + "' and claim.claim_date <= '" + dateTo + "' ";
+        }
+        return " select count(*) from claim where  claim.id in ( select claim.id from ("+generateFetchClaimsByDate(dateFrom,dateTo, null,null,keyword,null,false, types)+")as claim )";
+    }
+    public  String generateCountByProject(String projectId ,String  keyword, List<String> types ) {
+        if((keyword == null || keyword.equals(""))&&types.isEmpty()){
+            return " select count(*) from claim where "+"claim.source_id ='" + projectId + "'";
+        }
+        return " select count(*) from claim where  claim.id in ( select claim.id from ("+generateFetchClaimsByProject(projectId, null,null,keyword,null,false, types)+")as claim )";
+    }
+    /*
+    public  String generateCountByProjectToken(String projectToken,String email ,String  keyword, List<String> types ) {
+        return " select count(*) from claim where  claim.id in ( select claim.id from ("+generateFetchClaimsByProjectToken(projectToken, email,null,null,keyword,null,false, types)+")as claim )";
+    }
+    */
+    public  String generateCountByFunder(String funderId ,String  keyword, List<String> types ) {
+        if((keyword == null || keyword.equals(""))&&types.isEmpty()){
+            return " select count(*) from claim,project as source where claim.source_id = source.openaire_id and source.funder_id ='" + funderId + "'";
+        }
+        return " select count(*) from claim where  claim.id in ( select claim.id from ("+generateFetchClaimsByFunder(funderId, null,null,keyword,null,false, types)+")as claim )";
+    }
+    public  String generateCountByContext(String contextId ,String  keyword, List<String> types ) {
+        if((keyword == null || keyword.equals(""))&&types.isEmpty()){
+             return " select count(*) from claim where "+" claim.source_id ='" + contextId + "'";
+        }
+        return " select count(*) from claim where  claim.id in ( select claim.id from ("+generateFetchClaimsByContext(contextId, null,null,keyword,null,false, types)+")as claim )";
+
+    }
+    public  String generateCountByResult(String resultId ,String  keyword, List<String> types) {
+        if((keyword == null || keyword.equals(""))&&types.isEmpty()){
+            return " select count(*) from claim where "+" (  claim.source_id= '"+resultId+"'  or  claim.target_id = '"+resultId+"' )";
+        }
+        return " select count(*) from claim where  claim.id in ( select claim.id from ("+generateFetchClaimsByResult(resultId, null,null,keyword,null,false,types)+")as claim )";
+
+    }
+
+    public  String generateCountAllClaims(String keyword,List<String> types) {
+        String filterByType = addFilterByType(types);
+        if((keyword == null || keyword.equals(""))&&types.isEmpty()){
+            return "select count(*) from claim "+((filterByType==null)?"":" where "+filterByType+" ");
+        }
+        return " select count(*) from claim where claim.id in ( select claim.id from ("+generateFetchClaims(null,null,keyword,null,false,types)+" ) as claim )";
+
+    }
+    public  String generateFetchAllProjectsQuery() {
+        return " select "+getProjectFields("source")+" from project as source";
+
+    }
+    public  String generateFetchAllContextsQuery() {
+        return " select "+getContextFields("source")+" from context as source";
+    }
+    public  String generateFetchClaimsByUser(String user, Integer limit, Integer offset,String keyword,String orderBy, boolean desc,List<String> types) {
+        // "claim.claim_date", true
+        String clause=  " claim.claimedBy='" + user + "'";
+        return generateSelectClaimQueryAsUnionOfAllRelations(limit, offset, orderBy,desc,clause,keyword, types);
+
+    }
+    /**
+     *
+     * @param limit how many results to return
+     * @param offset starting from
+     * @param keyword containing keyword
+     * @return
+     */
+
+    public  String generateFetchClaims(Integer limit, Integer offset,String keyword,String orderBy, boolean desc,List<String> types) {
+        return generateSelectClaimQueryAsUnionOfAllRelations(limit, offset, orderBy,desc,null,keyword, types)+"";
+    }
+    /**
+     *
+     * @param limit how many results to return
+     * @param offset starting from
+     * @return
+     */
+     public  String generateFetchClaims(Integer limit, Integer offset, String orderBy, boolean desc,List<String> types) {
+         String keyword = null;
+        return generateSelectClaimQueryAsUnionOfAllRelations(limit, offset, orderBy,desc,null,keyword,types)+"";
+
+    }
+     public  String generateFetchClaimsByDate(String dateFrom, String dateTo, Integer limit, Integer offset,String keyword, String orderBy, boolean desc,List<String> types) {
+         String clause=  " claim.claim_date >= '" + dateFrom + "' and claim.claim_date <= '" + dateTo + "' ";
+          return generateSelectClaimQueryAsUnionOfAllRelations(limit, offset, orderBy,desc,clause,keyword,types);
+    }
+    public  String generateFetchClaimsByProject(String projectId, Integer limit, Integer offset,String keyword, String orderBy, boolean desc, List<String> types) {
+        String clause = "source.openaire_id ='" + projectId + "'";
+        String filterByType = addFilterByType(types);
+        return " select * from ("+" select * from ( " + generateSelectclaimQuery(ClaimUtils.PROJECT, ClaimUtils.PUBLICATION, limit, offset, orderBy, desc, clause, keyword) + " ) as claim  "+
+                ") as claim "+
+                ((filterByType==null)?"":" where "+filterByType+" ");
+    }
+/*
+    public  String generateFetchClaimsByProjectToken(String token, String email, Integer limit, Integer offset,String keyword, String orderBy, boolean desc, List<String> types) {
+        String clause = "source.token = '" + token + "' and '" + email + "' = ANY(source.contact_person)";
+        String filterByType = addFilterByType(types);
+        return " select * from ("+" select * from ( " + generateSelectclaimQuery(ClaimUtils.PROJECT, ClaimUtils.PUBLICATION, limit, offset, orderBy, desc, clause, keyword) + " ) as claim  "+
+                ") as claim "+
+                ((filterByType==null)?"":" where "+filterByType+" ");
+    }
+*/
+    public String generateSelectProjectIdByTokenQuery(String token, String email) {
+        return "SELECT openaire_id FROM project WHERE token='"+token+"' AND '"+email+"'= ANY(contact_person);";
+    }
+
+    public  String generateFetchClaimsByContext(String contextId,  Integer limit, Integer offset,String keyword, String orderBy, boolean desc, List<String> types) {
+        String clause=  "claim.source_id ='" + contextId + "'";
+        String filterByType = addFilterByType(types);
+        return " select * from ("+" ( " +generateSelectclaimQuery(ClaimUtils.CONTEXT,ClaimUtils.PUBLICATION,limit, offset, orderBy,desc,clause,keyword)+")"+
+                ") as claim "+
+                ((filterByType==null)?"":" where "+filterByType+" ");
+    }
+    public  String generateFetchClaimsByFunder(String funderId, Integer limit, Integer offset,String keyword, String orderBy, boolean desc, List<String> types) {
+        String whereClause = "source_id =source.openaire_id ";
+        String filterByType = addFilterByType(types);
+        return " select * from ("+" ( " +generateSelectclaimQuery(ClaimUtils.PROJECT,ClaimUtils.PUBLICATION, limit, offset, orderBy,desc,whereClause,keyword)+" )"+
+                ") as claim "+
+                ((filterByType==null)?"":" where "+filterByType+" ");
+
+
+    }
+    public  String generateFetchClaimsByResult(String resultId,  Integer limit, Integer offset, String keyword, String orderBy, boolean desc, List<String> types) {
+         String queryWhereClause=" ( source.openaire_id = '"+resultId+"'  or target.openaire_id = '"+resultId+"' )";
+        String filterByType = addFilterByType(types);
+        return " select * from ("+" ( " +generateSelectclaimQuery(ClaimUtils.PUBLICATION,ClaimUtils.PUBLICATION, limit, offset, orderBy,desc,queryWhereClause,keyword)+" ) \nunion "+
+                " ( " +generateSelectclaimQuery(ClaimUtils.PROJECT,ClaimUtils.PUBLICATION, limit, offset, orderBy,desc,queryWhereClause,keyword)+" ) \nunion "+
+                " ( " +generateSelectclaimQuery(ClaimUtils.CONTEXT,ClaimUtils.PUBLICATION, limit, offset, orderBy,desc,queryWhereClause,keyword)+" ) "+
+                ") as claim "+
+                ((filterByType==null)?"":" where "+filterByType+" ");
+
+    }
+
+    public  String generateFetchClaimsByClaimId(String claimId, String sourceType, String targetType) {
+        String keyword = null;
+        String clause=  " claim.id = '" +claimId + "' ";
+        String orderbyLimitClause= null;
+        if(sourceType.equals(ClaimUtils.PUBLICATION)||sourceType.equals(ClaimUtils.DATASET)){
+            return generateSelectclaimQuery(sourceType,targetType,null,null,null,false, clause,keyword);
+        }else if(sourceType.equals(ClaimUtils.PROJECT)){
+            return generateSelectclaimQuery(sourceType,targetType,null,null,null,false, clause,keyword);
+        }else if(sourceType.equals(ClaimUtils.CONTEXT)){
+            return generateSelectclaimQuery(sourceType,targetType,null,null,null,false, clause,keyword);
+        }
+        return null;
+    }
+
+    private  String getClaimFields() {
+        return " claim.id, claim.claim_date, claim.claimedBy, claim.source_type, claim.target_type, claim.semantics, claim.curation_date, claim.curated_by, claim.approved ";
+    }
+    private  String getResultFields(String tableAlias) {
+        return " "+tableAlias+".openaire_id, "+tableAlias+".title  "+tableAlias+"_title, "+tableAlias+".result_type, "+tableAlias+".doi, "+tableAlias+".orcidworkid, "+tableAlias+".access_rights, "+tableAlias+".embargo_end_date, "+tableAlias+".best_license, "+tableAlias+".external_url,  "+tableAlias+".collected_from  ";
+    }
+    private  String getProjectFields(String tableAlias) {
+        return " "+tableAlias+".openaire_id, "+tableAlias+".name  as "+tableAlias+"_title, "+tableAlias+".acronym, "+tableAlias+".funder_id, "+tableAlias+".funder_name, null as field6, null as field7, null as field8, null as field9, null as field10 ";
+    }
+    private  String getContextFields(String tableAlias) {
+        return " "+tableAlias+".openaire_id, "+tableAlias+".name  "+tableAlias+"_title, "+" null as field3, null as field4, null as field5, null as field6, null as field7, null as field8, null as field9, null as field10 ";
+    }
+
+    private  String getFieldsPerType(String type, String tableAlias){
+        String fields= null;
+
+        if (type != null) {
+            if (type.equals(ClaimUtils.PUBLICATION) || type.equals(ClaimUtils.DATASET)) {
+                fields = getResultFields(tableAlias);
+
+            } else if (type.equals(ClaimUtils.PROJECT)) {
+                fields = getProjectFields(tableAlias);
+
+            } else if (type.equals(ClaimUtils.CONTEXT)) {
+                fields = getContextFields(tableAlias);
+            }
+        }
+
+        return fields;
+    }
+    private  String generateSelectclaimQuery(String sourceType, String targetType, Integer limit,Integer offset,String orderBy, boolean desc,String whereClause, String keyword) {
+        if(sourceType == null || targetType == null){
+            return null;
+        }
+        /*
+        " select "+getClaimFields()+" ,"+getFieldsPerType(sourceType, "source")+" , "+getFieldsPerType(targetType,"target")+
+                " \nfrom claim, "+getTypeForTable(sourceType)+" as source, "+getTypeForTable(targetType)+" as target \n" +
+                "where claim.source_id = source.openaire_id and claim.target_id = target.openaire_id "+((specificWhereClause==null)?"":" and "+specificWhereClause+" ");
+         */
+        String orderByClause= addOrderByClause(orderBy,desc);
+        String pagingClause= addPagingClause(limit,offset);
+        return " select "+getClaimFields()+" ,"+getFieldsPerType(sourceType, "source")+" , "+getFieldsPerType(targetType,"target")+
+                " \nfrom claim, "+getTypeForTable(sourceType)+" as source, has_source_"+getTypeForTable(sourceType)+", has_target_"+getTypeForTable(targetType)+", "+getTypeForTable(targetType)+" as target \n" +
+                "where claim.id =  has_source_"+getTypeForTable(sourceType)+".claim_id   and   has_source_"+getTypeForTable(sourceType)+".openaire_id = source.openaire_id " +
+                "and claim.id =  has_target_"+getTypeForTable(targetType)+".claim_id   and   has_target_"+getTypeForTable(targetType)+".openaire_id  = target.openaire_id "+
+                ((keyword==null)?"":(" and ("+getKeywordClauseForType(sourceType, "source", keyword)+" or "+getKeywordClauseForType(targetType, "target", keyword)+" ")+" or "+getKeywordClauseForClaim( keyword)+" )")+
+                ((whereClause==null)?"":" and "+whereClause+" ")+
+                ((orderByClause==null)?"":" "+orderByClause+" ")+
+                pagingClause;
+    }
+    private String getKeywordClauseForType(String type,String tableAlias,String keyword){
+        if (type == null ||keyword == null){
+            return "";
+        }
+        keyword=keyword.toLowerCase();
+        if (type.equals(ClaimUtils.PUBLICATION)||type.equals(ClaimUtils.DATASET)){
+            return "  (lower("+tableAlias+".title) like '%"+keyword+"%' or lower("+tableAlias+".doi) like '%"+keyword+"%'"+")";
+        }else if (type.equals(ClaimUtils.PROJECT)){
+            return "  (lower("+tableAlias+".name) like '%"+keyword+"%' or lower("+tableAlias+".acronym) like '%"+keyword+"%' or lower("+tableAlias+".funder_name) like '%"+keyword+"%' or lower("+tableAlias+".funder_acronym) like '%"+keyword+"%' "+")";
+        }else if (type.equals(ClaimUtils.CONTEXT)){
+            return "  (lower("+tableAlias+".name) like '%"+keyword+"%' )";
+        }
+        return "";
+    }
+    private String getKeywordClauseForClaim(String keyword){
+        if (keyword == null){
+            return "";
+        }else {
+            return " (lower(claim.claimedby) like '%"+keyword.toLowerCase()+"%')";
+        }
+     }
+    private  String generateSelectClaimQueryAsUnionOfAllRelations(Integer limit,Integer offset,String orderBy, boolean desc,String specificWhereClause,String keyword,List<String> types) {
+        //TODO eliminate unions  based on the to
+        // ClaimUtils.PUBLICATION or ClaimUtils.DATASET  it
+        String orderByClause= addOrderByClause(orderBy,desc);
+        String pagingClause= addPagingClause(limit,offset);
+        String filterByType = addFilterByType(types);
+         return "select * from ("+
+
+                " ( " +generateSelectclaimQuery(ClaimUtils.PUBLICATION,ClaimUtils.PUBLICATION,null,null,null,false, specificWhereClause,keyword)+" ) \nunion "+
+                " ( " +generateSelectclaimQuery(ClaimUtils.DATASET,ClaimUtils.DATASET,null,null,null,false, specificWhereClause,keyword)+" ) \nunion "+
+                " ( " +generateSelectclaimQuery(ClaimUtils.PROJECT,ClaimUtils.PUBLICATION, null,null,null,false, specificWhereClause,keyword)+" ) \nunion "+
+                " ( " +generateSelectclaimQuery(ClaimUtils.CONTEXT,ClaimUtils.PUBLICATION,null,null,null,false, specificWhereClause,keyword)+" )" +
+
+                ") as claim   "+
+                ((filterByType==null)?"":" where "+filterByType+" ")+
+                ((orderByClause==null)?"":" "+orderByClause+" ")+
+                pagingClause;
+
+
+    }
+    private  String getTypeForTable(String type){
+        if(type == null){
+            return null;
+        }
+        if(type.equals(ClaimUtils.PUBLICATION)||type.equals(ClaimUtils.DATASET)){
+            return "result";
+        }else{
+            return type;
+        }
+    }
+    /**
+     ** Update - Queries *New* Database **
+     **/
+
+    private  void updateResult(){
+
+    }
+    private  void updateProject(){
+
+    }
+    /**
+     ** Delete - Queries *New* Database **
+     **/
+
+    private String generateDeleteEntityQuery(String resultid, String claimId, String type){
+        if(type == null||resultid == null||claimId ==  null ){
+            return null;
+        }
+        String query = null;
+        if(type.equals(ClaimUtils.PUBLICATION)||type.equals(ClaimUtils.DATASET)){
+            query = generateDeleteResultQuery(resultid,claimId);
+        }else if(type.equals(ClaimUtils.PROJECT)){
+            query = generateDeleteProjectQuery(resultid,claimId);
+        }else if (type.equals(ClaimUtils.CONTEXT)){
+            query = generateDeleteContextQuery(resultid,claimId);
+        }
+        return query;
+    }
+/*
+    Before delete check a Result, Project, Context
+    check if there is another claim in  has_source_* or has_target_* relation
+    for the entity
+ */
+    private String generateDeleteResultQuery(String resultid, String claimId ){
+        String query = " DELETE FROM "+getTypeForTable(ClaimUtils.PUBLICATION)+" WHERE  openaire_id = '"+resultid+"' and NOT EXISTS \n" +
+                "   (   " +generateSelectOthersFromRelationTableQuery(resultid,claimId,getSourceTableName(ClaimUtils.PUBLICATION)) + " union " +
+                generateSelectOthersFromRelationTableQuery(resultid,claimId,getTargetTableName(ClaimUtils.PUBLICATION))+"  ) ;\n" ;
+        return query;
+    }
+    private String generateDeleteProjectQuery(String resultid, String claimId ){
+        String query = " DELETE FROM "+getTypeForTable(ClaimUtils.PROJECT)+" WHERE openaire_id = '"+resultid+"' and NOT EXISTS \n" +
+                "  (    " +generateSelectOthersFromRelationTableQuery(resultid,claimId,getSourceTableName(ClaimUtils.PROJECT)) + " union " +
+                generateSelectOthersFromRelationTableQuery(resultid,claimId,getTargetTableName(ClaimUtils.PROJECT))+"  ) ;\n" ;
+        return query;
+    }
+    private String generateDeleteContextQuery(String resultid, String claimId ){
+        String query = " DELETE FROM "+getTypeForTable(ClaimUtils.CONTEXT)+" WHERE openaire_id = '"+resultid+"' and NOT EXISTS \n" +
+                " (  " +generateSelectOthersFromRelationTableQuery(resultid,claimId,getSourceTableName(ClaimUtils.CONTEXT)) +"  ) ;\n" ;
+        return query;
+    }
+
+    /**
+     * Select form a has_source_* or has_target_* table
+     * ...
+     * @param resultid
+     * @param claimId
+     * @param tableName
+     * @return
+     */
+    private String  generateSelectOthersFromRelationTableQuery(String resultid, String claimId , String  tableName){
+        String query =
+                " SELECT 1 FROM "+ tableName+"  WHERE openaire_id = '"+resultid+"' and claim_id != " +claimId + "  " ;
+        return query;
+    }
+    public String  generateDeleteFullClaimQuery(String id, String user, String sourceType, String sourceId, String targetType, String targetId){
+        //TODO generate delete query
+        String query =
+                "BEGIN;\n" +
+                //delete has_source_*
+                "DELETE FROM "+ getSourceTableName(sourceType)+" WHERE   claim_id = "+id+" ;\n" +
+
+                //delete has_target_*
+                "DELETE FROM "+ getTargetTableName(targetType)+" WHERE  claim_id = "+id+" ;\n" +
+
+                //delete claim
+                "DELETE FROM claim where id = "+id+";\n" +
+
+                        //delete source
+                generateDeleteEntityQuery(sourceId,id,sourceType)+
+
+                        //delete target
+                generateDeleteEntityQuery(targetId,id,targetType)+
+                "COMMIT";
+        return query;
+    }
+    public String  generateSelectClaimQuery(String id, String user){
+
+        String query =" ";
+        return " Select id, source_type, source_id, target_type, target_id from claim where id = "+id +" and claimedBy = '"+user+"' ";
+    }
+    public String  generateSelectClaimQuery(String id){
+
+        String query =" ";
+        return " Select id, source_type, source_id, target_type, target_id,claimedBy  from claim where id = "+id ;
+    }
+    /**
+     * used to fetch the information from DB
+     * @param ids
+     * @param users
+     * @return
+     */
+    public String  generateSelectClaimQuery(List<String> ids, List<String> users){
+
+        String query =" Select id, source_type, source_id, target_type, target_id from claim where ";
+        if(ids.size()>0 && users.size() > 0 && ids.size() == users.size()) {
+            for (int i = 0; i < ids.size(); i++) {
+                query+="  ( id = "+ids.get(i) +" and claimedBy = '"+users.get(i)+"' ) or";
+            }
+            query = query.substring(0, query.length()-2);
+            return query;
+        }
+        return null;
+    }
+
+    public  String generateSelectProjectByIdQuery(String projectId) {
+        return " Select " + getProjectFields("project") + " from project where openaire_id = '"+projectId +"'";
+    }
+
+    public  String generateSelectContactEmailsByProjectIdQuery(String projectId) {
+        return " Select contact_person from project where openaire_id = '" + projectId + "'";
+    }
+
+    public String generateUpdateTokenByProjectId(String projectdId, String newToken) {
+        return "UPDATE project SET token = '" + newToken + "' WHERE openaire_id = '" + projectdId + "'";
+    }
+    public String generateUpdateContactEmailsByProjectIdByProjectId(String projectdId, List<String> contactEmails) {
+        String emails = "";
+        if(contactEmails != null && contactEmails.size() > 0){
+            emails+="'{";
+            for(int i = 0; i< contactEmails.size(); i++){
+
+                emails+="\""+contactEmails.get(i)+"\""+((i < contactEmails.size() -1 )?",":"");
+            }
+            emails+="}'";
+        }
+
+        return "UPDATE project SET contact_person = " + emails + " WHERE openaire_id = '" + projectdId + "';";
+    }
+
+    public String generateUpdateClaimCuration(String curatedBy, String claimId, boolean approved) {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = new Date();
+        String dateStr=null;
+        dateStr=(format.format(date));
+
+        String query = "UPDATE claim "
+                + "SET curation_date='" + dateStr + "', curated_by='" + curatedBy + "', approved='" + approved +"' "
+                + "WHERE id = '" + claimId + "' RETURNING curation_date, curated_by, approved";
+
+        logger.debug("Query to execute: "+query);
+
+        return query;
+    }
+
+    public String getMigrationTable() {
+        return migrationTable;
+    }
+
+    public void setMigrationTable(String migrationTable) {
+        this.migrationTable = migrationTable;
+    }
+}
\ No newline at end of file
Index: modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.properties
===================================================================
--- modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.properties	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/main/resources/eu/dnetlib/data/claims/migration/springContext-claimsDemo.properties	(revision 47503)
@@ -0,0 +1,18 @@
+
+services.claimsDemo.db.driverClassName = org.postgresql.Driver
+services.claimsDemo.db.url = jdbc:postgresql://scoobydoo.di.uoa.gr:5432/claimsnewschema
+services.claimsDemo.db.username = invalid_username
+services.claimsDemo.db.password = invalid_password
+services.claimsDemo.directClaim.APIURL = http://beta.services.openaire.eu:8280/is/mvc/api/publications
+
+#email properties
+## EMAIL SETTINGS
+services.claims.mail.host = smtp.gmail.com
+services.claims.mail.port = 587
+services.claims.mail.from = invalid_email@email.com
+services.claims.mail.password = invalid_password
+services.claims.mail.angularUrl = http://duffy.di.uoa.gr:3000/claims-project-manager?token=
+services.claims.mail.specialRecipients = invalid_recipient@email.com
+
+services.claimsDemo.results.pathToSaveRecord = /home/argirok/claims/records/
+services.claimsDemo.reports.pathToSaveReport = /home/argirok/claims/reports/
\ No newline at end of file
Index: modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/OafParserTest.java
===================================================================
--- modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/OafParserTest.java	(nonexistent)
+++ modules/uoa-claims/claims-demo/src/test/java/eu/dnetlib/data/claims/migration/parser/OafParserTest.java	(revision 47503)
@@ -0,0 +1,523 @@
+package eu.dnetlib.data.claims.migration.parser;
+
+import eu.dnetlib.data.claims.migration.entity.Result;
+import eu.dnetlib.data.claimsDemo.ClaimUtils;
+import eu.dnetlib.data.claims.migration.entity.Project;
+import org.apache.log4j.BasicConfigurator;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.xpath.XPathExpressionException;
+import java.io.IOException;
+
+/**
+ * Created by kiatrop on 22/2/2016.
+ */
+public class OafParserTest {
+
+    @Before()
+    public void init(){
+        BasicConfigurator.configure();
+    }
+
+    private String publicationOaf = "<response>\n" +
+            "\t  <header>\n" +
+            "\t\t    <query>(((deletedbyinference = false) AND (oaftype exact result)) and (resulttypeid exact publication)) and (objidentifier exact od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46)</query>\n" +
+            "\t\t\t\t  <locale>en_GB</locale>\t\n" +
+            "\t\t\t\t\t<size>10</size>\n" +
+            "\t\t\t   <page>1</page>\n" +
+            "\t\t\t   <total>1</total>\n" +
+            "\t\t\t\t\t</header>\n" +
+            "\t  <results>\n" +
+            "\t\t\t\t\t\t\t\t\t<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+            "              xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\"\n" +
+            "              xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" +
+            "         <header>\n" +
+            "            <dri:objIdentifier>od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46</dri:objIdentifier>\n" +
+            "            <dri:dateOfCollection>2016-02-02T08:07:14Z</dri:dateOfCollection>\n" +
+             "         </header>\n" +
+            "         <metadata>\n" +
+            "            <oaf:entity xsi:schemaLocation=\"http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/0.3/oaf-0.3.xsd\">\n" +
+            "\t\t             <oaf:result>\n" +
+            "                  <title classid=\"main title\" classname=\"main title\" schemeid=\"dnet:dataCite_title\"\n" +
+            "                         schemename=\"dnet:dataCite_title\">ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ</title>\n" +
+            "                  <dateofacceptance>2010-01-01</dateofacceptance>\n" +
+            "                  <resulttype classid=\"publication\" classname=\"publication\" schemeid=\"dnet:result_typologies\"\n" +
+            "                              schemename=\"dnet:result_typologies\"/>\n" +
+            "                  <country classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" +
+            "                  <relevantdate classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" +
+            "                  <embargoenddate>2099-12-31</embargoenddate>\n" +
+            "                  <originalId>oai:cyberleninka.ru:article/5969541</originalId>\n" +
+            "                  <collectedfrom name=\"CyberLeninka - Russian open access scientific library\"\n" +
+            "                                 id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" +
+            "                  <pid classid=\"oai\" classname=\"oai\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">oai:cyberleninka.ru:article/5969541</pid>\n" +
+            "                  <pid classid=\"pmc\" classname=\"pmc\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">pmc_test</pid>\n" +
+            "                  <pid classid=\"orcidworkid\" classname=\"orcidworkid\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">orcidworkid_test</pid>\n" +
+    "                  <bestlicense classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" +
+            "                               schemename=\"dnet:access_modes\"/>\n" +
+            "\t\t                <children>\n" +
+            "\t\t\t                  <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" +
+            "\t\t\t                     <licence classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" +
+            "                                 schemename=\"dnet:access_modes\"/>\n" +
+            "                        <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" +
+            "                                      schemename=\"dnet:publication_resource\"/>\n" +
+            "                        <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" +
+            "                                  id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t                  </instance>\n" +
+            "\t\t                </children>\n" +
+            "\t\t             </oaf:result>\n" +
+            "            </oaf:entity>\n" +
+            "         </metadata>\n" +
+            "      </result>\n" +
+            "\t\t\t\t\t\t</results>\n" +
+            "\t  <browseResults>\n" +
+            "\t\t\t</browseResults>\n" +
+            "</response>";
+
+
+
+    /*
+            "\t\t                <children>\n" +
+            "\t\t\t                  <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" +
+            "\t\t\t                     <licence classid=\"CLOSED\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" +
+            "                                 schemename=\"dnet:access_modes\"/>\n" +
+            "                        <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" +
+            "                                      schemename=\"dnet:publication_resource\"/>\n" +
+            "                        <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" +
+            "                                  id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>h CLOSED_ACCESS_URL</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t                  </instance>\n" +
+            "\t\t                </children>\n" +
+ */
+    @Test
+    public void oaf2PublicationTest() throws Exception, ParserConfigurationException, SAXException, XPathExpressionException, IOException, TransformerException {
+        Result result = OafParser.oaf2Result(publicationOaf);
+        System.out.println(result.getExternalUrl());
+        Assert.assertNull(result.getAccessRights());
+        Assert.assertEquals("EMBARGO",result.getBestLicense());
+        Assert.assertEquals("infrastruct_::openaire", result.getCollectedFrom());
+        Assert.assertNull(result.getDoi());
+        Assert.assertEquals("oai:cyberleninka.ru:article/5969541",result.getOai());
+        Assert.assertEquals("od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46",result.getOpenaireId());
+        Assert.assertEquals("pmc_test",result.getPmcid());
+        Assert.assertEquals(ClaimUtils.PUBLICATION, result.getResultType());
+        Assert.assertEquals("ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ",result.getTitle());
+        Assert.assertEquals("xml", result.getRecordFormat());
+
+        Assert.assertEquals("http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki", result.getExternalUrl());
+        Assert.assertEquals("2099-12-31",result.getEmbargoEndDate());
+        Assert.assertEquals("orcidworkid_test", result.getOrcidworkid());
+
+    }
+    private String publicationOpenAccessUrl = "<response>\n" +
+            "\t  <header>\n" +
+            "\t\t    <query>(((deletedbyinference = false) AND (oaftype exact result)) and (resulttypeid exact publication)) and (objidentifier exact od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46)</query>\n" +
+            "\t\t\t\t  <locale>en_GB</locale>\t\n" +
+            "\t\t\t\t\t<size>10</size>\n" +
+            "\t\t\t   <page>1</page>\n" +
+            "\t\t\t   <total>1</total>\n" +
+            "\t\t\t\t\t</header>\n" +
+            "\t  <results>\n" +
+            "\t\t\t\t\t\t\t\t\t<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+            "              xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\"\n" +
+            "              xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" +
+            "         <header>\n" +
+            "            <dri:objIdentifier>od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46</dri:objIdentifier>\n" +
+            "            <dri:dateOfCollection>2016-02-02T08:07:14Z</dri:dateOfCollection>\n" +
+            "         </header>\n" +
+            "         <metadata>\n" +
+            "            <oaf:entity xsi:schemaLocation=\"http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/0.3/oaf-0.3.xsd\">\n" +
+            "\t\t             <oaf:result>\n" +
+            "                  <title classid=\"main title\" classname=\"main title\" schemeid=\"dnet:dataCite_title\"\n" +
+            "                         schemename=\"dnet:dataCite_title\">ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ</title>\n" +
+            "                  <dateofacceptance>2010-01-01</dateofacceptance>\n" +
+            "                  <resulttype classid=\"publication\" classname=\"publication\" schemeid=\"dnet:result_typologies\"\n" +
+            "                              schemename=\"dnet:result_typologies\"/>\n" +
+            "                  <country classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" +
+            "                  <relevantdate classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" +
+            "                  <embargoenddate>2099-12-31</embargoenddate>\n" +
+            "                  <originalId>oai:cyberleninka.ru:article/5969541</originalId>\n" +
+            "                  <collectedfrom name=\"CyberLeninka - Russian open access scientific library\"\n" +
+            "                                 id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" +
+            "                  <pid classid=\"oai\" classname=\"oai\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">oai:cyberleninka.ru:article/5969541</pid>\n" +
+            "                  <pid classid=\"pmc\" classname=\"pmc\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">pmc_test</pid>\n" +
+            "                  <pid classid=\"orcidworkid\" classname=\"orcidworkid\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">orcidworkid_test</pid>\n" +
+            "                  <bestlicense classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" +
+            "                               schemename=\"dnet:access_modes\"/>\n" +
+            "\t\t                <children>\n" +
+            "\t\t\t                  <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" +
+            "\t\t\t                     <licence classid=\"CLOSED\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" +
+            "                                 schemename=\"dnet:access_modes\"/>\n" +
+            "                        <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" +
+            "                                      schemename=\"dnet:publication_resource\"/>\n" +
+            "                        <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" +
+            "                                  id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>http://CLOSED_ACCESS_URL</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t                  </instance>\n" +
+            "\t\t                </children>\n" +
+            "\t\t                <children>\n" +
+            "\t\t\t                  <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" +
+            "\t\t\t                     <licence classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" +
+            "                                 schemename=\"dnet:access_modes\"/>\n" +
+            "                        <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" +
+            "                                      schemename=\"dnet:publication_resource\"/>\n" +
+            "                        <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" +
+            "                                  id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t                  </instance>\n" +
+            "\t\t                </children>\n" +
+
+
+
+            "\t\t             </oaf:result>\n" +
+            "            </oaf:entity>\n" +
+            "         </metadata>\n" +
+            "      </result>\n" +
+            "\t\t\t\t\t\t</results>\n" +
+            "\t  <browseResults>\n" +
+            "\t\t\t</browseResults>\n" +
+            "</response>";
+/*
+In this test, the oaf xml has multiple urls. The method should get the first "more" open Access with the following order (Open Access,Embargo, Closed )
+ */
+    @Test
+    public void oaf2PublicationOpenAccessUrlTest() throws Exception, ParserConfigurationException, SAXException, XPathExpressionException, IOException, TransformerException {
+        Result result = OafParser.oaf2Result(publicationOpenAccessUrl);
+        System.out.println(result.getExternalUrl());
+        Assert.assertNull(result.getAccessRights());
+        Assert.assertEquals("EMBARGO",result.getBestLicense());
+        Assert.assertEquals("infrastruct_::openaire", result.getCollectedFrom());
+        Assert.assertNull(result.getDoi());
+        Assert.assertEquals("oai:cyberleninka.ru:article/5969541",result.getOai());
+        Assert.assertEquals("od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46",result.getOpenaireId());
+        Assert.assertEquals("pmc_test",result.getPmcid());
+        Assert.assertEquals(ClaimUtils.PUBLICATION, result.getResultType());
+        Assert.assertEquals("ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ",result.getTitle());
+        Assert.assertEquals("xml", result.getRecordFormat());
+
+        Assert.assertEquals("http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki", result.getExternalUrl());
+        Assert.assertEquals("2099-12-31",result.getEmbargoEndDate());
+        Assert.assertEquals("orcidworkid_test", result.getOrcidworkid());
+
+    }
+    private String publicationWithDoiOaf = "<response>\n" +
+            "\t  <header>\n" +
+            "\t\t    <query>(((deletedbyinference = false) AND (oaftype exact result)) and (resulttypeid exact publication)) and (objidentifier exact od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46)</query>\n" +
+            "\t\t\t\t  <locale>en_GB</locale>\t\n" +
+            "\t\t\t\t\t<size>10</size>\n" +
+            "\t\t\t   <page>1</page>\n" +
+            "\t\t\t   <total>1</total>\n" +
+            "\t\t\t\t\t</header>\n" +
+            "\t  <results>\n" +
+            "\t\t\t\t\t\t\t\t\t<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+            "              xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\"\n" +
+            "              xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" +
+            "         <header>\n" +
+            "            <dri:objIdentifier>od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46</dri:objIdentifier>\n" +
+            "            <dri:dateOfCollection>2016-02-02T08:07:14Z</dri:dateOfCollection>\n" +
+            "         </header>\n" +
+            "         <metadata>\n" +
+            "            <oaf:entity xsi:schemaLocation=\"http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/0.3/oaf-0.3.xsd\">\n" +
+            "\t\t             <oaf:result>\n" +
+            "                  <title classid=\"main title\" classname=\"main title\" schemeid=\"dnet:dataCite_title\"\n" +
+            "                         schemename=\"dnet:dataCite_title\">ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ</title>\n" +
+            "                  <dateofacceptance>2010-01-01</dateofacceptance>\n" +
+            "                  <resulttype classid=\"publication\" classname=\"publication\" schemeid=\"dnet:result_typologies\"\n" +
+            "                              schemename=\"dnet:result_typologies\"/>\n" +
+            "                  <country classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" +
+            "                  <relevantdate classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" +
+            "                  <embargoenddate>2099-12-31</embargoenddate>\n" +
+            "                  <originalId>oai:cyberleninka.ru:article/5969541</originalId>\n" +
+            "                  <collectedfrom name=\"CyberLeninka - Russian open access scientific library\"\n" +
+            "                                 id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" +
+            "                  <pid classid=\"doi\" classname=\"doi\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">doi_test</pid>\n" +
+            "                  <pid classid=\"oai\" classname=\"oai\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">oai:cyberleninka.ru:article/5969541</pid>\n" +
+            "                  <pid classid=\"pmc\" classname=\"pmc\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">pmc_test</pid>\n" +
+            "                  <pid classid=\"orcidworkid\" classname=\"orcidworkid\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">orcidworkid_test</pid>\n" +
+            "                  <bestlicense classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" +
+            "                               schemename=\"dnet:access_modes\"/>\n" +
+            "\t\t                <children>\n" +
+            "\t\t\t                  <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" +
+            "\t\t\t                     <licence classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" +
+            "                                 schemename=\"dnet:access_modes\"/>\n" +
+            "                        <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" +
+            "                                      schemename=\"dnet:publication_resource\"/>\n" +
+            "                        <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" +
+            "                                  id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t                  </instance>\n" +
+            "\t\t                </children>\n" +
+            "\t\t             </oaf:result>\n" +
+            "            </oaf:entity>\n" +
+            "         </metadata>\n" +
+            "      </result>\n" +
+            "\t\t\t\t\t\t</results>\n" +
+            "\t  <browseResults>\n" +
+            "\t\t\t</browseResults>\n" +
+            "</response>";
+    @Test
+    public void oafWithDoi2PublicationTest() throws Exception, ParserConfigurationException, SAXException, XPathExpressionException, IOException, TransformerException {
+        Result result = OafParser.oaf2Result(publicationWithDoiOaf);
+        Assert.assertNull(result.getAccessRights());
+        Assert.assertEquals("EMBARGO",result.getBestLicense());
+        Assert.assertEquals("infrastruct_::openaire", result.getCollectedFrom());
+        Assert.assertNotNull(result.getDoi());
+        Assert.assertEquals("oai:cyberleninka.ru:article/5969541",result.getOai());
+        Assert.assertEquals("od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46",result.getOpenaireId());
+        Assert.assertEquals("pmc_test",result.getPmcid());
+        Assert.assertEquals(ClaimUtils.PUBLICATION, result.getResultType());
+        Assert.assertEquals("ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ",result.getTitle());
+
+        Assert.assertEquals("http://dx.doi.org/doi_test", result.getExternalUrl());
+        Assert.assertEquals("2099-12-31",result.getEmbargoEndDate());
+        Assert.assertEquals("orcidworkid_test", result.getOrcidworkid());
+        Assert.assertEquals("doi_test", result.getDoi());
+
+
+    }
+    private String datasetOaf = "<response>\n" +
+            "\t  <header>\n" +
+            "\t\t    <query>(((deletedbyinference = false) AND (oaftype exact result)) and (resulttypeid exact publication)) and (objidentifier exact od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46)</query>\n" +
+            "\t\t\t\t  <locale>en_GB</locale>\t\n" +
+            "\t\t\t\t\t<size>10</size>\n" +
+            "\t\t\t   <page>1</page>\n" +
+            "\t\t\t   <total>1</total>\n" +
+            "\t\t\t\t\t</header>\n" +
+            "\t  <results>\n" +
+            "\t\t\t\t\t\t\t\t\t<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+            "              xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\"\n" +
+            "              xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" +
+            "         <header>\n" +
+            "            <dri:objIdentifier>od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46</dri:objIdentifier>\n" +
+            "            <dri:dateOfCollection>2016-02-02T08:07:14Z</dri:dateOfCollection>\n" +
+            "         </header>\n" +
+            "         <metadata>\n" +
+            "            <oaf:entity xsi:schemaLocation=\"http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/0.3/oaf-0.3.xsd\">\n" +
+            "\t\t             <oaf:result>\n" +
+            "                  <title classid=\"main title\" classname=\"main title\" schemeid=\"dnet:dataCite_title\"\n" +
+            "                         schemename=\"dnet:dataCite_title\">ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ</title>\n" +
+            "                  <dateofacceptance>2010-01-01</dateofacceptance>\n" +
+            "                  <resulttype classid=\"dataset\" classname=\"dataset\" schemeid=\"dnet:result_typologies\"\n" +
+            "                              schemename=\"dnet:result_typologies\"/>\n" +
+            "                  <country classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" +
+            "                  <relevantdate classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" +
+            "                  <embargoenddate>2099-12-31</embargoenddate>\n" +
+            "                  <originalId>oai:cyberleninka.ru:article/5969541</originalId>\n" +
+            "                  <collectedfrom name=\"CyberLeninka - Russian open access scientific library\"\n" +
+            "                                 id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" +
+            "                  <pid classid=\"oai\" classname=\"oai\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">oai:cyberleninka.ru:article/5969541</pid>\n" +
+            "                  <pid classid=\"doi\" classname=\"doi\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">doi_test</pid>\n" +
+            "                  <pid classid=\"pmc\" classname=\"pmc\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">pmc_test</pid>\n" +
+            "                  <pid classid=\"orcidworkid\" classname=\"orcidworkid\" schemeid=\"dnet:pid_types\"\n" +
+            "                       schemename=\"dnet:pid_types\">orcidworkid_test</pid>\n" +
+            "                  <bestlicense classid=\"EMBARGO\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" +
+            "                               schemename=\"dnet:access_modes\"/>\n" +
+            "\t\t                <children>\n" +
+            "\t\t\t                  <instance id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\">\n" +
+            "\t\t\t                     <licence classid=\"OPEN\" classname=\"Open Access\" schemeid=\"dnet:access_modes\"\n" +
+            "                                 schemename=\"dnet:access_modes\"/>\n" +
+            "                        <instancetype classid=\"0001\" classname=\"Article\" schemeid=\"dnet:publication_resource\"\n" +
+            "                                      schemename=\"dnet:publication_resource\"/>\n" +
+            "                        <hostedby name=\"CyberLeninka - Russian open access scientific library\"\n" +
+            "                                  id=\"opendoar____::c0f971d8cd24364f2029fcb9ac7b71f5\"/>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>http://cyberleninka.ru/article/n/postkonversionnaya-asistoliya-zheludochkov-serdtsa-u-bolnyh-infarktom-miokarda-i-vozmozhnosti-ee-profilaktiki</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t\t                    <webresource>\n" +
+            "\t\t\t\t                       <url>http://cyberleninka.ru/article_covers/5969541.png</url>\n" +
+            "\t\t\t\t                    </webresource>\n" +
+            "\t\t\t                  </instance>\n" +
+            "\t\t                </children>\n" +
+            "\t\t             </oaf:result>\n" +
+            "            </oaf:entity>\n" +
+            "         </metadata>\n" +
+            "      </result>\n" +
+            "\t\t\t\t\t\t</results>\n" +
+            "\t  <browseResults>\n" +
+            "\t\t\t</browseResults>\n" +
+            "</response>";
+
+
+    @Test
+    public void oaf2DatasetTest() throws Exception, ParserConfigurationException, SAXException, XPathExpressionException, IOException, TransformerException {
+        Result result = OafParser.oaf2Result(datasetOaf);
+
+        Assert.assertNull(result.getAccessRights());
+        Assert.assertEquals("EMBARGO",result.getBestLicense());
+        Assert.assertEquals("infrastruct_::openaire", result.getCollectedFrom());
+        Assert.assertEquals("oai:cyberleninka.ru:article/5969541",result.getOai());
+        Assert.assertEquals("od______2806::d19b8560e0c4ce1f25dd9d661f4b2b46",result.getOpenaireId());
+        Assert.assertEquals("pmc_test",result.getPmcid());
+        Assert.assertEquals(ClaimUtils.DATASET, result.getResultType());
+        Assert.assertEquals("ПОСТКОНВЕРСИОННАЯ АСИСТОЛИЯ ЖЕЛУДОЧКОВ СЕРДЦА У БОЛЬНЫХ ИНФАРКТОМ МИОКАРДА И ВОЗМОЖНОСТИ ЕЕ ПРОФИЛАКТИКИ",result.getTitle());
+        Assert.assertEquals("xml", result.getRecordFormat());
+
+        Assert.assertEquals("http://dx.doi.org/doi_test", result.getExternalUrl());
+        Assert.assertEquals("2099-12-31",result.getEmbargoEndDate());
+        Assert.assertEquals("orcidworkid_test", result.getOrcidworkid());
+        Assert.assertEquals("doi_test", result.getDoi());
+
+    }
+
+
+
+    private String projectOaf = "<response>\n" +
+            "\t  <header>\n" +
+            "\t\t    <query>((deletedbyinference = false) AND (oaftype exact project)) and (projectcode exact 314867)</query>\n" +
+            "\t\t\t\t  <locale>en_GB</locale>\t\n" +
+            "\t\t\t\t\t<size>10</size>\n" +
+            "\t\t\t   <page>1</page>\n" +
+            "\t\t\t   <total>1</total>\n" +
+            "\t\t\t\t\t</header>\n" +
+            "\t  <results>\n" +
+            "\t\t\t\t\t\t\t\t\t<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
+            "              xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\"\n" +
+            "              xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" +
+            "         <header>\n" +
+            "            <dri:objIdentifier>corda_______::073d0a668885f9e7292a5d9c323e4a20</dri:objIdentifier>\n" +
+            "            <dri:dateOfCollection>2015-08-24</dri:dateOfCollection>\n" +
+            "            <counters>\n" +
+            "\t              <counter_participation value=\"8\"/>\n" +
+            "               <counter_contactPerson value=\"1\"/>\n" +
+            "\t           </counters>\n" +
+            "         </header>\n" +
+            "         <metadata>\n" +
+            "            <oaf:entity xsi:schemaLocation=\"http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/0.3/oaf-0.3.xsd\">\n" +
+            "\t\t             <oaf:project>\n" +
+            "\t\t\t               <code>314867</code>\n" +
+            "                  <acronym>ADAW</acronym>\n" +
+            "                  <title>Saponification pre-treatment and biosensors based control system for slaughterhouse waste anaerobic digestion improvement</title>\n" +
+            "                  <startdate>2013-03-01</startdate>\n" +
+            "                  <enddate>2015-02-28</enddate>\n" +
+            "                  <callidentifier>FP7-SME-2012</callidentifier>\n" +
+            "                  <ecsc39>false</ecsc39>\n" +
+            "                  <oamandatepublications>false</oamandatepublications>\n" +
+            "                  <contracttype classid=\"BSG\" classname=\"Research for the benefit of specific groups\"\n" +
+            "                                schemeid=\"ec:FP7contractTypes\"\n" +
+            "                                schemename=\"ec:FP7contractTypes\"/>\n" +
+            "                  <fundingtree>\n" +
+            "                     <funder>\n" +
+            "                        <id>ec__________::EC</id>\n" +
+            "                        <shortname>EC</shortname>\n" +
+            "                        <name>European Commission</name>\n" +
+            "                        <jurisdiction>EU</jurisdiction>\n" +
+            "                     </funder>\n" +
+            "                     <funding_level_2>\n" +
+            "                        <id>ec__________::EC::FP7::SP4::SME</id>\n" +
+            "                        <description>Research for the benefit of SMEs</description>\n" +
+            "                        <name>SME</name>\n" +
+            "                        <class>ec:program</class>\n" +
+            "                        <parent>\n" +
+            "                           <funding_level_1>\n" +
+            "                              <id>ec__________::EC::FP7::SP4</id>\n" +
+            "                              <description>SP4-Capacities</description>\n" +
+            "                              <name>SP4</name>\n" +
+            "                              <class>ec:specificprogram</class>\n" +
+            "                              <parent>\n" +
+            "                                 <funding_level_0>\n" +
+            "                                    <id>ec__________::EC::FP7</id>\n" +
+            "                                    <description>SEVENTH FRAMEWORK PROGRAMME</description>\n" +
+            "                                    <name>FP7</name>\n" +
+            "                                    <parent/>\n" +
+            "                                    <class>ec:frameworkprogram</class>\n" +
+            "                                 </funding_level_0>\n" +
+            "                              </parent>\n" +
+            "                           </funding_level_1>\n" +
+            "                        </parent>\n" +
+            "                     </funding_level_2>\n" +
+            "                  </fundingtree>\n" +
+            "                  <websiteurl/>\n" +
+            "                  <keywords/>\n" +
+            "                  <duration/>\n" +
+            "                  <ecarticle29_3/>\n" +
+            "                  <subjects classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" +
+            "                  <originalId>corda_______::314867</originalId>\n" +
+            "                  <collectedfrom name=\"CORDA - COmmon Research DAta Warehouse\"\n" +
+            "                                 id=\"openaire____::b30dac7baac631f3da7c2bb18dd9891f\"/>\n" +
+            "                  <pid classid=\"\" classname=\"\" schemeid=\"\" schemename=\"\"/>\n" +
+            "                  <datainfo>\n" +
+            "                     <inferred>false</inferred>\n" +
+            "                     <deletedbyinference>false</deletedbyinference>\n" +
+            "                     <trust>0.9</trust>\n" +
+            "                     <inferenceprovenance/>\n" +
+            "                     <provenanceaction classid=\"sysimport:crosswalk:entityregistry\"\n" +
+            "                                       classname=\"sysimport:crosswalk:entityregistry\"\n" +
+            "                                       schemeid=\"dnet:provenanceActions\"\n" +
+            "                                       schemename=\"dnet:provenanceActions\"/>\n" +
+            "                  </datainfo>\n" +
+            "\t\t                <rels>\n" +
+                                    "<rel inferred=\"true\" trust=\"0.9\" inferenceprovenance=\"\" provenanceaction=\"UNKNOWN\"><to class=\"hasContact\" scheme=\"dnet:project_person_relations\" type=\"person\">dedup_wf_001::2b56ecf626015b620e97915cb0686ca1</to><fax> </fax><email>email@gmail.com</email><phone> </phone><fullname>Contact, Name</fullname></rel>" +
+            "\t\t                </rels>\n" +
+            "\t\t                <children>\n" +
+            "\t\t  </children>\n" +
+            "\t\t             </oaf:project>\n" +
+            "\n" +
+            "            </oaf:entity>\n" +
+            "         </metadata>\n" +
+            "      </result>\n" +
+            "\t\t\t\t\t\t</results>\n" +
+            "\t  <browseResults>\n" +
+            "\t\t\t</browseResults>\n" +
+            "</response>";
+
+
+
+    @Test
+    public void oaf2ProjectTest() throws Exception {
+        Project project = OafParser.oaf2Project(projectOaf);
+
+        Assert.assertEquals("corda_______::073d0a668885f9e7292a5d9c323e4a20", project.getOpenaireId());
+        Assert.assertEquals("ADAW", project.getAcronym());
+        Assert.assertEquals("ec__________::EC", project.getFunderId());
+        Assert.assertEquals("EC", project.getFunderShortName());
+        Assert.assertEquals("European Commission", project.getFunderName());
+        Assert.assertEquals("Saponification pre-treatment and biosensors based control system for slaughterhouse waste anaerobic digestion improvement", project.getName());
+        Assert.assertEquals(1, project.getContactEmails().size());
+        Assert.assertEquals("email@gmail.com", project.getContactEmails().get(0));
+    }
+
+
+}
Index: modules/uoa-claims/claims-demo/pom.xml
===================================================================
--- modules/uoa-claims/claims-demo/pom.xml	(nonexistent)
+++ modules/uoa-claims/claims-demo/pom.xml	(revision 47503)
@@ -0,0 +1,81 @@
+<?xml version="1.0" ?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<parent>
+		<groupId>eu.dnetlib</groupId>
+		<artifactId>dnet-parent</artifactId>
+		<version>1.0.0</version>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>eu.dnetlib</groupId>
+	<artifactId>uoa-claims-demo</artifactId>
+	<packaging>jar</packaging>
+	<version>1.0.0-SNAPSHOT</version>
+	<dependencies>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+		</dependency>
+	<!--	<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>uoa-commons</artifactId>
+			<version>[1.0.0-SNAPSHOT,)</version>
+		</dependency> -->
+	        <dependency>
+	            <groupId>eu.dnetlib</groupId>
+	            <artifactId>uoa-utils</artifactId>
+	            <version>[1.1.0, 1.3.0-SNAPSHOT)</version>
+	        </dependency>
+        	<dependency>
+        	    <groupId>org.apache.ant</groupId>
+        	    <artifactId>ant</artifactId>
+        	    <version>1.8.2</version>
+        	</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-jdbc</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-tx</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+				<groupId>org.mockito</groupId>
+				<artifactId>mockito-core</artifactId>
+				<version>1.9.5</version>
+				<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>eu.dnetlib</groupId>
+			<artifactId>cnr-blackboard-common</artifactId>
+			<version>[1.0.0,2.0.0)</version>
+		</dependency>
+		<dependency>
+			<groupId>postgresql</groupId>
+			<artifactId>postgresql</artifactId>
+			<version>9.1-901.jdbc4</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>2.4</version>
+		</dependency>
+		<dependency>
+			<groupId>javax.mail</groupId>
+			<artifactId>mail</artifactId>
+			<version>1.4</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-test</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.googlecode.json-simple</groupId>
+			<artifactId>json-simple</artifactId>
+			<version>1.1</version>
+		</dependency>
+	</dependencies>
+</project>
Index: modules/uoa-claims/claims-demo
===================================================================
--- modules/uoa-claims/claims-demo	(nonexistent)
+++ modules/uoa-claims/claims-demo	(revision 47503)

Property changes on: modules/uoa-claims/claims-demo
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,5 ##
+*.iml
+.idea
+target
+validationFile.txt
+uoa-claims-demo.iml
