/** * Initialise all components. * @param id Session ID. * @throws ComponentInitException Thrown if an error occurs during component initialisation. */ @WebMethod public void initAll(int id) throws ClientNotKnownException, ComponentInitException { ClientState state = getState(id); logger.info("Initializing knowledge sources..."); for(AbstractKnowledgeSource ks : state.getKnowledgeSources()) ks.init(); logger.info("Initializing reasoner..."); state.getReasonerComponent().init(); logger.info("Initializing learning problem..."); state.getLearningProblem().init(); logger.info("Initializing learning algorithm..."); state.getLearningAlgorithm().init(); }
public static void main(String[] args) throws Exception{ // StringRenderer.setRenderer(Rendering.DL_SYNTAX); Logger.getRootLogger().setLevel(Level.INFO); Logger.getLogger(PCELOE.class).setLevel(Level.DEBUG); Logger.getLogger(PCELOE.class).addAppender(new FileAppender(new PatternLayout( "[%t] %c: %m%n" ), "log/parallel_run.txt", false)); AbstractKnowledgeSource ks = new OWLFile("../examples/family/father_oe.owl"); ks.init(); AbstractReasonerComponent rc = new ClosedWorldReasoner(ks); rc.init(); ClassLearningProblem lp = new ClassLearningProblem(rc); lp.setClassToDescribe(new OWLClassImpl(IRI.create("http://example.com/father#father"))); lp.setCheckConsistency(false); lp.init(); PCELOE alg = new PCELOE(lp, rc); alg.setMaxExecutionTimeInSeconds(10); alg.setNrOfThreads(4); // alg.setMaxClassDescriptionTests(200); alg.init(); alg.start(); }
TestRunner(String prefix, String owlfile, OWLDatatype restrictionType, int maxNrOfSplits) throws OWLOntologyCreationException, ComponentInitException { this.prefix = prefix; this.restrictionType = restrictionType; this.maxNrOfSplits = maxNrOfSplits; // StringRenderer.setRenderer(Rendering.MANCHESTER_SYNTAX); // StringRenderer.setRenderer(Rendering.DL_SYNTAX); File file = new File(owlfile); OWLOntology ontology = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(file); df = new OWLDataFactoryImpl(); pm = new DefaultPrefixManager(); pm.setDefaultPrefix(prefix); ks = new OWLAPIOntology(ontology); ks.init(); } TestRunner(String prefix, String owlfile, OWLDatatype restrictionType) throws OWLOntologyCreationException, ComponentInitException {
OWLOntology ontology = man.loadOntologyFromOntologyDocument(new File(ontologyPath)); AbstractKnowledgeSource source = new OWLAPIOntology(ontology); source.init();
OWLOntology ontology = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(file); AbstractKnowledgeSource ks = new OWLAPIOntology(ontology); ks.init();
OWLOntology ontology = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(file); AbstractKnowledgeSource ks = new OWLAPIOntology(ontology); ks.init();