bundles/ca.uqam.tool.vivo-proxy/src_custom/main/java/ca/uqam/tool/vivoproxy/pattern/command/receiver/VivoReceiver.java
public CommandResult addOrganization(Organization organization) throws IOException {
		String uuid = UUID.randomUUID().toString();
		String orgType = organization.getOrganizationType();
		String updateQuery = SparqlHelper.SparqlPrefix 
				+ "INSERT { GRAPH <> { \n"
				+ "?orgIRI a foaf:Agent , foaf:Organization ,  obo:BFO_0000004 , obo:BFO_0000001 , obo:BFO_0000002 , owl:Thing, <"+ orgType +"> . \n"
				+ "?orgIRI  vitro:uuid  \""+ uuid +"\" . \n" ;
		List<LinguisticLabel> labels = organization.getNames();
		String queryCore = "";
		for (Iterator iterator = labels.iterator(); iterator.hasNext();) {
			LinguisticLabel aLabel = (LinguisticLabel) iterator.next();
			String subject = "?orgIRI ";
			String predicate = "<http://www.w3.org/2000/01/rdf-schema#label> ";
			String object = "\"" +aLabel.getLabel() +"\"@"+aLabel.getLanguage() + " . \n";
			queryCore+= subject;
			queryCore+= predicate;
			queryCore+= object;
		}		
		updateQuery += queryCore + "} } WHERE \n{ <http://localhost:8080/vivo/individual/n> sfnc:hasNewIRI ?orgIRI . 	} " ;
		String bodyValue = 
				"email="+LOGIN.getUserName()+
				"&password="+LOGIN.getPasswd()+ 
				"&update="+updateQuery;
		OkHttpClient client = new OkHttpClient();
		MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
		RequestBody body = RequestBody.create(mediaType, bodyValue);
		Request request = new Request.Builder()
				.url(getSiteUrl()+"/api/sparqlUpdate")
				.method("POST", body)
				.addHeader("Accept", SemanticWebMediaType.APPLICATION_RDF_XML.toString())
				.addHeader("Content-Type", "application/x-www-form-urlencoded")
				.build();
		Response response = client.newCall(request).execute();
		return DescribeByUUID(uuid.toString());


		/*
		 * Retreive information
		 */
//		String describeQuery = SparqlHelper.SparqlPrefix + " describe ?orgIRI \n"+
//				" where { \n"
//				+ queryCore
//				+ " }";
//		bodyValue = 
//				"email="+LOGIN.getUserName()+
//				"&password="+LOGIN.getPasswd()+ 
//				"&query="+describeQuery;
//
//		LOGGER.fine(describeQuery);
//		client = new OkHttpClient();
//		mediaType = MediaType.parse("application/x-www-form-urlencoded");
//		body = RequestBody.create(mediaType, bodyValue);
//		request = new Request.Builder()
//				.url(getSiteUrl()+"/api/sparqlQuery")
//				.method("POST", body)
//				.addHeader("Accept", SemanticWebMediaType.TEXT_PLAIN.toString())
//				.addHeader("Content-Type", "application/x-www-form-urlencoded")
//				.build();
//		response = client.newCall(request).execute();
//		return CommandResult.asCommandResult(response);
	}
/**
	 * @param organisationName
	 * @param vivoOrganisationType
	 * @return
	 * @throws IOException
	 */
@param organisationName
@param vivoOrganisationType
@return
@throws IOException
@param organisationName @param vivoOrganisationType @return @throws IOException
public CommandResult addOrganization(Organization organization) throws IOException {
		String uuid = UUID.randomUUID().toString();
		String orgType = organization.getOrganizationType();
		String updateQuery = SparqlHelper.SparqlPrefix 
				+ "INSERT { GRAPH <> { \n"
				+ "?orgIRI a foaf:Agent , foaf:Organization ,  obo:BFO_0000004 , obo:BFO_0000001 , obo:BFO_0000002 , owl:Thing, <"+ orgType +"> . \n"
				+ "?orgIRI  vitro:uuid  \""+ uuid +"\" . \n" ;
		List<LinguisticLabel> labels = organization.getNames();
		String queryCore = "";
		for (Iterator iterator = labels.iterator(); iterator.hasNext();) {
			LinguisticLabel aLabel = (LinguisticLabel) iterator.next();
			String subject = "?orgIRI ";
			String predicate = "<http:www.w3.org/2000/01/rdf-schema#label> ";
			String object = "\"" +aLabel.getLabel() +"\"@"+aLabel.getLanguage() + " . \n";
			queryCore+= subject;
			queryCore+= predicate;
			queryCore+= object;
		}		
		updateQuery += queryCore + "} } WHERE \n{ <http:localhost:8080/vivo/individual/n> sfnc:hasNewIRI ?orgIRI . 	} " ;
		String bodyValue = 
				"email="+LOGIN.getUserName()+
				"&password="+LOGIN.getPasswd()+ 
				"&update="+updateQuery;
		OkHttpClient client = new OkHttpClient();
		MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
		RequestBody body = RequestBody.create(mediaType, bodyValue);
		Request request = new Request.Builder()
				.url(getSiteUrl()+"/api/sparqlUpdate")
				.method("POST", body)
				.addHeader("Accept", SemanticWebMediaType.APPLICATION_RDF_XML.toString())
				.addHeader("Content-Type", "application/x-www-form-urlencoded")
				.build();
		Response response = client.newCall(request).execute();
		return DescribeByUUID(uuid.toString());
		/*
		 * Retreive information
		 */
		LOGGER.fine(describeQuery);
		client = new OkHttpClient();
		mediaType = MediaType.parse("application/x-www-form-urlencoded");
		body = RequestBody.create(mediaType, bodyValue);
		request = new Request.Builder()
				.url(getSiteUrl()+"/api/sparqlQuery")
				.method("POST", body)
				.addHeader("Accept", SemanticWebMediaType.TEXT_PLAIN.toString())
				.addHeader("Content-Type", "application/x-www-form-urlencoded")
				.build();
		response = client.newCall(request).execute();
		return CommandResult.asCommandResult(response);
	}
