// Path: src/de/uni_koblenz/west/splendid/test/config/ConfigurationException.java
// public class ConfigurationException extends Exception {
// 
// 	private static final long serialVersionUID = -944853354860850390L;
// 
// 	public ConfigurationException(String message) {
// 		super(message);
// 	}
// 	
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.openrdf.model.Graph;
import org.openrdf.model.impl.GraphImpl;
import org.openrdf.query.BooleanQuery;
import org.openrdf.query.GraphQuery;
import org.openrdf.query.MalformedQueryException;
import org.openrdf.query.Query;
import org.openrdf.query.QueryEvaluationException;
import org.openrdf.query.QueryLanguage;
import org.openrdf.query.TupleQuery;
import org.openrdf.query.TupleQueryResultHandlerException;
import org.openrdf.query.resultio.sparqljson.SPARQLResultsJSONWriter;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.config.RepositoryConfig;
import org.openrdf.repository.config.RepositoryConfigException;
import org.openrdf.repository.config.RepositoryFactory;
import org.openrdf.repository.config.RepositoryImplConfig;
import org.openrdf.repository.config.RepositoryRegistry;
import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.RDFHandlerException;
import org.openrdf.rio.RDFParseException;
import org.openrdf.rio.RDFParser;
import org.openrdf.rio.Rio;
import org.openrdf.rio.UnsupportedRDFormatException;
import org.openrdf.rio.helpers.StatementCollector;
import org.openrdf.rio.n3.N3Writer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.uni_koblenz.west.splendid.test.config.ConfigurationException;
/*
 * This file is part of SPLENDID.
 * 
 * SPLENDID is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * SPLENDID is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with SPLENDID.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * SPLENDID uses libraries from the OpenRDF Sesame Project licensed 
 * under the Aduna BSD-style license. 
 */
package de.uni_koblenz.west.splendid;




/**
 * Command Line Interface for the SPLENDID federation.  
 * 
 * @author goerlitz@uni-koblenz.de
 */
public class SPLENDID {
	
	private static final Logger LOGGER = LoggerFactory.getLogger(SPLENDID.class);
	
	private Repository repo;
	
	public static void main(String[] args) {
		
		if (args.length < 2) {
			System.out.println("USAGE: java SPLENDID <config> <query>");
			System.exit(1);
		}
		
		String configFile = args[0];
		List<String> queryFiles = Arrays.asList(Arrays.copyOfRange(args, 1, args.length));
		
		try {
			SPLENDID splendid = new SPLENDID(configFile);
			splendid.execSparqlQueries(queryFiles);
// Path: src/de/uni_koblenz/west/splendid/test/config/ConfigurationException.java
// public class ConfigurationException extends Exception {
// 
// 	private static final long serialVersionUID = -944853354860850390L;
// 
// 	public ConfigurationException(String message) {
// 		super(message);
// 	}
// 	
// }


// Path: src/de/uni_koblenz/west/splendid/SPLENDID.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.openrdf.model.Graph;
import org.openrdf.model.impl.GraphImpl;
import org.openrdf.query.BooleanQuery;
import org.openrdf.query.GraphQuery;
import org.openrdf.query.MalformedQueryException;
import org.openrdf.query.Query;
import org.openrdf.query.QueryEvaluationException;
import org.openrdf.query.QueryLanguage;
import org.openrdf.query.TupleQuery;
import org.openrdf.query.TupleQueryResultHandlerException;
import org.openrdf.query.resultio.sparqljson.SPARQLResultsJSONWriter;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.config.RepositoryConfig;
import org.openrdf.repository.config.RepositoryConfigException;
import org.openrdf.repository.config.RepositoryFactory;
import org.openrdf.repository.config.RepositoryImplConfig;
import org.openrdf.repository.config.RepositoryRegistry;
import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.RDFHandlerException;
import org.openrdf.rio.RDFParseException;
import org.openrdf.rio.RDFParser;
import org.openrdf.rio.Rio;
import org.openrdf.rio.UnsupportedRDFormatException;
import org.openrdf.rio.helpers.StatementCollector;
import org.openrdf.rio.n3.N3Writer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.uni_koblenz.west.splendid.test.config.ConfigurationException;

/*
 * This file is part of SPLENDID.
 * 
 * SPLENDID is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * SPLENDID is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with SPLENDID.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * SPLENDID uses libraries from the OpenRDF Sesame Project licensed 
 * under the Aduna BSD-style license. 
 */
package de.uni_koblenz.west.splendid;




/**
 * Command Line Interface for the SPLENDID federation.  
 * 
 * @author goerlitz@uni-koblenz.de
 */
public class SPLENDID {
	
	private static final Logger LOGGER = LoggerFactory.getLogger(SPLENDID.class);
	
	private Repository repo;
	
	public static void main(String[] args) {
		
		if (args.length < 2) {
			System.out.println("USAGE: java SPLENDID <config> <query>");
			System.exit(1);
		}
		
		String configFile = args[0];
		List<String> queryFiles = Arrays.asList(Arrays.copyOfRange(args, 1, args.length));
		
		try {
			SPLENDID splendid = new SPLENDID(configFile);
			splendid.execSparqlQueries(queryFiles);
		} catch (ConfigurationException e) {