KnowWE is commonly used to develop and maintain a knowledge base. Later, the built knowledge base is deployed and used in the context of a larger application. For this reason, it becomes important to load knowledge bases and run problem-solving sessions without the KnowWE context.
The following notes explain how to develop your own Eclipse project with all plugins required to run a d3web application.
In your own code, you are first required to load the plugins for the knowledge base persistence etc.; this is accomplished by the JPFPluginManager.
private void demo() throws IOException { // Initializing the plugins for the persistence JPFPluginManager.init("lib"); // Loading the knowledge base and do some retrieval of solutions and questions PersistenceManager persistenceManager = PersistenceManager.getInstance(); String knowledgeFilename = "/temp/knowledgebase.d3web"; // Load knowledge base KnowledgeBase knowledgeBase = persistenceManager.load(new File(knowledgeFilename )); List<Solution> solutions = knowledgeBase.getManager().getSolutions(); System.out.println(solutions); List<Question> questions = knowledgeBase.getManager().getQuestions(); System.out.println(questions); }
For further code, for instance, how to run a problem-solving session, we refer to How-To Create a Session.