Index: modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/GridOrganizationsProcess.java
===================================================================
--- modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/GridOrganizationsProcess.java	(revision 53068)
+++ modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/GridOrganizationsProcess.java	(nonexistent)
@@ -1,40 +0,0 @@
-package eu.dnetlib.grid.process;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-import eu.dnetlib.grid.process.model.GridOrganization;
-import eu.dnetlib.grid.process.utils.Datasource;
-import eu.dnetlib.grid.process.utils.GridCleaner;
-import eu.dnetlib.grid.process.utils.GridUtils;
-
-public class GridOrganizationsProcess {
-
-	private static final Datasource gridDs = new Datasource("openaire____::grid", "GRID - Global Research Identifier Database", "grid________");
-
-	public static void main(final String[] args) {
-
-	}
-
-	protected static void processFile(final String jsonFile) throws Exception {
-		final GridCleaner cleaner = new GridCleaner();
-
-		final Map<String, String> parents = GridUtils.streamOrganizations(jsonFile)
-				.filter(Objects::nonNull)
-				.filter(o -> o.getStatus().equals("active"))
-				.collect(Collectors.toMap(GridOrganization::getId, GridUtils::findShortName));
-
-		GridUtils.streamOrganizations(jsonFile)
-				.filter(Objects::nonNull)
-				.filter(o -> o.getStatus().equals("active"))
-				.map(cleaner)
-				.map(org -> GridUtils.toProtos(org, parents, gridDs))
-				.flatMap(List::stream)
-				.map(s -> s) // TODO OAF -> JSON
-				.forEach(System.out::println);
-
-	}
-
-}
Index: modules/dnet-grid-application/trunk/src/test/java/eu/dnetlib/grid/process/utils/GridUtilsTest.java
===================================================================
--- modules/dnet-grid-application/trunk/src/test/java/eu/dnetlib/grid/process/utils/GridUtilsTest.java	(revision 53068)
+++ modules/dnet-grid-application/trunk/src/test/java/eu/dnetlib/grid/process/utils/GridUtilsTest.java	(revision 53069)
@@ -8,10 +8,12 @@
 import java.util.stream.Collectors;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import eu.dnetlib.grid.process.model.GridOrganization;
 