public CommandResult addOrganization ( Organization organization ) throws IOException { String uuid = UUID . randomUUID ( ) . toString ( ) ; String orgType = organization . getOrganizationType ( ) ; String updateQuery = SparqlHelper . SparqlPrefix + "INSERT { GRAPH <> { \n" + "?orgIRI a foaf:Agent , foaf:Organization ,  obo:BFO_0000004 , obo:BFO_0000001 , obo:BFO_0000002 , owl:Thing, <" + orgType + "> . \n" + "?orgIRI  vitro:uuid  \"" + uuid + "\" . \n" ; List < LinguisticLabel > labels = organization . getNames ( ) ; String queryCore = "" ; for ( Iterator iterator = labels . iterator ( ) ; iterator . hasNext ( ) ; ) { LinguisticLabel aLabel = ( LinguisticLabel ) iterator . next ( ) ; String subject = "?orgIRI " ; String predicate = "<http://www.w3.org/2000/01/rdf-schema#label> " ; String object = "\"" + aLabel . getLabel ( ) + "\"@" + aLabel . getLanguage ( ) + " . \n" ; queryCore += subject ; queryCore += predicate ; queryCore += object ; } updateQuery += queryCore + "} } WHERE \n{ <http://localhost:8080/vivo/individual/n> sfnc:hasNewIRI ?orgIRI . 	} " ; String bodyValue = "email=" + LOGIN . getUserName ( ) + "&password=" + LOGIN . getPasswd ( ) + "&update=" + updateQuery ; OkHttpClient client = new OkHttpClient ( ) ; MediaType mediaType = MediaType . parse ( "application/x-www-form-urlencoded" ) ; RequestBody body = RequestBody . create ( mediaType , bodyValue ) ; Request request = new Request . Builder ( ) . url ( getSiteUrl ( ) + "/api/sparqlUpdate" ) . method ( "POST" , body ) . addHeader ( "Accept" , SemanticWebMediaType . APPLICATION_RDF_XML . toString ( ) ) . addHeader ( "Content-Type" , "application/x-www-form-urlencoded" ) . build ( ) ; Response response = client . newCall ( request ) . execute ( ) ; return DescribeByUUID ( uuid . toString ( ) ) ; /*
		 * Retreive information
		 */ }
@param organisationName
 @param vivoOrganisationType
 @return
 @throws IOException
@param organisationName @param vivoOrganisationType @return @throws IOException
//		String describeQuery = SparqlHelper.SparqlPrefix + " describe ?orgIRI \n"+ //				" where { \n" //				+ queryCore //				+ " }"; //		bodyValue =  //				"email="+LOGIN.getUserName()+ //				"&password="+LOGIN.getPasswd()+  //				"&query="+describeQuery; // //		LOGGER.fine(describeQuery); //		client = new OkHttpClient(); //		mediaType = MediaType.parse("application/x-www-form-urlencoded"); //		body = RequestBody.create(mediaType, bodyValue); //		request = new Request.Builder() //				.url(getSiteUrl()+"/api/sparqlQuery") //				.method("POST", body) //				.addHeader("Accept", SemanticWebMediaType.TEXT_PLAIN.toString()) //				.addHeader("Content-Type", "application/x-www-form-urlencoded") //				.build(); //		response = client.newCall(request).execute(); //		return CommandResult.asCommandResult(response);