[fix] wikidata: crashes when querying due to missing escaping of quotation marks

This commit is contained in:
Fabian Freund
2026-05-06 18:02:00 +02:00
committed by Bnyro
parent 330d56bba9
commit a480560371
+2 -2
View File
@@ -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)