@@ -0,0 +1,2841 @@
+package example.demo;%0A%0Aimport java.io.*;%0A%0Aimport com.obidea.semantika.app.Environment;%0Aimport com.obidea.semantika.app.ApplicationFactory;%0Aimport com.obidea.semantika.app.ApplicationManager;%0Aimport com.obidea.semantika.queryanswer.IQueryEngine;%0Aimport com.obidea.semantika.queryanswer.result.IQueryResult;%0A%0Apublic class EmployeeApp%0A%7B%0A   private static IQueryEngine mQueryEngine;%0A   %0A   public static void main(String%5B%5D args) throws Exception%0A   %7B%0A      sysenv();%0A      initialize();%0A      start();%0A      try %7B%0A         String queryString = readUserInput();%0A         executeQuery(queryString);%0A      %7D%0A      finally %7B%0A         stop();%0A      %7D%0A   %7D%0A   %0A   private static void sysenv()%0A   %7B%0A      if (System.getProperty(%22h2.implicitRelativePath%22) == null) %7B%0A         /*%0A          * Keep compatibility with H2 1.3%0A          *prevent http://www.h2database.com/javadoc/org/h2/api/ErrorCode.html#c90011%0A          */%0A         System.setProperty(%22h2.implicitRelativePath%22, %22true%22);%0A      %7D%0A   %7D%0A%0A   private static void initialize() throws Exception%0A   %7B%0A      ApplicationManager appManager = new ApplicationFactory()%0A         .setName(%22empdb-app%22)%0A         .addProperty(Environment.CONNECTION_URL, %22jdbc:h2:tcp://localhost/data/empdb%22)%0A         .addProperty(Environment.CONNECTION_DRIVER, %22org.h2.Driver%22)%0A         .addProperty(Environment.CONNECTION_USERNAME, %22sa%22)%0A         .addProperty(Environment.CONNECTION_PASSWORD, %22%22)%0A         .setOntologySource(%22model/empdb.owl%22)%0A         .addMappingSource(%22model/empdb.mod.xml%22)%0A         .createApplicationManager();%0A      %0A      // Create the query engine%0A      mQueryEngine = appManager.createQueryEngine();%0A   %7D%0A   %0A   private static void start() throws Exception%0A   %7B%0A      mQueryEngine.start();%0A   %7D%0A   %0A   private static void stop() throws Exception%0A   %7B%0A      mQueryEngine.stop();%0A   %7D%0A   %0A   private static void executeQuery(String queryString) throws Exception%0A   %7B%0A      IQueryResult result = mQueryEngine.evaluate(queryString);%0A      printResult(result);%0A   %7D%0A%0A   private static String readUserInput() throws Exception%0A   %7B%0A      System.out.println(); // space a bit%0A      System.out.println(%22Please type your query (use a period '.' sign to finish typing):%22);%0A      %0A      StringBuilder userQuery = new StringBuilder();%0A      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A      while (true) %7B %0A         String str = br.readLine();%0A         if (str.equals(%22.%22)) %7B%0A            break;%0A         %7D%0A         userQuery.append(str).append(%22%5Cn%22);%0A      %7D%0A      return userQuery.toString().trim();%0A   %7D%0A   %0A   private static void printResult(IQueryResult result)%0A   %7B%0A      int counter = 0;%0A      while (result.next()) %7B%0A         counter++;%0A         System.out.println(result.getValueArray().toString());%0A      %7D%0A      System.out.println(counter + %22 row(s) returned%22);%0A   %7D%0A%7D%0A

Add a demo example