Index: modules/dnet-parthenos-publisher/trunk/test/main/java/eu/dnetlib/parthenos/catalogue/CatalogueRegistratorIntegrationTest.java
===================================================================
--- modules/dnet-parthenos-publisher/trunk/test/main/java/eu/dnetlib/parthenos/catalogue/CatalogueRegistratorIntegrationTest.java	(revision 51431)
+++ modules/dnet-parthenos-publisher/trunk/test/main/java/eu/dnetlib/parthenos/catalogue/CatalogueRegistratorIntegrationTest.java	(revision 51432)
@@ -7,7 +7,7 @@
 import eu.dnetlib.parthenos.CRM;
 import eu.dnetlib.parthenos.CRMdig;
 import eu.dnetlib.parthenos.CRMpe;
-import org.apache.commons.io.IOUtils;
+import eu.dnetlib.parthenos.publisher.ParthenosPublisherException;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.jena.ontology.OntModel;
 import org.apache.jena.ontology.OntModelSpec;
@@ -27,6 +27,9 @@
 import org.springframework.test.context.TestPropertySource;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Created by Alessia Bardi on 15/03/2018.
  *
@@ -41,6 +44,8 @@
 
 	private String nakalaService = "eu/dnetlib/parthenos/registry/nakala.rdf";
 	private String resourceCatName = "nakalatest";
+
+	private String rdfWithProviders = "eu/dnetlib/parthenos/registry/withProviders.rdf";
 	private boolean doPurge=false;
 
 	@Autowired
@@ -66,9 +71,8 @@
 
 	@Test
 	public void testRegistration() throws Exception{
-		String resource = getString(nakalaService);
 		InfModel model = loadBaseModel();
-		model.read(IOUtils.toInputStream(resource, "UTF-8"), CRMpe.NS);
+		model.read(getStream(nakalaService), CRMpe.NS);
 		ResIterator subjects = model.listSubjectsWithProperty(RDF.type, CRM.E7_Activity);
 		Resource nakala = subjects.nextResource();
 		String uuid = reg.register(nakala, CRM.E7_Activity);
@@ -82,16 +86,34 @@
 		doPurge = false;
 	}
 
