public WikidataValueScorer(Env env, Config conf) throws ConfigurationException { super(env, conf); try { wikidataDao = env.getConfigurator().get(WikidataDao.class); columnName = conf.getString("column"); Language lang = env.getLanguages().getBestAvailableEnglishLang(false); WikidataEntity prop = wikidataDao.getProperty(lang, conf.getString("property")); if (prop == null) { throw new IllegalArgumentException("Couldn't find property with name " + conf.getString("property")); } propertyId = prop.getId(); } catch (WikiBrainException e) { throw new ConfigurationException(e); } catch (DaoException e) { throw new ConfigurationException(e); } }
public WikidataValueScorer(Env env, Config conf) throws ConfigurationException { super(env, conf); try { wikidataDao = env.getConfigurator().get(WikidataDao.class); columnName = conf.getString("column"); Language lang = env.getLanguages().getBestAvailableEnglishLang(false); WikidataEntity prop = wikidataDao.getProperty(lang, conf.getString("property")); if (prop == null) { throw new IllegalArgumentException("Couldn't find property with name " + conf.getString("property")); } propertyId = prop.getId(); } catch (WikiBrainException e) { throw new ConfigurationException(e); } catch (DaoException e) { throw new ConfigurationException(e); } }