+@Ignore
 public class GridUtilsTest {
 
 	@Before
Index: modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/utils/GridUtils.java
===================================================================
--- modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/utils/GridUtils.java	(revision 53068)
+++ modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/utils/GridUtils.java	(revision 53069)
@@ -23,11 +23,13 @@
 import eu.dnetlib.data.proto.KindProtos.Kind;
 import eu.dnetlib.data.proto.OafProtos.Oaf;
 import eu.dnetlib.data.proto.OafProtos.OafEntity;
+import eu.dnetlib.data.proto.OafProtos.OafRel;
 import eu.dnetlib.data.proto.OrganizationProtos.Organization;
 import eu.dnetlib.data.proto.TypeProtos.Type;
-import eu.dnetlib.miscutils.datetime.DateUtils;
 import eu.dnetlib.grid.process.model.GridOrganization;
 import eu.dnetlib.grid.process.model.GridResponse;
+import eu.dnetlib.miscutils.datetime.DateUtils;
+import eu.dnetlib.miscutils.functional.hash.Hashing;
 
 public class GridUtils {
 
@@ -53,9 +55,13 @@
 
 		final String gridId = org.getId();
 		final String shortName = findShortName(org);
+		final String parent = parents.get(gridId);
+		final String mainName = calculateName(parent, org.getName());
+		final Set<String> otherNames = calculateNames(parent, org.getAcronyms());
 
-		final String mainName = calculateName(parents.get(gridId), org.getName());
-		final Set<String> names = calculateNames(parents.get(gridId), org.getAcronyms());
+		final Map<String, String> orgRels = otherNames.stream()
+				.collect(Collectors.toMap(s -> calculateOpenaireId(ds.getPrefix(), gridId, s), s -> s));
+		orgRels.put(calculateOpenaireId(ds.getPrefix(), gridId, mainName), mainName);
 
 		final Qualifier.Builder country = org.getAddresses().stream()
 				.map(addr -> Qualifier.newBuilder()
@@ -68,13 +74,14 @@
 				.findFirst()
 				.orElse(null);
 
-		final String url = org.getLinks().stream().findFirst().orElse(null);
+		final String url = org.getLinks().stream().findFirst().orElse("");
 
 		final List<Oaf> res = new ArrayList<>();
 
-		res.add(toProto(gridId, mainName, shortName, url, country, org.getAcronyms(), ds));
-		res.addAll(names.stream()
-				.map(name -> toProto(gridId, name, shortName, url, country, new ArrayList<>(), ds))
+		res.add(toProto(gridId, mainName, shortName, url, country, org.getAcronyms(), orgRels, ds));
+
+		res.addAll(otherNames.stream()
+				.map(name -> toProto(gridId, name, shortName, url, country, new ArrayList<>(), orgRels, ds))
 				.collect(Collectors.toList()));
 
 		return res;
@@ -86,32 +93,50 @@
 			final String url,
 			final Qualifier.Builder country,
 			final List<String> acronyms,
+			final Map<String, String> orgRels,
 			final Datasource ds) {
 
+		// TODO ADD ALTERNATIVE NAMES AND RELS
+
+		final String openaireId = calculateOpenaireId(ds.getPrefix(), gridId, name);
+
+		final KeyValue collectedFrom = KeyValue.newBuilder()
+				.setKey(ds.getId())
+				.setValue(ds.getName()).build();
+
+		final OafEntity.Builder entity = OafEntity.newBuilder()
+				.setId(openaireId)
+				.addPid(StructuredProperty.newBuilder()
+						.setValue(gridId)
+						.setQualifier(Qualifier.newBuilder()
+								.setClassid("grid")
+								.setClassname("grid")
+								.setSchemeid("dnet:pid_types")
+								.setSchemename("dnet:pid_types")))
+				.addCollectedfrom(collectedFrom)
+				.setType(Type.organization)
+				.setOrganization(Organization.newBuilder()
+						.setMetadata(Organization.Metadata.newBuilder()
+								.setLegalname(StringField.newBuilder().setValue(name))
+								.setLegalshortname(StringField.newBuilder().setValue(shortName))
+								.setWebsiteurl(StringField.newBuilder().setValue(url))
+								.addAllAlternativeNames(acronyms.stream().map(a -> StringField.newBuilder().setValue(a).build()).collect(Collectors.toList()))
+								.setCountry(country)));
+
+		orgRels.entrySet().stream()
+				.filter(e -> !e.getKey().equals(openaireId))
+				.forEach(e -> entity.addCachedRel(
+						OafRel.newBuilder()
+								.setTarget(e.getKey())
+								// TODO ??? e.getValue()
+								.addCollectedfrom(collectedFrom)));
+
 		return Oaf.newBuilder()
 				.setKind(Kind.entity)
 				.setLastupdatetimestamp(DateUtils.now())
-				.setEntity(OafEntity.newBuilder()
-						.addPid(StructuredProperty.newBuilder()
-								.setValue(gridId)
-								.setQualifier(Qualifier.newBuilder()
-										.setClassid("grid")
-										.setClassname("grid")
-										.setSchemeid("dnet:pid_types")
-										.setSchemename("dnet:pid_types")))
-						.addCollectedfrom(KeyValue.newBuilder()
-								.setKey(ds.getId())
-								.setValue(ds.getName()))
-						.setType(Type.organization)
-						.setOrganization(Organization.newBuilder()
-								.setMetadata(Organization.Metadata.newBuilder()
-										.setLegalname(StringField.newBuilder().setValue(name))
-										.setLegalshortname(StringField.newBuilder().setValue(shortName))
-
-										.setWebsiteurl(StringField.newBuilder().setValue(url))
-										.setCountry(country))))
+				.setEntity(entity)
 				.setDataInfo(DataInfo.newBuilder()
-						.setTrust("0.99")
+						.setTrust("0.90")
 						.setInferred(false)
 						.setProvenanceaction(Qualifier.newBuilder()
 								.setClassid("UNKNOWN")
@@ -121,6 +146,10 @@
 				.build();
 	}
 
+	private static String calculateOpenaireId(final String prefix, final String gridId, final String name) {
+		return String.format("20|%s::%s", prefix, Hashing.md5(gridId + " " + name));
+	}
+
 	private static String calculateName(final String parent, final String simpleName) {
 		return StringUtils.isBlank(parent) ? simpleName : parent + " - " + simpleName;
 	}
Index: modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/GridOrganizationsApplication.java
===================================================================
--- modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/GridOrganizationsApplication.java	(nonexistent)
+++ modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/GridOrganizationsApplication.java	(revision 53069)
@@ -0,0 +1,56 @@
+package eu.dnetlib.grid.process;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+import eu.dnetlib.grid.process.model.GridOrganization;
+import eu.dnetlib.grid.process.utils.Datasource;
+import eu.dnetlib.grid.process.utils.GridCleaner;
+import eu.dnetlib.grid.process.utils.GridUtils;
+
+@SpringBootApplication
+public class GridOrganizationsApplication implements CommandLineRunner {
+
+	private static final Datasource gridDs = new Datasource("openaire____::grid", "GRID - Global Research Identifier Database", "grid________");
+
+	public static void main(final String[] args) {
+		SpringApplication.run(GridOrganizationsApplication.class, args);
+	}
+
+	@Override
+	public void run(final String... args) throws Exception {
+		if (args.length == 1) {
+			processFile(args[0]);
+		} else {
+			System.err.println();
+			System.err.println("Usage: java -jar <JARFILE> <GridJsonFile>");
+			System.err.println();
+		}
+	}
+
+	protected void processFile(final String jsonFile) throws Exception {
+		final GridCleaner cleaner = new GridCleaner();
+
+		final Map<String, String> parents = GridUtils.streamOrganizations(jsonFile)
+				.filter(Objects::nonNull)
+				.filter(o -> o.getStatus().equals("active"))
+				.collect(Collectors.toMap(GridOrganization::getId, GridUtils::findShortName));
+
+		GridUtils.streamOrganizations(jsonFile)
+				.filter(Objects::nonNull)
+				.filter(o -> o.getStatus().equals("active"))
+				.map(cleaner)
+				.map(org -> GridUtils.toProtos(org, parents, gridDs))
+				.flatMap(List::stream)
+				.map(s -> s.getEntity().getId()) // TODO OAF -> JSON
+				.forEach(System.out::println);
+
+	}
+
+}
Index: modules/dnet-grid-application/trunk/pom.xml
===================================================================
--- modules/dnet-grid-application/trunk/pom.xml	(revision 53068)
+++ modules/dnet-grid-application/trunk/pom.xml	(revision 53069)
@@ -26,7 +26,7 @@
 	<parent>
 		<groupId>org.springframework.boot</groupId>
 		<artifactId>spring-boot-starter-parent</artifactId>
-		<version>2.0.0.RELEASE</version>
+		<version>2.0.3.RELEASE</version>
 	</parent>
 
 	<repositories>
@@ -56,27 +56,19 @@
 		</repository>
 	</repositories>
 
-	<profiles>
-		<profile>
-			<id>java8-doclint-disabled</id>
-			<activation>
-				<jdk>[1.8,)</jdk>
-			</activation>
-			<properties>
-				<javadoc.opts>-Xdoclint:none</javadoc.opts>
-			</properties>
-		</profile>
-	</profiles>
 
 
 
 	<!-- Add typical dependencies for a web application -->
 	<dependencies>
-
 		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter</artifactId>
+		</dependency>
+		<dependency>
 			<groupId>eu.dnetlib</groupId>
 			<artifactId>dnet-openaire-data-protos</artifactId>
-			<version>3.9.2</version>
+			<version>3.9.4-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>eu.dnetlib</groupId>
