import java.net.URI;

import org.nnsoft.sameas4j.*;
public class cap6example3 {

	public static void main (String[] args) throws Exception {

		String buscar="boadilla_del_monte";  // los espacios tienen que transformarse por subrayando

		String buscarMinus=buscar.toLowerCase();
		String buscarMayus=buscar.toUpperCase();
		String buscarDbpedia="http://dbpedia.org/resource/"+buscarMayus.substring(0, 1)+buscarMinus.substring(1, buscarMinus.length());

		System.out.println( "URI referencia: "+buscarDbpedia );




		SameAsService sameAsService = DefaultSameAsServiceFactory.createNew();
		Equivalence equivalence2 = sameAsService.getDuplicates( new URI(buscarDbpedia) );

		System.out.println( "Number of equivalent URIs: " + equivalence2.getAmount() );

		if (equivalence2.getAmount()==1){
		    System.out.println("No se han encontrado equivalencias");

		}else{
		  for ( URI uri : equivalence2 )
		  {
		    System.out.println("Equivalent URI: " + uri );
		  }
		}

  } // fin main

}

