public SPARQLLearningProblemsGenerator(SparqlEndpoint endpoint, File benchmarkDirectory, int threadCount) throws ComponentInitException { this.benchmarkDirectory = benchmarkDirectory; this.threadCount = threadCount; // setup the endpoint ks = new SparqlEndpointKS(endpoint); ks.setCacheDir(new File(benchmarkDirectory, "cache").getPath() + ";mv_store=false"); ks.setPageSize(50000); ks.setUseCache(true); ks.setQueryDelay(100); ks.init(); // the directory where instance data is stored dataDir = new File(benchmarkDirectory, "data/dbpedia/"); dataDir.mkdirs(); schema = ModelFactory.createDefaultModel(); // initialize the reasoner reasoner = new SPARQLReasoner(ks); reasoner.init(); }
public BiomedicalLearningProblemsGenerator(File benchmarkDirectory, int threadCount) throws Exception { this.benchmarkDirectory = benchmarkDirectory; this.threadCount = threadCount; Model model = RDFDataMgr.loadModel("file:/home/user/work/experiments/qtl/data/biomedical/drugbank_dump.nt", Lang.NTRIPLES); schema = ModelFactory.createDefaultModel(); schema.read(new FileInputStream(new File("/home/user/work/experiments/qtl/data/biomedical/", "drugbank.schema.owl")), null, "RDF/XML"); schema.write(System.out, "TURTLE"); model.add(schema); ks = new LocalModelBasedSparqlEndpointKS(model); ks.setUseCache(true); ks.setQueryDelay(100); ks.init(); reasoner = new SPARQLReasoner(ks); reasoner.init(); cbdGen = new ConciseBoundedDescriptionGeneratorImpl(ks.getQueryExecutionFactory()); dataDir = new File(benchmarkDirectory, "data/biomedical/"); dataDir.mkdirs(); }
endpoint = SparqlEndpoint.create("http://sake.informatik.uni-leipzig.de:8890/sparql", "http://dbpedia.org"); SparqlEndpointKS ks = new SparqlEndpointKS(endpoint); ks.setQueryDelay(0); ks.setUseCache(false); ks.setRetryCount(0);