// Path: src/de/uni_koblenz/west/splendid/index/Graph.java
// public class Graph {
// 	
// 	String name;
// 	
// 	public Graph(String name) {
// 		this.name = name;
// 	}
// 	
// 	@Override
// 	public boolean equals(Object object) {
// 		if (object instanceof Graph)
// 			return this.name.equals(((Graph) object).name);
// 		return false;
// 	}
// 	
// 	@Override
// 	public int hashCode() {
// 		return this.name.hashCode();
// 	}
// 	
// 	public String toString() {
// 		return this.name;
// 	}
// 	
// 	public String getNamespaceURL() {
// 		// TODO: implement proper hamespace handling
// 		return this.name.replaceFirst("http://lodse.west.uni-koblenz.de:8080/openrdf-sesame/repositories/", "west:");
// 	}
// 
// }
// 
// Path: src/de/uni_koblenz/west/splendid/vocabulary/VOID2.java
// public enum VOID2 {
// 	
// 	// concepts
// 	Dataset,
// 	Linkset,
// 	EquiWidthHist,
// 	EuqiDepthHist,
// 	
// 	// predicates
// 	vocabulary,
// 	sparqlEndpoint,
// 	distinctSubjects,
// 	distinctObjects,
// 	triples,
// 	classes,
// 	entities,
// 	properties,
// 	classPartition,
// 	clazz("class"),
// 	propertyPartition,
// 	property,
// 	target,
// 	linkPredicate,
// 	
// 	histogram,
// 	minValue,
// 	maxValue,
// 	bucketLoad,
// 	buckets,
// 	bucketDef;
// 	
// 	public static final String NAMESPACE = "http://rdfs.org/ns/void#";
// 	
// 	private final String uri;
// 	
// 	private VOID2(String name) {
// 		this.uri = NAMESPACE + name;
// 	}
// 	
// 	private VOID2() {
// 		this.uri = NAMESPACE + super.toString();
// 	}
// 	
// 	public String toString() {
// 		return this.uri;
// 	}
// 	
// }


import static org.openrdf.query.QueryLanguage.SPARQL;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.openrdf.model.Resource;
import org.openrdf.model.Statement;
import org.openrdf.model.URI;
import org.openrdf.model.ValueFactory;
import org.openrdf.model.impl.ValueFactoryImpl;
import org.openrdf.model.vocabulary.RDF;
import org.openrdf.query.MalformedQueryException;
import org.openrdf.query.QueryEvaluationException;
import org.openrdf.query.TupleQuery;
import org.openrdf.query.TupleQueryResult;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.RepositoryResult;
import org.openrdf.repository.sail.SailRepository;
import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.RDFParseException;
import org.openrdf.rio.Rio;
import org.openrdf.sail.memory.MemoryStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.uni_koblenz.west.splendid.index.Graph;
import de.uni_koblenz.west.splendid.vocabulary.VOID2;
				LOGGER.error("malformed query, " + e.getMessage() + "\n" + query, e);
			} catch (QueryEvaluationException e) {
				LOGGER.error("failed to evaluate query on voiD repository, " + e.getMessage() + "\n" + query, e);
			} finally {
				con.close();
			}
		} catch (RepositoryException e) {
			LOGGER.error("failed to open/close voiD repository connection, " + e.getMessage() + "\n" + query, e);
		}
		return null;
	}
	
	private List<URI> getEndpoints(URI voidURI, RepositoryConnection con) throws RepositoryException {
		ValueFactory uf = this.voidRepository.getValueFactory();
		URI voidDataset = uf.createURI(VOID2.Dataset.toString());
		URI sparqlEndpoint = uf.createURI(VOID2.sparqlEndpoint.toString());
		List<URI> endpoints = new ArrayList<URI>();
		
		for (Statement dataset : con.getStatements(null, RDF.TYPE, voidDataset, false, voidURI).asList()) {
			for (Statement endpoint : con.getStatements(dataset.getSubject(), sparqlEndpoint, null, false, voidURI).asList()) {
				// TODO: endpoint may be a literal
				endpoints.add((URI) endpoint.getObject());
			}
		}
		return endpoints;
	}
	
	// -------------------------------------------------------------------------
	
	@Override
