public class WikidataSqlDao extends AbstractSqlDao<WikidataStatement> implements WikidataDao
| Modifier and Type | Class and Description |
|---|---|
static class |
WikidataSqlDao.Provider |
cache, DEFAULT_FETCH_SIZE, dialect, LOG, wpDs| Constructor and Description |
|---|
WikidataSqlDao(WpDataSource dataSource,
LocalPageDao lpDao,
UniversalPageDao upDao) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginLoad() |
protected WikidataStatement |
buildStatement(org.jooq.Record record) |
Set<Integer> |
conceptsWithValue(String propertyName,
WikidataValue value) |
void |
endLoad() |
Iterable<WikidataStatement> |
get(DaoFilter daoFilter) |
Iterable<WikidataStatement> |
get(WikidataFilter filter)
Returns all statements that meet some sort of criterion.
|
Iterable<WikidataStatement> |
getByValue(String propertyName,
WikidataValue value) |
Iterable<WikidataStatement> |
getByValue(WikidataEntity property,
WikidataValue value) |
int |
getCount(DaoFilter daoFilter) |
WikidataEntity |
getItem(int id)
Returns the item associated with the particular id
|
Integer |
getItemId(LocalId localId) |
Integer |
getItemId(LocalPage page)
Gets the item id for a given LocalPage (the number after "Q")
|
LocalWikidataStatement |
getLocalStatement(Language language,
WikidataStatement statement)
Translates a single language-agnostic statement into a human interpretable
statement in that particular language.
|
Map<String,List<LocalWikidataStatement>> |
getLocalStatements(Language lang,
WikidataEntity.Type type,
int id)
Returns all statements for the specified concept id.
|
Map<String,List<LocalWikidataStatement>> |
getLocalStatements(LocalPage page)
Returns human-understandable interpretations of statements for a particular page.
|
Map<Integer,WikidataEntity> |
getProperties()
Returns all known properties.
|
WikidataEntity |
getProperty(int id)
Fetches the property associated with an id.
|
WikidataEntity |
getProperty(Language language,
String name)
Gets a property by a name in some language.
|
Collection<WikidataEntity> |
getPropertyByName(Language language,
String name) |
Collection<WikidataEntity> |
getPropertyByName(String name) |
List<WikidataStatement> |
getStatements(LocalPage page)
Returns all statements for a particular page.
|
UniversalPage |
getUniversalPage(int itemId)
Gets the LocalPage for the input itemId (the number after "Q") and language (if it exists)
|
Set<LocalId> |
pagesWithValue(String propertyName,
WikidataValue value,
Language language) |
void |
save(WikidataEntity entity)
Saves the specified entity
|
void |
save(WikidataStatement item) |
clear, executeSqlResource, executeSqlScriptWithSuffix, freeJooq, getFetchSize, getJooq, getLoadedLanguages, insert, quietlyCloseConn, setFetchSize, useCacheclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclear, getLoadedLanguagespublic WikidataSqlDao(WpDataSource dataSource, LocalPageDao lpDao, UniversalPageDao upDao) throws DaoException
dataSource - Data source for jdbc connectionsDaoExceptionpublic WikidataEntity getProperty(Language language, String name) throws DaoException
WikidataDaogetProperty in interface WikidataDaoDaoExceptionpublic WikidataEntity getProperty(int id) throws DaoException
WikidataDaogetProperty in interface WikidataDaoid - The numeric number appearing after the "P" in the Wikimedia Foundation ids.DaoExceptionpublic WikidataEntity getItem(int id) throws DaoException
WikidataDaogetItem in interface WikidataDaoid - The numeric number appearing after the "Q" in the Wikimedia Foundation ids.DaoExceptionpublic Map<Integer,WikidataEntity> getProperties() throws DaoException
WikidataDaogetProperties in interface WikidataDaoDaoExceptionpublic Integer getItemId(LocalPage page) throws DaoException
WikidataDaogetItemId in interface WikidataDaoDaoExceptionpublic Integer getItemId(LocalId localId) throws DaoException
getItemId in interface WikidataDaoDaoExceptionpublic UniversalPage getUniversalPage(int itemId) throws DaoException
WikidataDaogetUniversalPage in interface WikidataDaoDaoExceptionpublic List<WikidataStatement> getStatements(LocalPage page) throws DaoException
WikidataDaogetStatements in interface WikidataDaoDaoExceptionpublic Collection<WikidataEntity> getPropertyByName(Language language, String name) throws DaoException
DaoExceptionpublic Collection<WikidataEntity> getPropertyByName(String name) throws DaoException
DaoExceptionpublic Map<String,List<LocalWikidataStatement>> getLocalStatements(LocalPage page) throws DaoException
WikidataDaogetLocalStatements in interface WikidataDaoDaoExceptionpublic void beginLoad()
throws DaoException
beginLoad in interface Dao<WikidataStatement>beginLoad in class AbstractSqlDao<WikidataStatement>DaoExceptionpublic void save(WikidataEntity entity) throws DaoException
WikidataDaosave in interface WikidataDaoDaoExceptionpublic void save(WikidataStatement item) throws DaoException
save in interface Dao<WikidataStatement>DaoExceptionpublic void endLoad()
throws DaoException
endLoad in interface Dao<WikidataStatement>endLoad in class AbstractSqlDao<WikidataStatement>DaoExceptionpublic Map<String,List<LocalWikidataStatement>> getLocalStatements(Language lang, WikidataEntity.Type type, int id) throws DaoException
WikidataDaogetLocalStatements in interface WikidataDaolang - Language for local statementstype - Type of entity (item or property)id - numeric id (i.e. suffix after "Q" or "P")DaoExceptionpublic LocalWikidataStatement getLocalStatement(Language language, WikidataStatement statement) throws DaoException
WikidataDaogetLocalStatement in interface WikidataDaoDaoExceptionpublic Iterable<WikidataStatement> getByValue(WikidataEntity property, WikidataValue value) throws DaoException
getByValue in interface WikidataDaoDaoExceptionpublic Iterable<WikidataStatement> getByValue(String propertyName, WikidataValue value) throws DaoException
getByValue in interface WikidataDaoDaoExceptionpublic Set<Integer> conceptsWithValue(String propertyName, WikidataValue value) throws DaoException
conceptsWithValue in interface WikidataDaoDaoExceptionpublic Set<LocalId> pagesWithValue(String propertyName, WikidataValue value, Language language) throws DaoException
pagesWithValue in interface WikidataDaoDaoExceptionpublic Iterable<WikidataStatement> get(WikidataFilter filter) throws DaoException
WikidataDaoget in interface WikidataDaoDaoExceptionpublic Iterable<WikidataStatement> get(DaoFilter daoFilter) throws DaoException
get in interface Dao<WikidataStatement>DaoExceptionpublic int getCount(DaoFilter daoFilter) throws DaoException
getCount in interface Dao<WikidataStatement>DaoExceptionprotected WikidataStatement buildStatement(org.jooq.Record record) throws DaoException
DaoExceptionCopyright © 2014. All rights reserved.