TBSLManager { public TBSLManager() { cache = new ExtractionDBCache(Manager.getInstance().getCacheDir()); cache.setMaxExecutionTimeInSeconds(100); } TBSLManager(); void setProgressListener(TBSLProgressListener progressListener); Map<String, BasicResultItem> getUri2Items(); String getNLRepresentation(String sparqlQueryString); Refinement refine(List<String> posExamples, List<String> negExamples); void setKnowledgebase(ExtendedTBSL ekb); List<Entry<String, String>> getMoreSolutions(); List<Entry<String, String>> getMoreSolutions(int offset); Answer answerQuestion(String question); Answer createAnswer(String sparqlQueryString); String getAnswerAsSPARQLQuery(String question); boolean isDataProperty(String propertyURI); Map<String, Integer> getAdditionalProperties(); void fillItems(String propertyURI); void fillItems(List<String> propertyURIs); Map<String, Set<Object>> getDataForProperty(String propertyURI); String getCurrentQuestion(); XSDDatatype getDatatype(String propertyURI); String getLearnedSPARQLQuery(); static Query normalizeVarNames(Query query); ExtendedTBSL getActiveTBSL(); void setActiveTBSL(ExtendedTBSL eTBSL); public ExtendedTBSL activeTBSL; public ExtendedTBSL[] tbsls; }
@Test public void testTBSLManager() { Manager.getInstance().init(); Logger.getLogger(QTL.class).setLevel(Level.DEBUG); TBSLManager man = new TBSLManager(); SelectAnswer a = (SelectAnswer) man.answerQuestion("Give me all houses with more than 3 bedrooms."); assertFalse(a.getItems().isEmpty()); for(BasicResultItem item : a.getItems()) System.out.println(item.getLabel()); List<String> p = new ArrayList<String>(); p.add(a.getItems().get(1).getUri()); p.add(a.getItems().get(2).getUri()); p.add(a.getItems().get(0).getUri()); List<String> n = new ArrayList<String>(); man.refine(p, n); }