.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.engines.wikidata.WDGeoAttribute Class Reference
+ Inheritance diagram for searx.engines.wikidata.WDGeoAttribute:
+ Collaboration diagram for searx.engines.wikidata.WDGeoAttribute:

Public Member Functions

 get_label (self, language)
 
 get_select (self)
 
 get_where (self)
 
 get_group_by (self)
 
 get_str (self, result, language)
 
 get_geo_url (self, result, osm_zoom=19)
 
- Public Member Functions inherited from searx.engines.wikidata.WDAttribute
 __init__ (self, name)
 
 get_wikibase_label (self)
 
 __repr__ (self)
 

Public Attributes

 name
 
- Public Attributes inherited from searx.engines.wikidata.WDAttribute
 name = name
 

Detailed Description

Definition at line 614 of file wikidata.py.

Member Function Documentation

◆ get_geo_url()

searx.engines.wikidata.WDGeoAttribute.get_geo_url ( self,
result,
osm_zoom = 19 )

Definition at line 638 of file wikidata.py.

638 def get_geo_url(self, result, osm_zoom=19):
639 latitude = result.get(self.name + 'Lat')
640 longitude = result.get(self.name + 'Long')
641 if latitude and longitude:
642 return get_earth_coordinates_url(latitude, longitude, osm_zoom)
643 return None
644
645

References searx.engines.wikidata.WDAmountAttribute.name, searx.engines.wikidata.WDAttribute.name, searx.engines.wikidata.WDDateAttribute.name, searx.engines.wikidata.WDGeoAttribute.name, searx.engines.wikidata.WDLabelAttribute.name, searx.preferences.BooleanChoices.name, and searx.search.models.EngineRef.name.

◆ get_group_by()

searx.engines.wikidata.WDGeoAttribute.get_group_by ( self)

Reimplemented from searx.engines.wikidata.WDAttribute.

Definition at line 628 of file wikidata.py.

628 def get_group_by(self):
629 return self.get_select()
630

References searx.engines.wikidata.WDAmountAttribute.get_select(), searx.engines.wikidata.WDArticle.get_select(), searx.engines.wikidata.WDAttribute.get_select(), searx.engines.wikidata.WDDateAttribute.get_select(), searx.engines.wikidata.WDGeoAttribute.get_select(), and searx.engines.wikidata.WDLabelAttribute.get_select().

+ Here is the call graph for this function:

◆ get_label()

searx.engines.wikidata.WDGeoAttribute.get_label ( self,
language )

Reimplemented from searx.engines.wikidata.WDAttribute.

Definition at line 615 of file wikidata.py.

615 def get_label(self, language):
616 return "OpenStreetMap"
617

◆ get_select()

searx.engines.wikidata.WDGeoAttribute.get_select ( self)

Reimplemented from searx.engines.wikidata.WDAttribute.

Definition at line 618 of file wikidata.py.

618 def get_select(self):
619 return "?{name}Lat ?{name}Long".replace('{name}', self.name)
620

Referenced by searx.engines.wikidata.WDAmountAttribute.get_group_by(), searx.engines.wikidata.WDArticle.get_group_by(), searx.engines.wikidata.WDDateAttribute.get_group_by(), and searx.engines.wikidata.WDGeoAttribute.get_group_by().

+ Here is the caller graph for this function:

◆ get_str()

searx.engines.wikidata.WDGeoAttribute.get_str ( self,
result,
language )

Reimplemented from searx.engines.wikidata.WDAttribute.

Definition at line 631 of file wikidata.py.

631 def get_str(self, result, language):
632 latitude = result.get(self.name + 'Lat')
633 longitude = result.get(self.name + 'Long')
634 if latitude and longitude:
635 return latitude + ' ' + longitude
636 return None
637

References searx.engines.wikidata.WDAmountAttribute.name, searx.engines.wikidata.WDAttribute.name, searx.engines.wikidata.WDDateAttribute.name, searx.engines.wikidata.WDGeoAttribute.name, searx.engines.wikidata.WDLabelAttribute.name, searx.preferences.BooleanChoices.name, and searx.search.models.EngineRef.name.

◆ get_where()

searx.engines.wikidata.WDGeoAttribute.get_where ( self)

Reimplemented from searx.engines.wikidata.WDAttribute.

Definition at line 621 of file wikidata.py.

621 def get_where(self):
622 return """OPTIONAL { ?item p:{name}/psv:{name} [
623 wikibase:geoLatitude ?{name}Lat ;
624 wikibase:geoLongitude ?{name}Long ] }""".replace(
625 '{name}', self.name
626 )
627

References searx.engines.wikidata.WDAmountAttribute.name, searx.engines.wikidata.WDAttribute.name, searx.engines.wikidata.WDDateAttribute.name, searx.engines.wikidata.WDGeoAttribute.name, searx.engines.wikidata.WDLabelAttribute.name, searx.preferences.BooleanChoices.name, and searx.search.models.EngineRef.name.

Member Data Documentation

◆ name


The documentation for this class was generated from the following file: