// Path: openqa.engine/src/main/java/org/aksw/openqa/component/object/IParams.java
// public interface IParams extends IObject {
// 	public IComponent getSource();
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/object/IResult.java
// public interface IResult extends IParams {
// 	public IParams getInputParam();
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/InterpreterProvider.java
// public class InterpreterProvider extends PluginProcessProvider<Interpreter, IInterpreterFactory> {
//     public InterpreterProvider(List<? extends ClassLoader> classLoaders, ServiceProvider serviceProvider) {
// 		super(IInterpreterFactory.class, classLoaders, serviceProvider);
// 	}
//     
//     public InterpreterProvider() {    	
//     }
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/ServiceProvider.java
// public class ServiceProvider extends AbstractPluginProvider<IService, IServiceFactory> {
// 	public ServiceProvider(List<? extends ClassLoader> classLoaders) {
// 		super(IServiceFactory.class, classLoaders, null);
// 	}
// 	
// 	public ServiceProvider() {
// 	}
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/SynthesizerProvider.java
// public class SynthesizerProvider extends PluginProcessProvider<ISynthesizer, ISynthesizerFactory> {
// 	public SynthesizerProvider(List<? extends ClassLoader> classLoaders, ServiceProvider serviceProvider) {
// 		super(ISynthesizerFactory.class, classLoaders, serviceProvider);
// 	}
// 	
// 	public SynthesizerProvider() {		
// 	}
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/ui/render/InfoGraphRender.java
// public interface InfoGraphRender extends IRender, IPlugin {
// 	public boolean canRender(IContext context, InfoNode node) throws Exception;
// }


import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.servlet.ServletOutputStream;
import org.aksw.openqa.component.IPlugin;
import org.aksw.openqa.component.IProvider;
import org.aksw.openqa.component.context.IContext;
import org.aksw.openqa.component.object.IParams;
import org.aksw.openqa.component.object.IResult;
import org.aksw.openqa.component.object.Params;
import org.aksw.openqa.component.providers.impl.InterpreterProvider;
import org.aksw.openqa.component.providers.impl.RenderProvider;
import org.aksw.openqa.component.providers.impl.ResolverProvider;
import org.aksw.openqa.component.providers.impl.RetrieverProvider;
import org.aksw.openqa.component.providers.impl.ServiceProvider;
import org.aksw.openqa.component.providers.impl.SynthesizerProvider;
import org.aksw.openqa.component.ui.render.InfoGraphRender;
import org.aksw.openqa.component.ui.render.InfoNode;
import org.apache.log4j.Logger;
			// Synthesizing
			SynthesizerProvider synthesizerProvider = (SynthesizerProvider) providers.get(SynthesizerProvider.class);
			List<? extends IParams> syntheses = synthesizerProvider.process(consultResults, serviceProvider, context);
			logger.debug("Number of syntheses: " + syntheses.size());
			
			logger.debug("Resolving");
			// Resolving
			ResolverProvider resolverProvider = (ResolverProvider) providers.get(ResolverProvider.class);
			List<? extends IResult> resolved = resolverProvider.process(syntheses, serviceProvider, context);
			logger.debug("Number of resolved results: " + resolved.size());
			
			if(resolved.size() == 0) {
				// increasing number of queries without result
				int numberOfQueriesWithoutResult = Status.getQueriesWithourResult() + 1;
				Status.setQueriesWithourResult(numberOfQueriesWithoutResult);
			}
			logger.debug("Rendering result");
			for(IResult result : resolved) {
				InfoNode childNode = new InfoNode();
				childNode.setResult(result);
				node.addInfo(childNode);
			}
		} catch (Exception e) {
			int numberOfErrors = Status.getNumberOfErrors() + 1;
			Status.setNumberOfErrors(numberOfErrors);
			logger.error("An error occurred during the input process.", e);
		}
		
		// getting the main render
		RenderProvider renderProvider = (RenderProvider) providers.get(RenderProvider.class);
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/object/IParams.java
// public interface IParams extends IObject {
// 	public IComponent getSource();
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/object/IResult.java
// public interface IResult extends IParams {
// 	public IParams getInputParam();
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/InterpreterProvider.java
// public class InterpreterProvider extends PluginProcessProvider<Interpreter, IInterpreterFactory> {
//     public InterpreterProvider(List<? extends ClassLoader> classLoaders, ServiceProvider serviceProvider) {
// 		super(IInterpreterFactory.class, classLoaders, serviceProvider);
// 	}
//     
//     public InterpreterProvider() {    	
//     }
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/ServiceProvider.java
// public class ServiceProvider extends AbstractPluginProvider<IService, IServiceFactory> {
// 	public ServiceProvider(List<? extends ClassLoader> classLoaders) {
// 		super(IServiceFactory.class, classLoaders, null);
// 	}
// 	
// 	public ServiceProvider() {
// 	}
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/SynthesizerProvider.java
// public class SynthesizerProvider extends PluginProcessProvider<ISynthesizer, ISynthesizerFactory> {
// 	public SynthesizerProvider(List<? extends ClassLoader> classLoaders, ServiceProvider serviceProvider) {
// 		super(ISynthesizerFactory.class, classLoaders, serviceProvider);
// 	}
// 	
// 	public SynthesizerProvider() {		
// 	}
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/ui/render/InfoGraphRender.java
// public interface InfoGraphRender extends IRender, IPlugin {
// 	public boolean canRender(IContext context, InfoNode node) throws Exception;
// }


