mirror of
https://github.com/searxng/searxng.git
synced 2026-05-07 18:03:51 +02:00
[fix] wikidata: crashes when querying due to missing escaping of quotation marks
This commit is contained in:
@@ -146,7 +146,7 @@ class WDAttribute:
|
|||||||
self.name: str = name
|
self.name: str = name
|
||||||
|
|
||||||
def get_select(self):
|
def get_select(self):
|
||||||
return "(group_concat(distinct ?{name};separator=", ") as ?{name}s)".replace("{name}", self.name)
|
return "(group_concat(distinct ?{name};separator=', ') as ?{name}s)".replace("{name}", self.name)
|
||||||
|
|
||||||
def get_label(self, language: str):
|
def get_label(self, language: str):
|
||||||
return get_label_for_entity(self.name, language)
|
return get_label_for_entity(self.name, language)
|
||||||
@@ -222,7 +222,7 @@ class WDArticle(WDAttribute):
|
|||||||
|
|
||||||
class WDLabelAttribute(WDAttribute):
|
class WDLabelAttribute(WDAttribute):
|
||||||
def get_select(self):
|
def get_select(self):
|
||||||
return "(group_concat(distinct ?{name}Label;separator=", ") as ?{name}Labels)".replace("{name}", self.name)
|
return "(group_concat(distinct ?{name}Label;separator=', ') as ?{name}Labels)".replace("{name}", self.name)
|
||||||
|
|
||||||
def get_where(self):
|
def get_where(self):
|
||||||
return "OPTIONAL { ?item wdt:{name} ?{name} . }".replace("{name}", self.name)
|
return "OPTIONAL { ?item wdt:{name} ?{name} . }".replace("{name}", self.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user