I am trying to understand the Java Wikipedia Library API (JWPL).
To instanciate a Wikipedia object, I need a DatabaseConfiguration
. See the code below.
// configure the database connection parameters
DatabaseConfiguration dbConfig = new DatabaseConfiguration();
dbConfig.setHost("SERVER_URL");
dbConfig.setDatabase("DATABASE");
dbConfig.setUser("USER");
dbConfig.setPassword("PASSWORD");
dbConfig.setLanguage(Language.german);
// Create the Wikipedia object
Wikipedia wiki = new Wikipedia(dbConfig);
What exactly is the DatabaseConfiguration
and why do I need it? The Javadoc isn't clear about it.
What I need to do is to get the category of a word with the API, isn't it a way to use it like:
String category = wiki.getCathegory("word");
without database connexion?
From their documentation page (emphasis is mine)
JWPL is for you:
JWPL is not for you:
So the DB settings are to be provided by you.
This means you have to install your own Database server, insert all the dumped data given by Wikipedia and query your own database.
You would have to update your Database regularly if you need 'fresh' results.
If you need up-to-date (i.e. live) results, you would have to use a different tool.