// Path: src/de/uni_koblenz/west/splendid/index/Graph.java
// public class Graph {
// 	
// 	String name;
// 	
// 	public Graph(String name) {
// 		this.name = name;
// 	}
// 	
// 	@Override
// 	public boolean equals(Object object) {
// 		if (object instanceof Graph)
// 			return this.name.equals(((Graph) object).name);
// 		return false;
// 	}
// 	
// 	@Override
// 	public int hashCode() {
// 		return this.name.hashCode();
// 	}
// 	
// 	public String toString() {
// 		return this.name;
// 	}
// 	
// 	public String getNamespaceURL() {
// 		// TODO: implement proper hamespace handling
// 		return this.name.replaceFirst("http://lodse.west.uni-koblenz.de:8080/openrdf-sesame/repositories/", "west:");
// 	}
// 
// }
// 
// Path: src/de/uni_koblenz/west/splendid/vocabulary/VOID2.java
// public enum VOID2 {
// 	
// 	// concepts
// 	Dataset,
// 	Linkset,
// 	EquiWidthHist,
// 	EuqiDepthHist,
// 	
// 	// predicates
// 	vocabulary,
// 	sparqlEndpoint,
// 	distinctSubjects,
// 	distinctObjects,
// 	triples,
// 	classes,
// 	entities,
// 	properties,
// 	classPartition,
// 	clazz("class"),
// 	propertyPartition,
// 	property,
// 	target,
// 	linkPredicate,
// 	
// 	histogram,
// 	minValue,
// 	maxValue,
// 	bucketLoad,
// 	buckets,
// 	bucketDef;
// 	
// 	public static final String NAMESPACE = "http://rdfs.org/ns/void#";
// 	
// 	private final String uri;
// 	
// 	private VOID2(String name) {
// 		this.uri = NAMESPACE + name;
// 	}
// 	
// 	private VOID2() {
// 		this.uri = NAMESPACE + super.toString();
// 	}
// 	
// 	public String toString() {
// 		return this.uri;
// 	}
// 	
// }


// Path: src/de/uni_koblenz/west/splendid/statistics/VoidStatistics.java
import static org.openrdf.query.QueryLanguage.SPARQL;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.openrdf.model.Resource;
import org.openrdf.model.Statement;
import org.openrdf.model.URI;
import org.openrdf.model.ValueFactory;
import org.openrdf.model.impl.ValueFactoryImpl;
import org.openrdf.model.vocabulary.RDF;
import org.openrdf.query.MalformedQueryException;
import org.openrdf.query.QueryEvaluationException;
import org.openrdf.query.TupleQuery;
import org.openrdf.query.TupleQueryResult;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.RepositoryResult;
import org.openrdf.repository.sail.SailRepository;
import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.RDFParseException;
import org.openrdf.rio.Rio;
import org.openrdf.sail.memory.MemoryStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.uni_koblenz.west.splendid.index.Graph;
import de.uni_koblenz.west.splendid.vocabulary.VOID2;

				LOGGER.error("malformed query, " + e.getMessage() + "\n" + query, e);
			} catch (QueryEvaluationException e) {
				LOGGER.error("failed to evaluate query on voiD repository, " + e.getMessage() + "\n" + query, e);
			} finally {
				con.close();
			}
		} catch (RepositoryException e) {
			LOGGER.error("failed to open/close voiD repository connection, " + e.getMessage() + "\n" + query, e);
		}
		return null;
	}
	
	private List<URI> getEndpoints(URI voidURI, RepositoryConnection con) throws RepositoryException {
		ValueFactory uf = this.voidRepository.getValueFactory();
		URI voidDataset = uf.createURI(VOID2.Dataset.toString());
		URI sparqlEndpoint = uf.createURI(VOID2.sparqlEndpoint.toString());
		List<URI> endpoints = new ArrayList<URI>();
		
		for (Statement dataset : con.getStatements(null, RDF.TYPE, voidDataset, false, voidURI).asList()) {
			for (Statement endpoint : con.getStatements(dataset.getSubject(), sparqlEndpoint, null, false, voidURI).asList()) {
				// TODO: endpoint may be a literal
				endpoints.add((URI) endpoint.getObject());
			}
		}
		return endpoints;
	}
	
	// -------------------------------------------------------------------------
	
	@Override
	public Set<Graph> findSources(String sValue, String pValue, String oValue, boolean handleType) {