.oO SearXNG Developer Documentation Oo.
|
Classes | |
class | WDAmountAttribute |
class | WDArticle |
class | WDAttribute |
class | WDDateAttribute |
class | WDGeoAttribute |
class | WDImageAttribute |
class | WDLabelAttribute |
class | WDURLAttribute |
Functions | |
get_headers () | |
get_label_for_entity (entity_id, language) | |
send_wikidata_query (query, method='GET') | |
request (query, params) | |
response (resp) | |
get_thumbnail (img_src) | |
get_results (attribute_result, attributes, language) | |
get_query (query, language) | |
get_attributes (language) | |
debug_explain_wikidata_query (query, method='GET') | |
init (engine_settings=None) | |
fetch_traits (EngineTraits engine_traits) | |
Variables | |
logging | logger .Logger |
dict | about |
list | display_type = ["infobox"] |
str | SPARQL_ENDPOINT_URL = 'https://query.wikidata.org/sparql' |
str | SPARQL_EXPLAIN_URL = 'https://query.wikidata.org/bigdata/namespace/wdq/sparql?explain' |
dict | WIKIDATA_PROPERTIES |
str | QUERY_TEMPLATE |
str | QUERY_PROPERTY_NAMES |
DUMMY_ENTITY_URLS | |
sparql_string_escape | |
replace_http_by_https = get_string_replaces_function({'http:': 'https:'}) | |
str | _IMG_SRC_DEFAULT_URL_PREFIX = "https://commons.wikimedia.org/wiki/Special:FilePath/" |
str | _IMG_SRC_NEW_URL_PREFIX = "https://upload.wikimedia.org/wikipedia/commons/thumb/" |
This module implements the Wikidata engine. Some implementations are shared from :ref:`wikipedia engine`.
searx.engines.wikidata.debug_explain_wikidata_query | ( | query, | |
method = 'GET' ) |
Definition at line 754 of file wikidata.py.
References searx.engines.wikidata.get_headers().
searx.engines.wikidata.fetch_traits | ( | EngineTraits | engine_traits | ) |
Uses languages evaluated from :py:obj:`wikipedia.fetch_wikimedia_traits <searx.engines.wikipedia.fetch_wikimedia_traits>` and removes - ``traits.custom['wiki_netloc']``: wikidata does not have net-locations for the languages and the list of all - ``traits.custom['WIKIPEDIA_LANGUAGES']``: not used in the wikipedia engine
Definition at line 783 of file wikidata.py.
searx.engines.wikidata.get_attributes | ( | language | ) |
Definition at line 353 of file wikidata.py.
Referenced by searx.engines.wikidata.get_query(), and searx.engines.wikidata.init().
searx.engines.wikidata.get_headers | ( | ) |
Definition at line 140 of file wikidata.py.
Referenced by searx.engines.wikidata.debug_explain_wikidata_query(), searx.engines.wikidata.request(), and searx.engines.wikidata.send_wikidata_query().
searx.engines.wikidata.get_label_for_entity | ( | entity_id, | |
language ) |
Definition at line 145 of file wikidata.py.
Referenced by searx.engines.wikidata.WDAttribute.get_label(), and searx.engines.wikidata.WDAmountAttribute.get_str().
searx.engines.wikidata.get_query | ( | query, | |
language ) |
Definition at line 336 of file wikidata.py.
References searx.engines.wikidata.get_attributes().
Referenced by searx.engines.wikidata.request().
searx.engines.wikidata.get_results | ( | attribute_result, | |
attributes, | |||
language ) |
Definition at line 253 of file wikidata.py.
References searx.engines.wikidata.replace_http_by_https.
Referenced by searx.engines.wikidata.response().
searx.engines.wikidata.get_thumbnail | ( | img_src | ) |
Get Thumbnail image from wikimedia commons Images from commons.wikimedia.org are (HTTP) redirected to upload.wikimedia.org. The redirected URL can be calculated by this function. - https://stackoverflow.com/a/33691240
Definition at line 214 of file wikidata.py.
searx.engines.wikidata.init | ( | engine_settings = None | ) |
Definition at line 763 of file wikidata.py.
References searx.engines.wikidata.get_attributes().
searx.engines.wikidata.request | ( | query, | |
params ) |
Definition at line 172 of file wikidata.py.
References searx.engines.wikidata.get_headers(), and searx.engines.wikidata.get_query().
searx.engines.wikidata.response | ( | resp | ) |
Definition at line 188 of file wikidata.py.
References searx.engines.wikidata.get_results().
searx.engines.wikidata.send_wikidata_query | ( | query, | |
method = 'GET' ) |
Definition at line 158 of file wikidata.py.
References searx.engines.wikidata.get_headers().
|
protected |
Definition at line 210 of file wikidata.py.
|
protected |
Definition at line 211 of file wikidata.py.
dict searx.engines.wikidata.about |
Definition at line 34 of file wikidata.py.
list searx.engines.wikidata.display_type = ["infobox"] |
Definition at line 43 of file wikidata.py.
searx.engines.wikidata.DUMMY_ENTITY_URLS |
Definition at line 115 of file wikidata.py.
logging searx.engines.wikidata.logger .Logger |
Definition at line 29 of file wikidata.py.
str searx.engines.wikidata.QUERY_PROPERTY_NAMES |
Definition at line 100 of file wikidata.py.
str searx.engines.wikidata.QUERY_TEMPLATE |
Definition at line 72 of file wikidata.py.
searx.engines.wikidata.replace_http_by_https = get_string_replaces_function({'http:': 'https:'}) |
Definition at line 137 of file wikidata.py.
Referenced by searx.engines.wikidata.get_results().
str searx.engines.wikidata.SPARQL_ENDPOINT_URL = 'https://query.wikidata.org/sparql' |
Definition at line 50 of file wikidata.py.
str searx.engines.wikidata.SPARQL_EXPLAIN_URL = 'https://query.wikidata.org/bigdata/namespace/wdq/sparql?explain' |
Definition at line 51 of file wikidata.py.
searx.engines.wikidata.sparql_string_escape |
Definition at line 122 of file wikidata.py.
dict searx.engines.wikidata.WIKIDATA_PROPERTIES |
Definition at line 52 of file wikidata.py.