+	@Test
+	public void testAddGroup() throws IOException, URISyntaxException, ParthenosPublisherException {
+		InfModel model = loadBaseModel();
+		model.read(getStream(rdfWithProviders), CRMpe.NS);
+		ResIterator it = model.listSubjectsWithProperty(CRMpe.PP2_provided_by);
+		while(it.hasNext()){
+			Resource withProvider = it.nextResource();
+			reg.ensureGroups(withProvider);
+		}
+		doPurge = false;
 
-	private String getString(final String classpath) {
-		try {
-			final ClassPathResource resource = new ClassPathResource(classpath);
-			return IOUtils.toString(resource.getInputStream(), "UTF-8");
-		}catch(IOException e){
-			return null;
-		}
 	}
 
+	@Test
+	public void testGroup() throws ParthenosPublisherException, IOException, URISyntaxException {
+		assertFalse(reg.getCatalogueAPIClient().groupExist("sismeltest"));
+		String sismelJson = "{"
+				+ "  \"name\":\"sismeltest\","
+				+ "  \"id\":\"sismeltest\","
+				+ "  \"title\": \"SISMEL TEST GROUP TITLE\""
+				//+ "  \"description\": \"%s\""
+				+ "}";
+		reg.getCatalogueAPIClient().registerGroup(sismelJson, "sismeltest");
+		assertTrue(reg.getCatalogueAPIClient().groupExist("sismeltest"));
+		reg.getCatalogueAPIClient().purgeGroup("sismeltest");
+		assertFalse(reg.getCatalogueAPIClient().groupExist("sismeltest"));
+	}
+
 	private static InputStream getStream(final String classpath) throws IOException {
 		return new ClassPathResource(classpath).getInputStream();
 	}
Index: modules/dnet-parthenos-publisher/trunk/test/main/resources/eu/dnetlib/parthenos/registry/withProviders.rdf
===================================================================
--- modules/dnet-parthenos-publisher/trunk/test/main/resources/eu/dnetlib/parthenos/registry/withProviders.rdf	(nonexistent)
+++ modules/dnet-parthenos-publisher/trunk/test/main/resources/eu/dnetlib/parthenos/registry/withProviders.rdf	(revision 51432)
@@ -0,0 +1,30 @@
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+         xmlns:crmpe="http://parthenos.d4science.org/CRMext/CRMpe.rdfs/"
+         xmlns:crm="http://www.cidoc-crm.org/cidoc-crm/">
+	<rdf:Description rdf:about="http://parthenos.d4science.org/handle/Parthenos/REG/Service/Cendari%20Sparql%20Endpoint">
+		<crm:P16_used_specific_object rdf:resource="urn:uuid:290a645e-343c-4850-8b81-80f4705f691a"/>
+		<crmpe:PP28_has_designated_access_point rdf:resource="http://git-trame.fefonlus.it/sparql/"/>
+		<crmpe:PP2_provided_by rdf:resource="http://parthenos.d4science.org/handle/Parthenos/REG/Actor/SISMEL"/>
+		<crmpe:PP45_has_competency rdf:resource="http://parthenos.d4science.org/handle/Parthenos/REG/Concept/righttype/Cultural%20Heritage%20Dataset"/>
+		<crm:P3_has_note>Cendari provides access to data through a SPARQL access point. The dataset is composed by 16 different resources, all related to medieval and romance philology and history. It contains data about 115000+ manuscripts, 95000+ texts and 18000+ authors.</crm:P3_has_note>
+		<crm:P1_is_identified_by rdf:resource="http://parthenos.d4science.org/handle/Parthenos/REG/Service/Appellation/Cendari%20Sparql%20Endpoint"/>
+		<rdf:type rdf:resource="http://parthenos.d4science.org/CRMext/CRMpe.rdfs/PE15_Data_E-Service"/>
+		<rdfs:label>Cendari Sparql Endpoint</rdfs:label>
+		<rdf:type rdf:resource="http://parthenos.d4science.org/CRMext/CRMpe.rdfs/PE1_Service"/>
+		<crmpe:PP2_provided_by rdf:resource="http://parthenos.d4science.org/handle/Parthenos/REG/Actor/EHRI%20Consortium"/>
+	</rdf:Description>
+	<rdf:Description rdf:about="http://parthenos.d4science.org/handle/Parthenos/REG/Actor/SISMEL">
+		<crm:P107_has_current_or_former_member rdf:resource="http://parthenos.d4science.org/handle/Parthenos/REG/Actor/Emiliano%20Degl%27Innocenti"/>
+		<crm:P76_has_contact_point rdf:resource="http://parthenos.d4science.org/handle/Parthenos/REG/Thing/Appellation/S.I.S.M.E.L.%2C%20via%20Montebello%207%2C%2050123%20Firenze"/>
+		<rdf:type rdf:resource="http://www.cidoc-crm.org/cidoc-crm/E39_Actor"/>
+		<crm:P1_is_identified_by>SISMEL</crm:P1_is_identified_by>
+		<crm:P3_has_note>S.I.S.M.E.L. is a leader in national and international research projects in the field of medieval culture and one of the most advanced research centers in Italy for the creation of innovative applications in digital humanities, including: bibliographic and onomastic databases, catalogues of authors, texts and manuscripts, tools for research data discoverability, interoperability and semantic integration and enrichment.</crm:P3_has_note>
+		<rdfs:label>SISMEL</rdfs:label>
+		<crm:P76_has_contact_point rdf:resource="http://parthenos.d4science.org/handle/Parthenos/REG/Thing/Appellation/055%20204%208501"/>
+		<crm:P76_has_contact_point rdf:resource="http://parthenos.d4science.org/handle/Parthenos/REG/Thing/Appellation/maurizio.sanesi%40virgilio.it"/>
+		<rdf:type rdf:resource="http://parthenos.d4science.org/CRMext/CRMpe.rdfs/PE34_Team"/>
+		<rdf:type rdf:resource="http://www.cidoc-crm.org/cidoc-crm/E40_Legal_Body"/>
+		<crm:P76_has_contact_point rdf:resource="http://www.sismelfirenze.it/index.php?lang=en"/>
+	</rdf:Description>
+</rdf:RDF>
\ No newline at end of file
Index: modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/catalogue/CatalogueRegistrator.java
===================================================================
--- modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/catalogue/CatalogueRegistrator.java	(revision 51431)
+++ modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/catalogue/CatalogueRegistrator.java	(revision 51432)
@@ -86,7 +86,7 @@
 	}
 
 	protected boolean purge(final String resCatName) throws URISyntaxException, IOException {
-		return catalogueAPIClient.purge(resCatName);
+		return catalogueAPIClient.purgeItem(resCatName);
 	}
 
 	/**
@@ -278,4 +278,12 @@
 	public void setResourceReader(final ResourceReader resourceReader) {
 		this.resourceReader = resourceReader;
 	}
+
+	public CatalogueAPIClient getCatalogueAPIClient() {
+		return catalogueAPIClient;
+	}
+
+	public void setCatalogueAPIClient(final CatalogueAPIClient catalogueAPIClient) {
+		this.catalogueAPIClient = catalogueAPIClient;
+	}
 }
Index: modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/catalogue/CatalogueAPIClient.java
===================================================================
--- modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/catalogue/CatalogueAPIClient.java	(revision 51431)
+++ modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/catalogue/CatalogueAPIClient.java	(revision 51432)
@@ -35,6 +35,7 @@
 	private final String purgeItemPath = "rest/api/items/purge";
 	private final String showGroupPath = "rest/api/groups/show"; //param id
 	private final String createGroupPath = "rest/api/groups/create";
+	private final String purgeGroupPath = "rest/api/groups/purge";
 	private String purgeBodyTemplate = "{\"id\":\"%s\"}";
 
 	@Autowired
@@ -122,12 +123,23 @@
 	}
 
 
-	protected boolean purge(final String resCatName) throws URISyntaxException, IOException {
-		log.debug(String.format("Catalogue --> Purge %s", resCatName));
-		String body = String.format(purgeBodyTemplate, resCatName);
+
+	protected boolean purgeGroup(final String groupname) throws IOException, URISyntaxException {
+		log.debug(String.format("Catalogue --> Purge Group %s", groupname));
+		return purge(purgeGroupPath, groupname);
+	}
+
+	protected boolean purgeItem(final String resCatName) throws URISyntaxException, IOException {
+		log.debug(String.format("Catalogue --> Purge Item %s", resCatName));
+		return purge(purgeItemPath, resCatName);
+	}
+
+
+	private boolean purge(String purgePath, String id) throws URISyntaxException, IOException {
+		String body = String.format(purgeBodyTemplate, id);
 		log.warn("DEL BODY: "+body);
 		HttpEntity<String> entity = new HttpEntity<String>(body, getHeaders());
-		URI uri = new URIBuilder(getBaseURL()+purgeItemPath).addParameter("gcube-token", getApplicationToken()).build();
+		URI uri = new URIBuilder(getBaseURL()+purgePath).addParameter("gcube-token", getApplicationToken()).build();
 		ResponseEntity<String> res = jrrRestTemplate.exchange(uri, HttpMethod.DELETE, entity, String.class);
 		CatalogueAPIResponse response = new CatalogueAPIResponse();
 		if(res.getStatusCode() == HttpStatus.OK){
