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 53096)
+++ modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/utils/GridUtils.java	(revision 53097)
@@ -86,7 +86,7 @@
 
 		return orgNames.entrySet()
 				.stream()
-				.map(e -> toProto(e.getKey(),
+				.map(e -> toProtos(e.getKey(),
 						gridId,
 						e.getValue(),
 						shortName,
@@ -94,11 +94,12 @@
 						country,
 						e.getKey().equals(mainOpenaireId) ? org.getAcronyms() : new ArrayList<>(),
 						orgNames, collectedFrom))
+				.flatMap(l -> l.stream())
 				.collect(Collectors.toList());
 
 	}
 
-	private static Oaf toProto(final String openaireId,
+	private static List<Oaf> toProtos(final String openaireId,
 			final String gridId,
 			final String name,
 			final String shortName,
@@ -127,20 +128,22 @@
 								.addAllAlternativeNames(acronyms.stream().map(a -> StringField.newBuilder().setValue(a).build()).collect(Collectors.toList()))
 								.setCountry(country)));
 
-		orgRels.entrySet().stream()
+		final List<Oaf> oafs = orgRels.entrySet().stream()
 				.filter(e -> !e.getKey().equals(openaireId))
-				.forEach(e -> entity.addCachedRel(
-						OafRel.newBuilder()
+				.map(e -> Oaf.newBuilder()
+						.setKind(Kind.relation)
+						.setLastupdatetimestamp(DateUtils.now())
+						.setRel(OafRel.newBuilder()
 								.setSource(openaireId)
 								.setTarget(e.getKey())
 								.setRelType(RelType.organizationOrganization)
-								.setSubRelType(SubRelType.similarity)
-								.setRelClass("") // TODO ???
-								.setChild(false)
-								// TODO ??? e.getValue()
-								.addCollectedfrom(collectedFrom)));
+								.setSubRelType(SubRelType.dedupSimilarity)
+								.setRelClass("isSimilarTo")
+								.setChild(false))
+						.build())
+				.collect(Collectors.toList());
 
-		return Oaf.newBuilder()
+		oafs.add(Oaf.newBuilder()
 				.setKind(Kind.entity)
 				.setLastupdatetimestamp(DateUtils.now())
 				.setEntity(entity)
@@ -152,7 +155,9 @@
 								.setClassname("UNKNOWN")
 								.setSchemeid("dnet:provenanceActions")
 								.setSchemename("dnet:provenanceActions")))
-				.build();
+				.build());
+
+		return oafs;
 	}
 
 	private static String calculateOpenaireId(final String prefix, final String gridId, final String name) {
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	(revision 53096)
+++ modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/GridOrganizationsApplication.java	(revision 53097)
@@ -9,6 +9,8 @@
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
+import com.googlecode.protobuf.format.JsonFormat;
+
 import eu.dnetlib.grid.process.model.GridOrganization;
 import eu.dnetlib.grid.process.utils.Datasource;
 import eu.dnetlib.grid.process.utils.GridCleaner;
@@ -42,6 +44,8 @@
 				.filter(o -> o.getStatus().equals("active"))
 				.collect(Collectors.toMap(GridOrganization::getId, GridUtils::findShortName));
 
+		final JsonFormat jsonFormat = new JsonFormat();
+
 		GridUtils.streamOrganizations(jsonFile)
 				.filter(Objects::nonNull)
 				.filter(o -> o.getStatus().equals("active"))
@@ -48,7 +52,8 @@
 				.map(cleaner)
 				.map(org -> GridUtils.toProtos(org, parents, gridDs))
 				.flatMap(List::stream)
-				.map(s -> s.getEntity().getId()) // TODO OAF -> JSON
+				.map(jsonFormat::printToString)
+				// .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 53096)
+++ modules/dnet-grid-application/trunk/pom.xml	(revision 53097)
@@ -79,6 +79,11 @@
 			<groupId>com.fasterxml.jackson.core</groupId>
 			<artifactId>jackson-databind</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>com.googlecode.protobuf-java-format</groupId>
+			<artifactId>protobuf-java-format</artifactId>
+			<version>1.4</version>
+		</dependency>
 	</dependencies>
 
 	<build>