// Path: openqa.webserver/src/main/java/org/aksw/openqa/OpenQA.java
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.servlet.ServletOutputStream;
import org.aksw.openqa.component.IPlugin;
import org.aksw.openqa.component.IProvider;
import org.aksw.openqa.component.context.IContext;
import org.aksw.openqa.component.object.IParams;
import org.aksw.openqa.component.object.IResult;
import org.aksw.openqa.component.object.Params;
import org.aksw.openqa.component.providers.impl.InterpreterProvider;
import org.aksw.openqa.component.providers.impl.RenderProvider;
import org.aksw.openqa.component.providers.impl.ResolverProvider;
import org.aksw.openqa.component.providers.impl.RetrieverProvider;
import org.aksw.openqa.component.providers.impl.ServiceProvider;
import org.aksw.openqa.component.providers.impl.SynthesizerProvider;
import org.aksw.openqa.component.ui.render.InfoGraphRender;
import org.aksw.openqa.component.ui.render.InfoNode;
import org.apache.log4j.Logger;

			// Synthesizing
			SynthesizerProvider synthesizerProvider = (SynthesizerProvider) providers.get(SynthesizerProvider.class);
			List<? extends IParams> syntheses = synthesizerProvider.process(consultResults, serviceProvider, context);
			logger.debug("Number of syntheses: " + syntheses.size());
			
			logger.debug("Resolving");
			// Resolving
			ResolverProvider resolverProvider = (ResolverProvider) providers.get(ResolverProvider.class);
			List<? extends IResult> resolved = resolverProvider.process(syntheses, serviceProvider, context);
			logger.debug("Number of resolved results: " + resolved.size());
			
			if(resolved.size() == 0) {
				// increasing number of queries without result
				int numberOfQueriesWithoutResult = Status.getQueriesWithourResult() + 1;
				Status.setQueriesWithourResult(numberOfQueriesWithoutResult);
			}
			logger.debug("Rendering result");
			for(IResult result : resolved) {
				InfoNode childNode = new InfoNode();
				childNode.setResult(result);
				node.addInfo(childNode);
			}
		} catch (Exception e) {
			int numberOfErrors = Status.getNumberOfErrors() + 1;
			Status.setNumberOfErrors(numberOfErrors);
			logger.error("An error occurred during the input process.", e);
		}
		
		// getting the main render
		RenderProvider renderProvider = (RenderProvider) providers.get(RenderProvider.class);
		InfoGraphRender mainRender = renderProvider.getRootRender();