package dk.aau.kah.bits.main;

import java.io.IOException;

import org.apache.jena.graph.NodeFactory;
import org.apache.jena.propertytable.Column;
import org.apache.jena.propertytable.PropertyTable;
import org.apache.jena.propertytable.Row;
import org.apache.jena.propertytable.graph.GraphPropertyTable;
import org.apache.jena.propertytable.impl.PropertyTableArrayImpl;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryExecutionFactory;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.query.ResultSet;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import da.aau.kah.bits.exceptions.InvalidDatabaseConfig;
import dk.aau.kah.bits.database.DatabaseConfig;
import dk.aau.kah.bits.database.DatabaseHandler;
import dk.aau.kah.bits.helpers.ConfigurationLoader;


public class Bits {

	public static void main(String[] args) {	
		
		DatabaseHandler databaseHandler;
		DatabaseConfig databaseConfig;
	
		try {
			//databaseConfig = ConfigurationLoader.load("onto0st-fact0st-dim0st.json");
			databaseConfig = ConfigurationLoader.load("onto0st-fact1pt-dim#pt.json");
			databaseHandler = new DatabaseHandler(databaseConfig);
			Model factModel = databaseHandler.getFactModel();
			//PrintHelper.printModel(factModel);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (InvalidDatabaseConfig e) {
			e.printStackTrace();
		} 
		

		
		//Query database
		
		//display/save results

	}
	


}

@@ -64,612 +64,90 @@
 ort 
-org.apache.jena.graph.NodeFactory;%0Aimport org.apache.jena.propertytable.Column;%0Aimport org.apache.jena.propertytable.PropertyTable;%0Aimport org.apache.jena.propertytable.Row;%0Aimport org.apache.jena.propertytable.graph.GraphPropertyTable;%0Aimport org.apache.jena.propertytable.impl.PropertyTableArrayImpl;%0Aimport org.apache.jena.query.Query;%0Aimport org.apache.jena.query.QueryExecution;%0Aimport org.apache.jena.query.QueryExecutionFactory;%0Aimport org.apache.jena.query.QueryFactory;%0Aimport org.apache.jena.query.ResultSet;%0Aimport org.apache.jena.rdf.model.Model;%0Aimport org.apache.jena.rdf.model.ModelFactory
+da.aau.kah.bits.config.DatabaseConfig;%0Aimport da.aau.kah.bits.config.GeneralConfig
 ;%0Aim
@@ -205,56 +205,8 @@
 ig;%0A
-import dk.aau.kah.bits.database.DatabaseConfig;%0A
 impo
@@ -250,16 +250,130 @@
 andler;%0A
+import dk.aau.kah.bits.experiment.AbstractExperimentHandler;%0Aimport dk.aau.kah.bits.experiment.ExperimentFactory;%0A
 import d
@@ -417,17 +417,16 @@
 oader;%0A%0A
-%0A
 public c
@@ -479,20 +479,17 @@
  args) %7B
-%09%0A%09%09
+%0A
 %0A%09%09Datab
@@ -549,17 +549,16 @@
 Config;%0A
-%09
 %0A%09%09try %7B
@@ -561,18 +561,16 @@
 ry %7B%0A%09%09%09
-//
 database
@@ -594,32 +594,46 @@
 ationLoader.load
+DatabaseConfig
 (%22onto0st-fact0s
@@ -634,16 +634,16 @@
 fact
-0
+1
 st-dim
-0
+#
 st.j
@@ -656,230 +656,686 @@
 %0A%09%09%09
-databaseConfig = ConfigurationLoader.load(%22onto0st-fact1pt-dim#pt.json%22);%0A%09%09%09databaseHandler = new DatabaseHandler(databaseConfig);%0A%09%09%09Model factModel = databaseHandler.getFactModel();%0A%09%09%09//PrintHelper.printModel(factModel
+%0A%09%09%09//ConfigurationLoader.loadSystemConfig(%22kah-ThinkPad-X220.json%22);%0A%09%09%09GeneralConfig generalConfig = GeneralConfig.getInstance();%0A%09%09%09generalConfig.setTdbLoaderPath(%22/usr/local/apache-jena-2.12.1/bin/tdbloader%22);%0A%09%09%09generalConfig.setVerbose(true);%0A%09%09%0A%09%09%09databaseHandler = new DatabaseHandler(databaseConfig);%0A%09%09%09%0A%09%09%09//System.out.println(%22all models: %22+databaseHandler.getAllModelNames());%0A%09%09%09%0A%09%09%09ExperimentFactory experimentFactory = new ExperimentFactory();%0A%09%09%09AbstractExperimentHandler experimentHandler = experimentFactory.makeEvaluation(databaseHandler, databaseConfig);%0A%09%09%09experimentHandler.run();%0A%09%09%09experimentHandler.getResults();%0A%09%09%09%0A%09%09%09databaseHandler.closeConnection(
 );%0A%09
@@ -1454,21 +1454,21 @@
 %0A%09%09%7D
- 
+%0A
 %0A%09%09%0A
-%0A
 %09%09%0A%09%09//
+ 
 Quer
@@ -1478,23 +1478,22 @@
 atabase%0A
-%09%09
 %0A%09%09//
+ 
 display/
@@ -1513,10 +1513,7 @@
 %0A%09%7D%0A
-%09%0A%0A
 %0A%7D%0A

Clean up