PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?place ?placeLabel ?party ?partyLabel ?votes WHERE {
  ?result wdt:P31 wd:Q19571328 .
  ?result wdt:P1344 wd:Q30594119 .
  ?result wdt:P1001 ?place .
  ?result wdt:P527 ?party .
  ?result wdt:P1111 ?votes .
  OPTIONAL {
    ?place rdfs:label ?placeLabel FILTER ( LANG( ?placeLabel ) = "en" )
  }
  OPTIONAL {
    ?party rdfs:label ?partyLabel FILTER ( LANG( ?partyLabel ) = "en" )
  }
  FILTER ( ?party IN ( wd:Q85843184 , wd:Q15630787 ) )
}
ORDER BY ?place ?party

Using entities:
- Vox (wd:Q15630787): is instance of political party in Spain / Spanish political party
- electoral result (wd:Q19571328), also known as election outcome, election results, electoral outcome: is subclass of result / results of an election
- 2020 Basque regional election (wd:Q30594119): is instance of Parliament elections in the Basque Country / is instance of event affected by the COVID-19 pandemic / election
- PP+Cs (wd:Q85843184): is instance of electoral alliance / is instance of Electoral alliance / electoral alliance

Using properties:
- applies to jurisdiction (wd:P1001 as wdt), also known as applicable area, applicable country, applicable geographic place, applicable jurisdiction, applicable location, etc.: is subproperty of characteristic of / is subproperty of operating area / is subproperty of significant place / the item (an institution, law, public office ...) or ... jurisdiction: a country, state, municipality, ...) / the item (institution, law, public office, public ... jurisdiction: a country, state, municipality, ...)
- votes received (wd:P1111 as wdt), also known as popular vote, P1111: qualifier stating the number of votes for a candidate in an election / qualifier stating the number of votes for a candidate in an election
- participant in (wd:P1344 as wdt), also known as attended, competed in, competes in, participant of, participant of event, etc.: is subproperty of part of / is subproperty of significant event / event in which a person or organisation was/is a participant; inverse of P710 or P1923 / event in which a person or organization was/is a participant; inverse of P710 or P1923
- instance of (wd:P31 as wdt), also known as example of, has type, is a, is an, is of type, etc.: that class of which this subject is a particular example and ... a subclass of mountain (and an instance of volcanic landform) / type to which this subject corresponds/belongs. Different ... and the volcano is a type (instance) of volcanic landform
- has part(s) (wd:P527 as wdt), also known as amalgamation of, assembled from, assembled out of, composed of, comprised of, etc.: part of this subject, also valuable subclass or exemplar. Inverse property of "part of". / part of this subject; inverse property of "part of" (P361). See also "has parts of the class" (P2670). / part of this subject; inverse property of "part of" (P361). See also "has parts of the class" (P2670).

Explanation:
I could not find a satisfactory SPARQL query that returns per-jurisdiction vote counts for the PP+Cs and Vox parties in the 2020 Basque regional election. I searched and inspected Wikidata for the standard modeling patterns used for election results (items of type 'electoral result' (wd:Q19571328), statements using votes received (P1111), 'applies to jurisdiction' (P1001), 'participant in' (P1344), and search patterns that attach votes as qualifiers to participant statements). Concretely, I performed these steps:

1) Located the election item: 2020 Basque regional election (wd:Q30594119).
2) Located party items: PP+Cs (wd:Q85843184) and Vox (wd:Q15630787).
3) Looked for usage of votes received (wdt:P1111) across Wikidata and attempted to filter for items related to the Basque election, but queries matching labels (English/Spanish) returned no usable result items.
4) Examined the PP+Cs item: it has a direct 'participant in' (P1344) statement for the 2020 Basque election, but that statement had no qualifiers (no votes or per-jurisdiction qualifiers).
5) Examined the election item for child/result items (P527, P361), p:P1344 statements, or p:P1111 qualifiers — found no result statements with qualifiers linking votes to jurisdictions.
6) Probed municipality items (e.g., Vitoria-Gasteiz wd:Q14318, Bilbao wd:Q28462) for p:P1111 and found none.

Because none of these searches turned up items/statements in Wikidata following common modeling patterns (e.g., "electoral result" items with properties for election, jurisdiction, party, and votes), I couldn't construct a reliable, executable SPARQL query that returns the requested per-jurisdiction vote counts.

It's possible that: (a) Wikidata does not contain municipality- or constituency-level vote counts for this particular election; (b) the data exists but is stored in a different, nonstandard schema or labeled only in non-English labels making automated discovery hard; or (c) results are kept on Wikisource/Wikipedia tables only and not imported into Wikidata.

Best attempt SPARQL query (would return results if per-jurisdiction results are modeled as items of type electoral result and link election, jurisdiction and party directly):

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?place ?placeLabel ?party ?partyLabel ?votes WHERE {
  # result item representing party performance in a place for the election
  ?result wdt:P31 wd:Q19571328 .        # instance of electoral result
  ?result wdt:P1344 wd:Q30594119 .      # participant in the 2020 Basque election
  ?result wdt:P1001 ?place .            # applies to jurisdiction (the place)
  ?result wdt:P527 ?party .             # has part / lists the party (this predicate may differ)
  ?result wdt:P1111 ?votes .            # votes received
  OPTIONAL { ?place rdfs:label ?placeLabel FILTER(LANG(?placeLabel) = "en") }
  OPTIONAL { ?party rdfs:label ?partyLabel FILTER(LANG(?partyLabel) = "en") }
  FILTER(?party IN (wd:Q85843184, wd:Q15630787))
}
ORDER BY ?place ?party

Note: the above query is a best-effort template. The specific predicates linking a result item to a party (I used wdt:P527 as a guess) and the usage of 'electoral result' items may differ in Wikidata. When I attempted to discover actual items and statement patterns for the 2020 Basque election I could not find any matching items/statements. Therefore I cannot reliably return the requested grouped per-jurisdiction vote counts from Wikidata.

If you want, I can:
- Try a broader search again (e.g., probe Spanish labels, or search Wikipedia tables and attempt to crosswalk them to Wikidata items), or
- Provide the constituency-level (Álava, Bizkaia, Gipuzkoa) overall vote totals for PP+Cs and Vox if those are present in Wikidata (I can attempt a dedicated search for constituency-level totals), or
- Fetch the official vote counts from an external source (e.g., Spanish electoral authority or Wikipedia pages) and present them here (note: that would be outside Wikidata and not returned via a SPARQL query).

I could not find a satisfactory SPARQL query that returns per-jurisdiction vote counts for the PP+Cs and Vox parties in the 2020 Basque regional election. I searched and inspected Wikidata for the standard modeling patterns used for election results (items of type 'electoral result' (wd:Q19571328), statements using votes received (P1111), 'applies to jurisdiction' (P1001), 'participant in' (P1344), and search patterns that attach votes as qualifiers to participant statements). Concretely, I performed these steps:

1) Located the election item: 2020 Basque regional election (wd:Q30594119).
2) Located party items: PP+Cs (wd:Q85843184) and Vox (wd:Q15630787).
3) Looked for usage of votes received (wdt:P1111) across Wikidata and attempted to filter for items related to the Basque election, but queries matching labels (English/Spanish) returned no usable result items.
4) Examined the PP+Cs item: it has a direct 'participant in' (P1344) statement for the 2020 Basque election, but that statement had no qualifiers (no votes or per-jurisdiction qualifiers).
5) Examined the election item for child/result items (P527, P361), p:P1344 statements, or p:P1111 qualifiers — found no result statements with qualifiers linking votes to jurisdictions.
6) Probed municipality items (e.g., Vitoria-Gasteiz wd:Q14318, Bilbao wd:Q28462) for p:P1111 and found none.

Because none of these searches turned up items/statements in Wikidata following common modeling patterns (e.g., "electoral result" items with properties for election, jurisdiction, party, and votes), I couldn't construct a reliable, executable SPARQL query that returns the requested per-jurisdiction vote counts.

It's possible that: (a) Wikidata does not contain municipality- or constituency-level vote counts for this particular election; (b) the data exists but is stored in a different, nonstandard schema or labeled only in non-English labels making automated discovery hard; or (c) results are kept on Wikisource/Wikipedia tables only and not imported into Wikidata.

Best attempt SPARQL query (would return results if per-jurisdiction results are modeled as items of type electoral result and link election, jurisdiction and party directly):

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?place ?placeLabel ?party ?partyLabel ?votes WHERE {
  # result item representing party performance in a place for the election
  ?result wdt:P31 wd:Q19571328 .        # instance of electoral result
  ?result wdt:P1344 wd:Q30594119 .      # participant in the 2020 Basque election
  ?result wdt:P1001 ?place .            # applies to jurisdiction (the place)
  ?result wdt:P527 ?party .             # has part / lists the party (this predicate may differ)
  ?result wdt:P1111 ?votes .            # votes received
  OPTIONAL { ?place rdfs:label ?placeLabel FILTER(LANG(?placeLabel) = "en") }
  OPTIONAL { ?party rdfs:label ?partyLabel FILTER(LANG(?partyLabel) = "en") }
  FILTER(?party IN (wd:Q85843184, wd:Q15630787))
}
ORDER BY ?place ?party

Note: the above query is a best-effort template. The specific predicates linking a result item to a party (I used wdt:P527 as a guess) and the usage of 'electoral result' items may differ in Wikidata. When I attempted to discover actual items and statement patterns for the 2020 Basque election I could not find any matching items/statements. Therefore I cannot reliably return the requested grouped per-jurisdiction vote counts from Wikidata.

If you want, I can:
- Try a broader search again (e.g., probe Spanish labels, or search Wikipedia tables and attempt to crosswalk them to Wikidata items), or
- Provide the constituency-level (Álava, Bizkaia, Gipuzkoa) overall vote totals for PP+Cs and Vox if those are present in Wikidata (I can attempt a dedicated search for constituency-level totals), or
- Fetch the official vote counts from an external source (e.g., Spanish electoral authority or Wikipedia pages) and present them here (note: that would be outside Wikidata and not returned via a SPARQL query).

SPARQL query over wikidata:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?place ?placeLabel ?party ?partyLabel ?votes WHERE {
  ?result wdt:P31 wd:Q19571328 .
  ?result wdt:P1344 wd:Q30594119 .
  ?result wdt:P1001 ?place .
  ?result wdt:P527 ?party .
  ?result wdt:P1111 ?votes .
  OPTIONAL {
    ?place rdfs:label ?placeLabel FILTER ( LANG( ?placeLabel ) = "en" )
  }
  OPTIONAL {
    ?party rdfs:label ?partyLabel FILTER ( LANG( ?partyLabel ) = "en" )
  }
  FILTER ( ?party IN ( wd:Q85843184 , wd:Q15630787 ) )
}
ORDER BY ?place ?party

Using entities:
- Vox (wd:Q15630787): is instance of political party in Spain / Spanish political party
- electoral result (wd:Q19571328), also known as election outcome, election results, electoral outcome: is subclass of result / results of an election
- 2020 Basque regional election (wd:Q30594119): is instance of Parliament elections in the Basque Country / is instance of event affected by the COVID-19 pandemic / election
- PP+Cs (wd:Q85843184): is instance of electoral alliance / is instance of Electoral alliance / electoral alliance

Using properties:
- applies to jurisdiction (wd:P1001 as wdt), also known as applicable area, applicable country, applicable geographic place, applicable jurisdiction, applicable location, etc.: is subproperty of characteristic of / is subproperty of operating area / is subproperty of significant place / the item (an institution, law, public office ...) or ... jurisdiction: a country, state, municipality, ...) / the item (institution, law, public office, public ... jurisdiction: a country, state, municipality, ...)
- votes received (wd:P1111 as wdt), also known as popular vote, P1111: qualifier stating the number of votes for a candidate in an election / qualifier stating the number of votes for a candidate in an election
- participant in (wd:P1344 as wdt), also known as attended, competed in, competes in, participant of, participant of event, etc.: is subproperty of part of / is subproperty of significant event / event in which a person or organisation was/is a participant; inverse of P710 or P1923 / event in which a person or organization was/is a participant; inverse of P710 or P1923
- instance of (wd:P31 as wdt), also known as example of, has type, is a, is an, is of type, etc.: that class of which this subject is a particular example and ... a subclass of mountain (and an instance of volcanic landform) / type to which this subject corresponds/belongs. Different ... and the volcano is a type (instance) of volcanic landform
- has part(s) (wd:P527 as wdt), also known as amalgamation of, assembled from, assembled out of, composed of, comprised of, etc.: part of this subject, also valuable subclass or exemplar. Inverse property of "part of". / part of this subject; inverse property of "part of" (P361). See also "has parts of the class" (P2670). / part of this subject; inverse property of "part of" (P361). See also "has parts of the class" (P2670).

Execution result:
Got no rows and 5 columns

[System]
You are a question answering assistant. Your job is to generate a SPARQL query to answer a given user question.

You should follow a step-by-step approach to generate the SPARQL query:
1. Determine possible entities and properties implied by the user question.
2. Search for the entities and properties in the knowledge graphs. Where applicable, constrain the searches with already identified entities and properties.
3. Gradually build up the SPARQL query using the identified entities and properties. Start with simple queries and add more complexity as needed. Execute intermediate queries to get feedback and to verify your assumptions. You may need to refine or rethink your current plan based on the query results and go back to step 2 if needed, possibly multiple times.
4. Use the answer or cancel function to finalize your answer and stop the generation process.

Available knowledge graphs:
- wikidata at http://localhost:7001 with prefix index for entities and similarity index for properties, and notes:
  - P106 = occupation. Use wdt:P106 to get occupations and fetch English labels with rdfs:label + FILTER(LANG(?label)="en"). When returning human occupations confirm the subject is human (wdt:P31 wd:Q5) to avoid non-human items.
  - Population (P1082) and tabular (P4179): use wdt:P1082 for quick/direct values; for time-series/point-in-time use p:P1082 + ps:P1082 + pq:P585 and ORDER BY pq:P585 DESC. Inspect statement qualifiers (e.g., 'applies to part') and prov:wasDerivedFrom references (pr:P854 etc.) to detect city-proper vs metro/prefecture scopes before using values.
  - Common person properties: P31 (instance of human Q5), P106 (occupation), P569 (date of birth), P19 (place of birth), P27 (country of citizenship), P21 (sex/gender), P166 (award received). Use wdt: for direct values when possible.
  - P17 (country) can be incomplete/misleading for places (historical/overseas tags). To get modern cities in a country combine: instance-of city (P31=Q515) + wdt:P17 OR use wdt:P131* to find an admin parent whose wdt:P17 = the country. Also cross-check coordinates (P625) or admin hierarchy to spot outliers.
  - When filtering by date of birth (P569) use xsd:dateTime comparisons (e.g. >= "1900-01-01T00:00:00Z"^^xsd:dateTime). Be aware many items have year-only or imprecise dates and coverage is biased toward notable/public figures (sportspeople, politicians, artists).
  - To retrieve qualifiers (e.g., award year) use the statement/qualifier pattern: p:Pxxx / ps:Pxxx / pq:P585. Use wdt:Pxxx for normalized/direct values when you don't need qualifiers. Example: p:P166 + pq:P585 gives award year.
  - To get a person's occupations: use wdt:P106 for direct/normalized values and rdfs:label for human-readable names (FILTER(LANG(...))). Example: wd:Q... wdt:P106 ?occ . ?occ rdfs:label ?occLabel . FILTER(LANG(?occLabel)="en").
  - P166 = award received. Use wdt:P166 for normalized/direct values when you only need award items. To get award years or qualifiers use p:P166 / ps:P166 / pq:P585. Many statements lack pq:P585 — use OPTIONAL { ?stmt pq:P585 ?date } and ORDER BY DESC(?date). When listing award winners, filter ?person wdt:P31 wd:Q5 to ensure humans.
  - Population time-series pattern: wd:Q... p:P1082 ?stmt . ?stmt ps:P1082 ?pop . OPTIONAL { ?stmt pq:P585 ?date } . ORDER BY DESC(?date). pq:P585 is the point-in-time qualifier. IMPORTANT: time-series may mix scopes (city proper vs metro) — e.g., Tokyo has a 2016 entry ~38,140,000 likely metro vs smaller city figures. Inspect qualifiers/references for scope before use.
  - Use wdt:P131* to traverse the admin hierarchy and compare wdt:P17 on the place vs an admin parent to detect historical/colonial country assignments. When mismatches appear, inspect the admin parent's instance-of (P31), labels, qualifiers and references to interpret the historical scope.
  - wdt:P106 often yields multiple occupations for a person. Use GROUP_CONCAT(DISTINCT ?occLabel; separator=", ") or return multiple rows. Always fetch labels with rdfs:label + FILTER(LANG(?label)="en") to get readable occupation names.
  - When a search_entity returns multiple hits (person vs sculpture vs memorial), confirm you selected the human/statements by checking wdt:P31 (instance of) and relevant wdt: properties (e.g., wdt:P106). This avoids using a non-human QID by mistake.
  - search_autocomplete can be constrained with a SPARQL pattern containing ?search (e.g., SELECT * WHERE { ?search wdt:P31 wd:Q5 }). Use constraints to focus results (e.g., humans) and avoid ambiguous fallbacks; if it returns no results, fallback to search_entity and verify wdt:P31.
  - Use search_property_of_entity to find relevant properties for an entity (e.g., 'award' -> P166) and search_object_of_property to discover candidate objects (e.g., 'physicist' for P106). This reduces guessing P/Q ids and surfaces qualifiers.
  - Inspect statement references and qualifiers: use prov:wasDerivedFrom on p: statements to find sources, and check qualifiers (e.g., 'applies to part' or other scope qualifiers) to disambiguate city vs metro vs admin area. Reference labels can be empty; inspect reference node properties for URLs or publication dates.

Index types used for entities and properties:
- Prefix index: Retrieves items by overlap between query keywords and item words. The query keywords can match item words exactly or as prefixes.
- Similarity index: Retrieves items by cosine similarity between their embeddings and the query embedding.

General notes across knowledge graphs:
- Use rdfs:label + FILTER(LANG(?label)="en") for labels; avoid SERVICE wikibase:label. Use wdt:Pxxx for normalized/direct values when qualifiers aren't needed. Use p:Pxxx / ps:Pxxx / pq:Pxxx to access statement qualifiers (e.g., award year via pq:P585). When dates matter, prefer xsd:dateTime and watch for year-only precision.
- Practical query patterns: use rdfs:label + FILTER(LANG(...)) for labels. Use wdt:Pxxx for direct/normalized values when qualifiers aren't needed. Use p:Pxxx / ps:Pxxx / pq:Pxxx to access qualifiers (dates via pq:P585). For dates use xsd:dateTime and expect year-only precision. For places: combine P17 with P131 or coordinate (P625) filters to avoid historical/overseas mismatches.
- Use OPTIONAL for pq: qualifiers (e.g., pq:P585), sort by qualifier (ORDER BY pq:P585 DESC) to prefer recent values. Use GROUP_CONCAT to combine multiple labels/values in one row. Watch for typed literals (xsd:dateTime, xsd:decimal) when filtering or sorting.
- Before querying, use search_entity to resolve human-friendly names to wd:Q identifiers and verify instance-of (e.g., check wdt:P31 = wd:Q5 for humans) to avoid ambiguous matches. Prefer the top match but programmatically confirm P31 before using its data.
- Use search_property to confirm property identifiers (e.g., "country" -> P17) before embedding them in queries. This prevents mistakes from assuming an ID and helps pick the best property if multiple choices exist.
- search_autocomplete can fall back to an unconstrained search or error when there are too many candidates. If this happens (e.g., "more than the maximum supported number of subject candidates"), retry with narrower constraints such as instance-of (wdt:P31), additional type filters, or short prefixes to reduce the candidate set; otherwise fallback to search_entity and verify wdt:P31.
- Use list(...) to inspect all triples on an entity for exploration, but expect large results for notable items. Prefer wdt: properties or targeted p:/ps:/pq: patterns in SPARQL when you need normalized values or qualifiers, respectively.
- Before embedding property or item IDs in SPARQL, use search_property, search_property_of_entity, and search_object_of_property to discover the appropriate P/PID or object QIDs. This reduces errors from guessing IDs and surfaces better property alternatives and qualifiers.
- search_constrained and search_autocomplete can return no results for constrained queries or when the index is large. If they fail, fallback to search_entity + verify P31 (or use search_property_of_entity). Constrain with instance-of (wdt:P31) or other properties in the SPARQL to improve matches.
- When selecting awards by year, prefer xsd:dateTime range filters (e.g., >= "2001-01-01T00:00:00Z"^^xsd:dateTime && < "2002-01-01T00:00:00Z"^^xsd:dateTime) instead of YEAR() for portability and precision.
- When selecting award winners via wdt:P166, filter ?person wdt:P31 wd:Q5 to ensure humans — fictional characters or non-humans may have award claims. If you need award years use p:P166 / ps:P166 / pq:P585 and OPTIONAL { ?stmt pq:P585 ?year } to retrieve qualifier years.
- Use wdt:P625 (coordinates) together with wdt:P131* and wdt:P17 checks to validate a place's modern country or to filter by geography. When country labels mismatch historically, inspect admin parents and coordinates to resolve whether the item refers to historical/colonial scope or current boundaries.
- Prefer wdt:Pxxx for normalized/direct values when qualifiers aren't needed. Use p:Pxxx / ps:Pxxx / pq:Pxxx to access qualifiers (e.g., pq:P585 for award year). Always fetch labels with rdfs:label + FILTER(LANG(?label) = "en").
- If search_autocomplete returns too many candidates or errors, retry with constraints (e.g., SELECT * WHERE { ?search wdt:P31 wd:Q5 }) or narrower query text. If still failing, fallback to search_entity and verify wdt:P31 for type checks.
- For award-year queries use p:P166 / ps:P166 / pq:P585 to access award statements and year qualifiers. Filter by xsd:dateTime ranges (e.g., >= "2020-01-01T00:00:00Z"^^xsd:dateTime && < "2021-01-01T00:00:00Z"^^xsd:dateTime) instead of YEAR() for robustness.
- Use search_property_of_entity to surface relevant properties for an entity (e.g., 'birth' -> P569/P19). list(...) can inspect triples but may return large results for notable items—prefer targeted wdt: patterns (wdt:Pxxx) or p:/ps:/pq: patterns when you need qualifiers.

SPARQL prefixes for use in function calls:
- bd: <http://www.bigdata.com/rdf#
- cc: <http://creativecommons.org/ns#
- data: <https://www.wikidata.org/wiki/Special:EntityData/
- dc: <http://purl.org/dc/elements/1.1/
- dct: <http://purl.org/dc/terms/
- foaf: <http://xmlns.com/foaf/0.1/
- geo: <http://www.opengis.net/ont/geosparql#
- geof: <http://www.opengis.net/def/function/geosparql/
- gn: <http://www.geonames.org/ontology#
- hint: <http://www.bigdata.com/queryHints#
- imdb: <https://www.imdb.com/
- math: <http://www.w3.org/2005/xpath-functions/math#
- ontolex: <http://www.w3.org/ns/lemon/ontolex#
- owl: <http://www.w3.org/2002/07/owl#
- p: <http://www.wikidata.org/prop/
- pq: <http://www.wikidata.org/prop/qualifier/
- pqn: <http://www.wikidata.org/prop/qualifier/value-normalized/
- pqv: <http://www.wikidata.org/prop/qualifier/value/
- pr: <http://www.wikidata.org/prop/reference/
- prn: <http://www.wikidata.org/prop/reference/value-normalized/
- prov: <http://www.w3.org/ns/prov#
- prv: <http://www.wikidata.org/prop/reference/value/
- ps: <http://www.wikidata.org/prop/statement/
- psn: <http://www.wikidata.org/prop/statement/value-normalized/
- psv: <http://www.wikidata.org/prop/statement/value/
- qb: <http://purl.org/linked-data/cube#
- qfn: <http://qlever.cs.uni-freiburg.de/function#
- ql: <http://qlever.cs.uni-freiburg.de/builtin-functions/
- qlss: <https://qlever.cs.uni-freiburg.de/spatialSearch/
- rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#
- rdfs: <http://www.w3.org/2000/01/rdf-schema#
- ref: <http://www.wikidata.org/reference/
- s: <http://www.wikidata.org/entity/statement/
- schema: <http://schema.org/
- skos: <http://www.w3.org/2004/02/skos/core#
- v: <http://www.wikidata.org/value/
- void: <http://rdfs.org/ns/void#
- wd: <http://www.wikidata.org/entity/
- wdno: <http://www.wikidata.org/prop/novalue/
- wdt: <http://www.wikidata.org/prop/direct/
- wdtn: <http://www.wikidata.org/prop/direct-normalized/
- wikibase: <http://wikiba.se/ontology#
- xsd: <http://www.w3.org/2001/XMLSchema#

Additional rules to follow:
- Explain your thought process before and after each step and function call.
- Do not just use or make up entity or property identifiers without verifying their existence in the knowledge graphs first.
- Do not ask the user for clarifications without first attempting to complete the task. If the task input is incomplete or ambiguous, try to make reasonable assumptions and document them.
- Do not use "SERVICE wikibase:label { bd:serviceParam wikibase:language ..." in SPARQL queries. It is not SPARQL standard and unsupported by the used QLever SPARQL endpoints. Use rdfs:label or similar properties to get labels instead.
- Always execute your final SPARQL query before giving an answer to make sure it returns the expected results.
- The SPARQL query should always return the actual identifiers / IRIs of the items in its result. It additionally may return labels or other human-readable information, but they are optional and should be put within optional clauses unless explicitly requested by the user.
- Do not stop early if there are still obvious improvements to be made to the SPARQL query. For example, keep refining your SPARQL query if its result contains irrelevant items or is missing items you expected.
- Do not perform additional computation (e.g. filtering, sorting, calculations) on the result of the SPARQL query to determine the answer. All computation should be done solely within SPARQL.
- For questions with a "True" or "False" answer the SPARQL query should be an ASK query.

[User] How many votes did the "PP+Cs" and "Vox" parties receive in each jurisdiction during the 2020 Basque regional election, grouped by each place and party?

[Assistant]
I'll search for the Wikidata item for the 2020 Basque regional election and for the party items "PP+Cs" (the PP + Ciudadanos coalition) and "Vox". I'll also search for properties used to record election results and vote counts. I'll run targeted searches and explain what I'm doing before each call.

Question: 2020 Basque regional election

Top 10 entity alternatives:
1. 2020 Basque regional election (wd:Q30594119): is instance of Parliament elections in the Basque Country / is instance of event affected by the COVID-19 pandemic / election
2. 2016 Basque regional election (wd:Q17082033): is instance of Parliament elections in the Basque Country / election
3. 2024 Basque regional election (wd:Q97147183): is instance of Parliament elections in the Basque Country
4. 2001 Basque regional election (wd:Q10990655), also known as Basque parliamentary election, 2001: is instance of Parliament elections in the Basque Country
5. 2009 Basque regional election (wd:Q3181322): is instance of Parliament elections in the Basque Country
6. 2005 Basque regional election (wd:Q2843695), also known as Basque parliamentary election, 2005: is instance of Parliament elections in the Basque Country
7. 2020 Galician regional election (wd:Q30645425): electoral event of the 11th legislature of the Galician Parliament / is instance of event affected by the COVID-19 pandemic / is instance of Elections to Galician parliament / is instance of public election / is instance of election / is instance of Election
8. 1998 Basque regional election (wd:Q5669472), also known as Basque parliamentary election, 1998: is instance of Parliament elections in the Basque Country
9. 1990 Basque regional election (wd:Q3751723): is instance of Parliament elections in the Basque Country
10. 1980 Basque regional election (wd:Q3751745): is instance of Parliament elections in the Basque Country

[Assistant]
Now I'll search for the party items "Vox" and for the PP+Cs coalition (names like "PP+Cs", "PP–Cs", "Partido Popular and Ciudadanos coalition"). I'll search for "Vox (Spain)" and "PP+Cs" and "Partido Popular Ciudadanos coalition 2020 Basque".

Question: Vox (Spain)

Top 10 entity alternatives:
1. Vox Populi: Spain 2023 (wd:Q122823207): is instance of video game / 2023 video game
2. Spain (wd:Q29), also known as Kingdom of Spain: country in southwestern Europe with territories in Africa / constitutional monarchy in Southwest Europe / constitutional monarchy in Southwest Europe / is instance of Mediterranean country / is instance of sovereign state / is instance of country / is instance of realm
3. Barcelona (wd:Q1492, matched via Barcelona, Spain), also known as Barcelona, Catalonia, Barcelona, Spain, BCN, B'na: capital of Catalonia and second largest city in Spain / is instance of municipality of Catalonia / city in Catalonia, Spain / is instance of city
4. Seville (wd:Q8717, matched via Seville, Spain), also known as Ishbiliya, Ixbiliya, Sevilla, Seville, Spain: city in the province of Seville, Spain / city in the province of Seville, Spain / is instance of municipality of Spain / municipality of Andalusia, Spain
5. Galicia (wd:Q3908, matched via Galicia (Spain)), also known as Galicia (Spain), Galiza: is instance of autonomous community of Spain / autonomous community of Spain
6. Toledo (wd:Q5836, matched via Toledo, Spain), also known as Municipality of Toledo, Toledo, Castile-La Mancha, Toledo municipality, Toledo Municipality, Toledo, Spain: is instance of municipality of Spain / municipality in central Spain / municipality in central Spain / municipality in central Spain / is instance of city
7. Pontevedra (wd:Q12411, matched via Pontevedra, Spain), also known as capital of the Rias Baixas, Pontevedra, Spain: city and municipality in north-west Spain capital of Pontevedra province and the Rias Baixas / is instance of municipality of Galicia / is instance of carfree city / city in Galicia, Spain / city in Galicia, Spain
8. Vitoria-Gasteiz (wd:Q14318, matched via Vitoria-Gasteiz Spain), also known as Vitoria Gasteiz, Vitoria Gasteiz Spain, Vitoria-Gasteiz Spain, Vittoria: municipality of Álava, autonomous community of the Basque Country, Spain / is instance of municipality of Spain
9. Cádiz (wd:Q15682, matched via Cadiz, Spain), also known as Cadiz, Cadiz, Spain: municipality and capital city of the province of Cádiz, Spain / is instance of municipality of Spain / city in Andalusia, Spain / city in Andalusia, Spain
10. Santander (wd:Q12233, matched via Santander, Spain), also known as Santander, Spain: capital of the autonomous community of Cantabria, Spain / capital of the autonomous community of Cantabria, Spain / capital of the autonomous community of Cantabria, Spain / is instance of municipality of Cantabria

[Assistant]
I'll try a more specific search term "Vox (political party)" to get the Wikidata item for the Spanish party Vox.

Question: Vox (political party)

Top 10 entity alternatives:
1. political party (wd:Q7278), also known as parties in politics, parties (politics), party in politics, party (politics), political parties: organization that seeks to influence government policy and ... be elected to directly take part on government or legislation / organisation that seeks to influence government policy and actions / is subclass of political organisation / is subclass of political organization / is subclass of juridical person / is instance of legal concept / is instance of legal form
2. Liberal Democratic Party of Russia (wd:Q212115, matched via Political party LDPR), also known as LDPR, Political party LDPR: far-right nationalist political party in Russia / is instance of political party
3. parliamentary group (wd:Q848197, matched via political party bloc), also known as caucus, parliamentary bloc, parliamentary block, parliamentary caucus, parliamentary faction, etc.: grouping of members of a parliament by their partisan affiliation / is subclass of political organisation / is subclass of political organization / is subclass of legislative caucus / is instance of group of humans
4. European political party (wd:Q24649), also known as Europarty, political party at European level: transnational political party operating at the level of the European Union / is subclass of European political alliance / is subclass of meta-organisation / is subclass of metaorganization / is subclass of political party / is instance of legal form
5. Reformed Political Party (wd:Q60172), also known as SGP, Staatkundig Gereformeerde Partij: is instance of political party / Dutch political party
6. party conference (wd:Q2288051, matched via political party assembly), also known as convention in politics, convention (politics), national party conference, party congress, political convention, etc.: general meeting of a political party / is subclass of political conference / is subclass of convention / is subclass of congress
7. Liberal Party (wd:Q722796, matched via Hungary political party), also known as Hungary political party: is instance of political party / political party
8. Victory (political party) (wd:Q118559247), also known as Democratic Patriotic Movement "Niki": is instance of political party / political party in Greece
9. party newspaper (wd:Q442927, matched via political party magazine), also known as party magazine, political party magazine, political party newspaper: newspaper of a political party or organization or editorially supportive of that party / is instance of newspaper genre / is subclass of mouthpiece / is subclass of newspaper / is subclass of magazine
10. Spartans (political party) (wd:Q119458066): is instance of political party / political party in Greece

[Assistant]
Now I'll search for the entity using a constrained search at the subject position to find the party item for Vox. I will constrain to items that are instance of political party (wd:Q7278) to improve matching.

Question: Vox

Top 10 entity alternatives:
1. Vox (wd:Q15630787): is instance of political party in Spain / Spanish political party
2. Vox (wd:Q20877087), also known as Project X, Vox.com: is instance of online newspaper / American news website
3. VOX (wd:Q684981): is instance of generalist television channel / is instance of television station / German television channel / German television channel / German television channel
4. Vox (wd:Q1122899): is instance of musical instrument manufacturing company / British brand of musical equipment / British brand of musical equipment / British brand of musical equipment / is instance of brand
5. Vox (wd:Q2139194), also known as Project Comet: is instance of service on Internet / former Internet blogging service
6. VOX (wd:Q7907393): is instance of television station / Norwegian television channel / Norwegian television channel / Norwegian television channel
7. Vox (wd:Q3563294): children's fantasy novel by Paul Stewart and Chris Riddell / is instance of written work
8. Dialogic ADPCM (wd:Q2109446, matched via .vox), also known as Dialogic 4-bit ADPCM file, Dialogic VOX ADPCM, .vox, VOX: is instance of audio file format / file format
9. Vox (wd:Q7942329): is instance of magazine / Dutch magazine
10. Vox (wd:Q110164402): is instance of magazine

No other items found

[Assistant]
I'll search for coalition names: "PP+Cs", "PP–Cs", "Partido Popular Ciudadanos coalition", and possibly the Spanish "PP+Cs (País Vasco)" to find the coalition item. I'll start with "PP+Cs".

Question: PP+Cs

Top 10 entity alternatives:
1. PP+Cs (wd:Q85843184): is instance of electoral alliance / is instance of Electoral alliance / electoral alliance

[Assistant]
I'll search for the property used for "number of votes" in election results (commonly P1117) and for properties that link election results to places (e.g., electoral district, electoral district results). I'll search for "number of votes" property.

Question: number of votes

Top 10 property alternatives:
1. ballots cast (wd:P1868 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via total votes), also known as total vote count, total votes, turnout, P1868: total number of ballot(s) cast, including invalid or blank ballots / total number of ballot(s) cast, including invalid or blank ballots
2. eligible voters (wd:P1867 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via total voters), also known as registered voters, total voters, voters eligible, P1867: number of eligible voters for a particular election
3. number of support votes (wd:P8683 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as support votes, Yes votes, P8683: number of votes that a referendum, proposal, bill, etc. has ... but there is no explicit option to vote for / against
4. total valid votes (wd:P1697 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as formal votes, valid votes, P1697: vote count for the elections (excluding invalid votes) / vote count for the elections (excluding invalid votes)
5. votes received (wd:P1111 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via popular vote), also known as popular vote, P1111: qualifier stating the number of votes for a candidate in an election / qualifier stating the number of votes for a candidate in an election
6. number of negative votes (wd:P8682 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via No votes), also known as negative votes, No votes, P8682: number of votes that a referendum, proposal, bill, etc. has been rejected in a vote
7. number of blank votes (wd:P5045 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as blank votes, P5045: number of blank votes in a voting round for a specific position in a election
8. voting system (wd:P8196 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as electoral system, type of election, P8196: system used for this election or vote / system used for this election or vote
9. number of spoilt votes (wd:P5044 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as informal votes, invalid votes, rejected ballots, spoilt votes, P5044: number of spoilt votes in a voting round for a specfic position in a election (excluding blank votes; use P5045 instead) / number of spoilt votes in a voting round for a specfic position in a election
10. number of participants (wd:P1132 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via participant count), also known as number of competitors, number of teams, participant count, participants, qty participants, etc.: number of participants of an event, e.g. people or groups of people that take part in the event (NO units) / is subproperty of quantity

[Assistant]
I'll search for properties like "electoral district", "electoral alliance", "candidate in election", and patterns used to model election results (e.g., statements on the election item or on candidate items).

Question: electoral district

Top 10 property alternatives:
1. electoral district (wd:P768 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as constituency, electoral area, electorate, riding, seat, etc.: electoral district this person is representing, or of the ... "office contested" (P541) or "candidacy in election" (P3602) / electoral district this person is representing. Use as qualifier for "position held" (P39)
2. electoral district number (wd:P4565 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as district number, P4565: number of the constituency/electoral district established by ... lack legal force, even if contained in a government database.
3. associated electoral district (wd:P7938 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via electoral district associated with place), also known as associated constituency, constituency associated with place, electoral district associated with place, located in electoral district, located in the constituency, etc.: constituencies/electoral districts in which a place is ... from administrative entities (P131) in predefined countries
4. registration district (wd:P5564 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via civil registration district), also known as civil registration district, ecclesiastical registration district, P5564: reference property indicating location for references to a civil or ecclesiastical registry
5. electorate (wd:P1831 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as P1831: number of persons qualified to vote during elections
6. elected in (wd:P2715 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via election), also known as election, re-elected in, P2715: qualifier for statements in position held to link the ... from, or re-election in which the position was confirmed / election in which a person gained a position (as qualifier), or a position or legislative term is/was elected (as main value)
7. political coalition (wd:P5832 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via electoral list), also known as alliance, coalition, electoral alliance, electoral block, electoral list, etc.: agreement for cooperation between different political parties / is subproperty of member of
8. elector (wd:P2319 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as eligible voters, qualified voters, type of electors, P2319: people or other entities which are qualified to participate in the subject election
9. candidacy in election (wd:P3602 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via election candidacy), also known as candidate in, candidate in election, election candidacy, ran in election, running in election, etc.: election where the subject is a candidate / election where the subject is a candidate / is subproperty of participant in
10. voting system (wd:P8196 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via electoral system), also known as electoral system, type of election, P8196: system used for this election or vote / system used for this election or vote

[Assistant]
I'll list triples for the election item wd:Q30594119 to find how results are modeled (look for statements about results, participants, or result items). This helps locate where votes per place and per party are recorded.

list

wd:Q30594119

Got 134 rows and 3 columns, showing the first 10 rows below:
| subject                                      | property                               | object                                                                                |
| -------------------------------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------- |
| 2020 Basque regional election (wd:Q30594119) | instance of (wdt:P31)                  | Parliament elections in the Basque Country (wd:Q47069668)                                       |
| 2020 Basque regional election (wd:Q30594119) | country (wdt:P17)                      | Spain (wd:Q29)                                                                                |
| 2020 Basque regional election (wd:Q30594119) | Google Knowledge Graph ID (wdtn:P2671) | <http://g.co/kg/g/11dxdyd738>                                                                   |
| 2020 Basque regional election (wd:Q30594119) | Commons category (wdt:P373)            | Basque Autonomous Community parliamentary election, 2020                                        |
| 2020 Basque regional election (wd:Q30594119) | official website (wdt:P856)            | <https://www.euskadi.eus/elecciones-parlamento-vasco-2020-inicio/web01-a3haup20/es/>            |
| 2020 Basque regional election (wd:Q30594119) | follows (wdt:P155)                     | 2016 Basque regional election (wd:Q17082033)                                                    |
| 2020 Basque regional election (wd:Q30594119) | followed by (wdt:P156)                 | 2024 Basque regional election (wd:Q97147183)                                                    |
| 2020 Basque regional election (wd:Q30594119) | applies to jurisdiction (wdt:P1001)    | Basque Autonomous Community (wd:Q3995)                                                          |
| 2020 Basque regional election (wd:Q30594119) | point in time (wdt:P585)               | 2020-07-12T00:00:00Z (xsd:dateTime)                                                             |
| 2020 Basque regional election (wd:Q30594119) | locator map image (wdt:P242)           | <http://commons.wikimedia.org/wiki/Special:FilePath/BasqueCountryProvinceMapParliament2020.png> |
| ...                                          | ...                                    | ...                                                                                |

[Assistant]
I'll search for an entity representing "electoral result" or similar classes to see how election result items are modeled.

Question: electoral result

Top 10 entity alternatives:
1. electoral result (wd:Q19571328), also known as election outcome, election results, electoral outcome: results of an election / is subclass of result
2. list of electoral results (wd:Q99228802), also known as list of election results: subclass of articles which gather the history of election results for a territory / is subclass of Wikimedia list article
3. Electoral results for Murrumbidgee electorate (wd:Q120998396): is instance of electoral result
4. Electoral results for Kurrajong electorate (wd:Q120998395): is instance of electoral result
5. Electoral results for Brindabella electorate (wd:Q120998405): is instance of electoral result
6. Electoral results for Yerrabi electorate (wd:Q120998397): is instance of electoral result
7. Electoral results for Ginninderra electorate (wd:Q120998406): is instance of electoral result
8. Electoral results for Molonglo electorate (wd:Q121143292): is instance of electoral result
9. representative democracy (wd:Q188759, matched via electoral democracy), also known as electoral democracy, indirect democracy, representation, representative governance, representative government, etc.: democracy where citizens elect a small set of people to represent them in decision making / is instance of form of government / is instance of type of democracy / is subclass of democracy / is subclass of Democracy
10. goal (wd:Q4503831, matched via desired result), also known as aim, desired result, goals, objective, purpose: idea of the future or result that a person or group wants to achieve / is subclass of condition

[Assistant]
I'll run a SPARQL query to find items that are instances of "electoral result" and are part of the 2020 Basque regional election (wd:Q30594119). This should reveal result items (e.g., results by constituency or municipality) where vote counts are stored. I'll request labels in English.

execute

SELECT ?result ?resultLabel ?instanceLabel WHERE {
  ?result wdt:P31 wd:Q19571328 .
  ?result wdt:P361 wd:Q30594119 .
  ?result rdfs:label ?resultLabel . FILTER(LANG(?resultLabel) = "en")
  ?result wdt:P31 ?instance . ?instance rdfs:label ?instanceLabel . FILTER(LANG(?instanceLabel) = "en")
} LIMIT 200

[Assistant]
I'll search for items that are instances of 'electoral result' whose English label contains the word 'Basque' to find result items related to this election.

SELECT ?result ?resultLabel WHERE {
  ?result wdt:P31 wd:Q19571328 .
  ?result rdfs:label ?resultLabel .
  FILTER(LANG(?resultLabel) = "en")
  FILTER(CONTAINS(LCASE(?resultLabel), "basque"))
} LIMIT 200

[Assistant]
I'll list triples using the direct property wdt:P1111 (votes received) to inspect how it's used and find candidate patterns linked to election events and places. This will help identify how votes per jurisdiction are represented.

list

Got 53,303 rows and 3 columns, showing the first 10 rows below:
| subject                                                            | property                   | object                |
| ------------------------------------------------------------------ | -------------------------- | --------------------- |
| United Nations General Assembly Resolution 2758 (wd:Q1334327)      | votes received (wdt:P1111) | 17 (xsd:decimal)      |
| United Nations General Assembly Resolution ES-11/1 (wd:Q111060761) | votes received (wdt:P1111) | 141 (xsd:decimal)     |
| 2022 Mato Grosso do Sul gubernatorial election (wd:Q113353028)     | votes received (wdt:P1111) | 808210 (xsd:decimal)  |
| Plebiscite of Venetian Provinces and Mantua of 1866 (wd:Q20008405) | votes received (wdt:P1111) | 69 (xsd:decimal)      |
| 1998 Greater London Authority referendum (wd:Q723138)              | votes received (wdt:P1111) | 1735350 (xsd:decimal) |
| New Caledonian independence referendum, 1987 (wd:Q7006306)         | votes received (wdt:P1111) | 842 (xsd:decimal)     |
| 2023 Wellingborough recall petition (wd:Q123185971)                | votes received (wdt:P1111) | 10505 (xsd:decimal)   |
| 2019 Brecon and Radnorshire recall petition (wd:Q121097710)        | votes received (wdt:P1111) | 10005 (xsd:decimal)   |
| 2023 Rutherglen and Hamilton West recall petition (wd:Q121087289)  | votes received (wdt:P1111) | 11896 (xsd:decimal)   |
| Provincial elections of Azuay of 2019 (wd:Q62005938)               | votes received (wdt:P1111) | 117163 (xsd:decimal)  |
| ...                                                                | ...                        | ...                   |

[Assistant]
I'll run a SPARQL query to find items with votes received (wdt:P1111) whose English label contains "Basque" or "Basque Country" or "Euskadi" and relate to 2020. This can find result items for the 2020 Basque election.

execute

SELECT ?item ?itemLabel ?votes WHERE {
  ?item wdt:P1111 ?votes .
  ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en")
  FILTER(
    CONTAINS(LCASE(?itemLabel), "basque") ||
    CONTAINS(LCASE(?itemLabel), "euskadi") ||
    CONTAINS(LCASE(?itemLabel), "basque country")
  )
} LIMIT 200

[Assistant]
I'll list triples for the PP+Cs coalition item (wd:Q85843184) to see if vote counts per place are recorded on the coalition's item (they could be modeled as statements about electoral performance).

list

wd:Q85843184

[Assistant]
I'll run a SPARQL query to list items with Spanish labels containing 'Parlamento Vasco' or 'Parlamento Vasco 2020' that are instances of electoral result (Q19571328) or have wdt:P1111 (votes received) to find result items for municipalities and constituencies.

execute

SELECT ?item ?itemLabelEs ?instanceLabel WHERE {
  ?item rdfs:label ?itemLabelEs . FILTER(LANG(?itemLabelEs) = "es")
  FILTER(CONTAINS(LCASE(?itemLabelEs), "parlamento vasco") || CONTAINS(LCASE(?itemLabelEs), "elecciones al parlamento vasco"))
  OPTIONAL { ?item wdt:P31 ?instance . ?instance rdfs:label ?instanceLabel . FILTER(LANG(?instanceLabel) = "es") }
} LIMIT 200

SPARQL execution failed:
HTTPConnectionPool(host='localhost', port=7001): Read timed out. (read timeout=30)

[Assistant]
I'll try a direct entity search for Spanish phrase likely used in item labels: "Resultados elecciones al Parlamento Vasco 2020". This may surface municipality-level result items. (Retrying after the previous query timed out.)

Question: Resultados elecciones Parlamento Vasco 2020

Top 10 entity alternatives:
1. Biblioteca del Parlamento Vasco (wd:Q95144921): is instance of central library / is instance of main library / library in Spain
2. Buenos Aires Celebra País Vasco 2020 (wd:Q127334784): is instance of festival occurrence / 2020 Basque festival edition
3. COVID-19 pandemic in the city of Ferraz de Vasconcelos (wd:Q90153078, matched via 2020 Ferraz de Vasconcelos COVID-19 pandemic), also known as 2020 Ferraz de Vasconcelos COVID-19 pandemic, COVID-19 pandemic in the city of Ferraz de Vasconcelos, Brazil, COVID pandemic in the city of Ferraz de Vasconcelos, Ferraz de Vasconcelos COVID-19 pandemic: local instance of the COVID-19 pandemic / is instance of disease outbreak
4. Vasco Vascotto (wd:Q4008875): Italian sailor (born 1969) / has occupation sailor / is instance of human
5. Vasco Guedes de Vasconcelos (wd:Q10389314): has occupation politician / has occupation journalist / has occupation lawyer / Portuguese journalist / Portuguese journalist / Portuguese journalist / is instance of human
6. PARLAMENTO-ARENA O PARLAMENTO DI TRASFORMAZIONE? (wd:Q127851158): is instance of scholarly article / is instance of academic article / scholarly article
7. Vasco Thudichum Vasconcelos (wd:Q102310949): is instance of human / Ph.D.
8. conte Dalmazzo Francesco Vasco [vascodalma023060] (wd:Q103887334): is instance of encyclopaedic article / is instance of encyclopedia article / article in Electronic Enlightenment
9. Jorge “Vasco” Vasconcelo (wd:Q113679404), also known as DJ Vasco, Jorge Vasconcelo: has occupation musician / is instance of human / Portuguese musician
10. Vasco T. Vasconcelos (wd:Q58883944), also known as Vasco Vasconcelos: researcher ORCID ID = 0000-0002-9539-8861 / has occupation researcher / is instance of human

[Assistant]
I'll run a SPARQL query to find items that have a 'votes received' (wdt:P1111) value and are linked to the 2020 Basque election (wd:Q30594119) either by 'participant in' (P1344) or 'part of' (P361). I'll request English labels if available.

SELECT ?item ?itemLabel ?votes WHERE {
  ?item wdt:P1111 ?votes .
  {
    ?item wdt:P1344 wd:Q30594119 .
  } UNION {
    ?item wdt:P361 wd:Q30594119 .
  }
  OPTIONAL { ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en") }
} LIMIT 200

[Assistant]
I'll list the statement-level triples for the PP+Cs item on the property 'participant in' (p:P1344) to inspect qualifiers such as 'votes received' (P1111) or 'applies to jurisdiction' (P1001) attached to that participation statement.

list

wd:Q85843184

[Assistant] I'll now list the triples for the statement node returned so I can see its qualifiers and whether votes per jurisdiction are attached there.

[Assistant]
I'll list triples for the Vox party item to see if it has 'participant in' or election-related statements with vote qualifiers.

wd:Q15630787

[Assistant]
I'll run a SPARQL query to find items with votes received (wdt:P1111) that apply to a jurisdiction (wdt:P1001) and are linked to the 2020 Basque election via 'participant in' (wdt:P1344). This should surface results like \"X in municipality Y\". I'll request English labels when possible.

execute

SELECT ?res ?resLabel ?place ?placeLabel ?votes WHERE {
  ?res wdt:P1111 ?votes .
  ?res wdt:P1001 ?place .
  ?res wdt:P1344 wd:Q30594119 .
  OPTIONAL { ?res rdfs:label ?resLabel . FILTER(LANG(?resLabel) = "en") }
  OPTIONAL { ?place rdfs:label ?placeLabel . FILTER(LANG(?placeLabel) = "en") }
} LIMIT 500

[Assistant]
I'll search for items that apply to the Basque Autonomous Community (wd:Q3995) and have votes received (wdt:P1111). This could reveal result items for the 2020 election or related elections.

SELECT ?res ?resLabel ?votes WHERE {
  ?res wdt:P1001 wd:Q3995 .
  ?res wdt:P1111 ?votes .
  OPTIONAL { ?res rdfs:label ?resLabel . FILTER(LANG(?resLabel) = "en") }
} LIMIT 200

[Assistant]
I'll inspect the 2020 Basque election item for 'has part' (wdt:P527) statements to see if it has subitems for constituency-level or municipality-level results.

list

wd:Q30594119

[Assistant]
I'll list statement-level triples for the property P1111 on the election item to see if votes are recorded there with qualifiers indicating which party and which jurisdiction.

wd:Q30594119

[Assistant]
I'll inspect p:P1344 statements for the election item to find participant statements with qualifiers that might include vote counts per constituency.

wd:Q30594119

[Assistant]
I'll inspect the statement-level triples for the municipality Vitoria-Gasteiz (wd:Q14318) to see if it has statements recording votes received by parties in elections, which would show the pattern used.

wd:Q14318

[Assistant]
I'll check Bilbao (wd:Q28462) for P1111 statements.

wd:Q28462

[Assistant]
I will call the cancel function with a detailed explanation of why a reliable SPARQL query couldn't be found, describing the searches I ran and why they failed to locate per-jurisdiction vote counts in Wikidata for this election. I'll include my best-attempt SPARQL query pattern that would work if per-jurisdiction results were modeled in a common way (items of type electoral result with properties linking them to election, jurisdiction, party, and votes).

cancel

Explanation:
I could not find a satisfactory SPARQL query that returns per-jurisdiction vote counts for the PP+Cs and Vox parties in the 2020 Basque regional election. I searched and inspected Wikidata for the standard modeling patterns used for election results (items of type 'electoral result' (wd:Q19571328), statements using votes received (P1111), 'applies to jurisdiction' (P1001), 'participant in' (P1344), and search patterns that attach votes as qualifiers to participant statements). Concretely, I performed these steps:

1) Located the election item: 2020 Basque regional election (wd:Q30594119).
2) Located party items: PP+Cs (wd:Q85843184) and Vox (wd:Q15630787).
3) Looked for usage of votes received (wdt:P1111) across Wikidata and attempted to filter for items related to the Basque election, but queries matching labels (English/Spanish) returned no usable result items.
4) Examined the PP+Cs item: it has a direct 'participant in' (P1344) statement for the 2020 Basque election, but that statement had no qualifiers (no votes or per-jurisdiction qualifiers).
5) Examined the election item for child/result items (P527, P361), p:P1344 statements, or p:P1111 qualifiers — found no result statements with qualifiers linking votes to jurisdictions.
6) Probed municipality items (e.g., Vitoria-Gasteiz wd:Q14318, Bilbao wd:Q28462) for p:P1111 and found none.

Because none of these searches turned up items/statements in Wikidata following common modeling patterns (e.g., "electoral result" items with properties for election, jurisdiction, party, and votes), I couldn't construct a reliable, executable SPARQL query that returns the requested per-jurisdiction vote counts.

It's possible that: (a) Wikidata does not contain municipality- or constituency-level vote counts for this particular election; (b) the data exists but is stored in a different, nonstandard schema or labeled only in non-English labels making automated discovery hard; or (c) results are kept on Wikisource/Wikipedia tables only and not imported into Wikidata.

Best attempt SPARQL query (would return results if per-jurisdiction results are modeled as items of type electoral result and link election, jurisdiction and party directly):

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?place ?placeLabel ?party ?partyLabel ?votes WHERE {
  # result item representing party performance in a place for the election
  ?result wdt:P31 wd:Q19571328 .        # instance of electoral result
  ?result wdt:P1344 wd:Q30594119 .      # participant in the 2020 Basque election
  ?result wdt:P1001 ?place .            # applies to jurisdiction (the place)
  ?result wdt:P527 ?party .             # has part / lists the party (this predicate may differ)
  ?result wdt:P1111 ?votes .            # votes received
  OPTIONAL { ?place rdfs:label ?placeLabel FILTER(LANG(?placeLabel) = "en") }
  OPTIONAL { ?party rdfs:label ?partyLabel FILTER(LANG(?partyLabel) = "en") }
  FILTER(?party IN (wd:Q85843184, wd:Q15630787))
}
ORDER BY ?place ?party

Note: the above query is a best-effort template. The specific predicates linking a result item to a party (I used wdt:P527 as a guess) and the usage of 'electoral result' items may differ in Wikidata. When I attempted to discover actual items and statement patterns for the 2020 Basque election I could not find any matching items/statements. Therefore I cannot reliably return the requested grouped per-jurisdiction vote counts from Wikidata.

If you want, I can:
- Try a broader search again (e.g., probe Spanish labels, or search Wikipedia tables and attempt to crosswalk them to Wikidata items), or
- Provide the constituency-level (Álava, Bizkaia, Gipuzkoa) overall vote totals for PP+Cs and Vox if those are present in Wikidata (I can attempt a dedicated search for constituency-level totals), or
- Fetch the official vote counts from an external source (e.g., Spanish electoral authority or Wikipedia pages) and present them here (note: that would be outside Wikidata and not returned via a SPARQL query).

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?place ?placeLabel ?party ?partyLabel ?votes WHERE {
  # result item representing party performance in a place for the election
  ?result wdt:P31 wd:Q19571328 .        # instance of electoral result
  ?result wdt:P1344 wd:Q30594119 .      # participant in the 2020 Basque election
  ?result wdt:P1001 ?place .            # applies to jurisdiction (the place)
  ?result wdt:P527 ?party .             # has part / lists the party (this predicate may differ)
  ?result wdt:P1111 ?votes .            # votes received
  OPTIONAL { ?place rdfs:label ?placeLabel FILTER(LANG(?placeLabel) = "en") }
  OPTIONAL { ?party rdfs:label ?partyLabel FILTER(LANG(?partyLabel) = "en") }
  FILTER(?party IN (wd:Q85843184, wd:Q15630787))
}
ORDER BY ?place ?party


PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?item ?itemLabel ?url WHERE {
  ?item wdt:P856 ?url .
  FILTER ( CONTAINS( LCASE( STR( ?url ) ) , "twitter" ) ) .
  OPTIONAL {
    ?item rdfs:label ?itemLabel .
    FILTER ( LANG( ?itemLabel ) = "en" )
  }
}
LIMIT 1000

Using properties:
- official website (wd:P856 as wdt), also known as home page, homepage, home page (official), homepage (official), official homepage, etc.: is subproperty of URL / URL of the official page of an item (current or former). ... see the "Hijacked or dead websites" section of the Talk page

Got 69 rows and 3 columns, showing the first 5 and last 5 rows below:
| item                                          | itemLabel                               | url                                                                                |
| --------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| rain museum (wd:Q100138485)                   | rain museum (lang:en)                   | <https://mobile.twitter.com/regenmuseum>                                                                                |
| Luther E. Vann (wd:Q100208149)                | Luther E. Vann (lang:en)                | <https://www.author-poet-aberjhani.info/httpwwwauthor-poet-aberjhaniinfotwitter-tweets-news-notes/category/luther-e-vann> |
| Twemoji (wd:Q100601019)                       | Twemoji (lang:en)                       | <https://twemoji.twitter.com/>                                                                                |
| Alaa Maan (wd:Q100969271)                     | Alaa Maan (lang:en)                     | <https://twitter.com/alaamaan1?lang=en>                                                                                |
| West Wittering Parish Council (wd:Q104383379) | West Wittering Parish Council (lang:en) | <http://www.westwitteringparishcouncil.gov.uk>                                                                            |
| ...                                           | ...                                     | ...                                                                                |
| Ross Patterson (wd:Q7369567)                  | Ross Patterson (lang:en)                | <http://https://twitter.com/StJamesStJames>                                                                               |
| Tween (wd:Q7857509)                           | Tween (lang:en)                         | <https://sites.google.com/site/tweentwitterclient/>                                                                       |
| Twitterfall (wd:Q7858629)                     | Twitterfall (lang:en)                   | <http://www.twitterfall.com/>                                                                                |
| women to drive movement (wd:Q8031633)         | women to drive movement (lang:en)       | <https://twitter.com/hashtag/women2drive>                                                                                |
| X Pro (wd:Q931346)                            | X Pro (lang:en)                         | <http://tweetdeck.twitter.com>                                                                                |

Answer:
I searched for items whose official website (P856) contains the string "twitter" (case-insensitive) and executed the SPARQL query above. The query returned 69 matching items. Example results returned include:

- rain museum (wd:Q100138485) — https://mobile.twitter.com/regenmuseum
- Luther E. Vann (wd:Q100208149) — https://www.author-poet-aberjhani.info/httpwwwauthor-poet-aberjhaniinfotwitter-tweets-news-notes/category/luther-e-vann
- Twemoji (wd:Q100601019) — https://twemoji.twitter.com/
- Alaa Maan (wd:Q100969271) — https://twitter.com/alaamaan1?lang=en
- West Wittering Parish Council (wd:Q104383379) — http://www.westwitteringparishcouncil.gov.uk
...
- Ross Patterson (wd:Q7369567) — http://https://twitter.com/StJamesStJames
- Tween (wd:Q7857509) — https://sites.google.com/site/tweentwitterclient/
- Twitterfall (wd:Q7858629) — http://www.twitterfall.com/
- women to drive movement (wd:Q8031633) — https://twitter.com/hashtag/women2drive
- X Pro (wd:Q931346) — http://tweetdeck.twitter.com

If you want the full list returned in a particular format (CSV, JSON, or as a table), I can re-run the query and format the complete results accordingly.

I searched for items whose official website (P856) contains the string "twitter" (case-insensitive) and executed the SPARQL query above. The query returned 69 matching items. Example results returned include:

- rain museum (wd:Q100138485) — https://mobile.twitter.com/regenmuseum
- Luther E. Vann (wd:Q100208149) — https://www.author-poet-aberjhani.info/httpwwwauthor-poet-aberjhaniinfotwitter-tweets-news-notes/category/luther-e-vann
- Twemoji (wd:Q100601019) — https://twemoji.twitter.com/
- Alaa Maan (wd:Q100969271) — https://twitter.com/alaamaan1?lang=en
- West Wittering Parish Council (wd:Q104383379) — http://www.westwitteringparishcouncil.gov.uk
...
- Ross Patterson (wd:Q7369567) — http://https://twitter.com/StJamesStJames
- Tween (wd:Q7857509) — https://sites.google.com/site/tweentwitterclient/
- Twitterfall (wd:Q7858629) — http://www.twitterfall.com/
- women to drive movement (wd:Q8031633) — https://twitter.com/hashtag/women2drive
- X Pro (wd:Q931346) — http://tweetdeck.twitter.com

If you want the full list returned in a particular format (CSV, JSON, or as a table), I can re-run the query and format the complete results accordingly.

SPARQL query over wikidata:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?item ?itemLabel ?url WHERE {
  ?item wdt:P856 ?url .
  FILTER ( CONTAINS( LCASE( STR( ?url ) ) , "twitter" ) ) .
  OPTIONAL {
    ?item rdfs:label ?itemLabel .
    FILTER ( LANG( ?itemLabel ) = "en" )
  }
}
LIMIT 1000

Using properties:
- official website (wd:P856 as wdt), also known as home page, homepage, home page (official), homepage (official), official homepage, etc.: is subproperty of URL / URL of the official page of an item (current or former). ... see the "Hijacked or dead websites" section of the Talk page

Execution result:
Got 69 rows and 3 columns, showing the first 5 and last 5 rows below:
| item                                          | itemLabel                               | url                                                                                |
| --------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| rain museum (wd:Q100138485)                   | rain museum (lang:en)                   | <https://mobile.twitter.com/regenmuseum>                                                                                |
| Luther E. Vann (wd:Q100208149)                | Luther E. Vann (lang:en)                | <https://www.author-poet-aberjhani.info/httpwwwauthor-poet-aberjhaniinfotwitter-tweets-news-notes/category/luther-e-vann> |
| Twemoji (wd:Q100601019)                       | Twemoji (lang:en)                       | <https://twemoji.twitter.com/>                                                                                |
| Alaa Maan (wd:Q100969271)                     | Alaa Maan (lang:en)                     | <https://twitter.com/alaamaan1?lang=en>                                                                                |
| West Wittering Parish Council (wd:Q104383379) | West Wittering Parish Council (lang:en) | <http://www.westwitteringparishcouncil.gov.uk>                                                                            |
| ...                                           | ...                                     | ...                                                                                |
| Ross Patterson (wd:Q7369567)                  | Ross Patterson (lang:en)                | <http://https://twitter.com/StJamesStJames>                                                                               |
| Tween (wd:Q7857509)                           | Tween (lang:en)                         | <https://sites.google.com/site/tweentwitterclient/>                                                                       |
| Twitterfall (wd:Q7858629)                     | Twitterfall (lang:en)                   | <http://www.twitterfall.com/>                                                                                |
| women to drive movement (wd:Q8031633)         | women to drive movement (lang:en)       | <https://twitter.com/hashtag/women2drive>                                                                                |
| X Pro (wd:Q931346)                            | X Pro (lang:en)                         | <http://tweetdeck.twitter.com>                                                                                |

[System]
You are a question answering assistant. Your job is to generate a SPARQL query to answer a given user question.

You should follow a step-by-step approach to generate the SPARQL query:
1. Determine possible entities and properties implied by the user question.
2. Search for the entities and properties in the knowledge graphs. Where applicable, constrain the searches with already identified entities and properties.
3. Gradually build up the SPARQL query using the identified entities and properties. Start with simple queries and add more complexity as needed. Execute intermediate queries to get feedback and to verify your assumptions. You may need to refine or rethink your current plan based on the query results and go back to step 2 if needed, possibly multiple times.
4. Use the answer or cancel function to finalize your answer and stop the generation process.

Available knowledge graphs:
- wikidata at http://localhost:7001 with prefix index for entities and similarity index for properties, and notes:
  - P106 = occupation. Use wdt:P106 to get occupations and fetch English labels with rdfs:label + FILTER(LANG(?label)="en"). When returning human occupations confirm the subject is human (wdt:P31 wd:Q5) to avoid non-human items.
  - Population (P1082) and tabular (P4179): use wdt:P1082 for quick/direct values; for time-series/point-in-time use p:P1082 + ps:P1082 + pq:P585 and ORDER BY pq:P585 DESC. Inspect statement qualifiers (e.g., 'applies to part') and prov:wasDerivedFrom references (pr:P854 etc.) to detect city-proper vs metro/prefecture scopes before using values.
  - Common person properties: P31 (instance of human Q5), P106 (occupation), P569 (date of birth), P19 (place of birth), P27 (country of citizenship), P21 (sex/gender), P166 (award received). Use wdt: for direct values when possible.
  - P17 (country) can be incomplete/misleading for places (historical/overseas tags). To get modern cities in a country combine: instance-of city (P31=Q515) + wdt:P17 OR use wdt:P131* to find an admin parent whose wdt:P17 = the country. Also cross-check coordinates (P625) or admin hierarchy to spot outliers.
  - When filtering by date of birth (P569) use xsd:dateTime comparisons (e.g. >= "1900-01-01T00:00:00Z"^^xsd:dateTime). Be aware many items have year-only or imprecise dates and coverage is biased toward notable/public figures (sportspeople, politicians, artists).
  - To retrieve qualifiers (e.g., award year) use the statement/qualifier pattern: p:Pxxx / ps:Pxxx / pq:P585. Use wdt:Pxxx for normalized/direct values when you don't need qualifiers. Example: p:P166 + pq:P585 gives award year.
  - To get a person's occupations: use wdt:P106 for direct/normalized values and rdfs:label for human-readable names (FILTER(LANG(...))). Example: wd:Q... wdt:P106 ?occ . ?occ rdfs:label ?occLabel . FILTER(LANG(?occLabel)="en").
  - P166 = award received. Use wdt:P166 for normalized/direct values when you only need award items. To get award years or qualifiers use p:P166 / ps:P166 / pq:P585. Many statements lack pq:P585 — use OPTIONAL { ?stmt pq:P585 ?date } and ORDER BY DESC(?date). When listing award winners, filter ?person wdt:P31 wd:Q5 to ensure humans.
  - Population time-series pattern: wd:Q... p:P1082 ?stmt . ?stmt ps:P1082 ?pop . OPTIONAL { ?stmt pq:P585 ?date } . ORDER BY DESC(?date). pq:P585 is the point-in-time qualifier. IMPORTANT: time-series may mix scopes (city proper vs metro) — e.g., Tokyo has a 2016 entry ~38,140,000 likely metro vs smaller city figures. Inspect qualifiers/references for scope before use.
  - Use wdt:P131* to traverse the admin hierarchy and compare wdt:P17 on the place vs an admin parent to detect historical/colonial country assignments. When mismatches appear, inspect the admin parent's instance-of (P31), labels, qualifiers and references to interpret the historical scope.
  - wdt:P106 often yields multiple occupations for a person. Use GROUP_CONCAT(DISTINCT ?occLabel; separator=", ") or return multiple rows. Always fetch labels with rdfs:label + FILTER(LANG(?label)="en") to get readable occupation names.
  - When a search_entity returns multiple hits (person vs sculpture vs memorial), confirm you selected the human/statements by checking wdt:P31 (instance of) and relevant wdt: properties (e.g., wdt:P106). This avoids using a non-human QID by mistake.
  - search_autocomplete can be constrained with a SPARQL pattern containing ?search (e.g., SELECT * WHERE { ?search wdt:P31 wd:Q5 }). Use constraints to focus results (e.g., humans) and avoid ambiguous fallbacks; if it returns no results, fallback to search_entity and verify wdt:P31.
  - Use search_property_of_entity to find relevant properties for an entity (e.g., 'award' -> P166) and search_object_of_property to discover candidate objects (e.g., 'physicist' for P106). This reduces guessing P/Q ids and surfaces qualifiers.
  - Inspect statement references and qualifiers: use prov:wasDerivedFrom on p: statements to find sources, and check qualifiers (e.g., 'applies to part' or other scope qualifiers) to disambiguate city vs metro vs admin area. Reference labels can be empty; inspect reference node properties for URLs or publication dates.

Index types used for entities and properties:
- Prefix index: Retrieves items by overlap between query keywords and item words. The query keywords can match item words exactly or as prefixes.
- Similarity index: Retrieves items by cosine similarity between their embeddings and the query embedding.

General notes across knowledge graphs:
- Use rdfs:label + FILTER(LANG(?label)="en") for labels; avoid SERVICE wikibase:label. Use wdt:Pxxx for normalized/direct values when qualifiers aren't needed. Use p:Pxxx / ps:Pxxx / pq:Pxxx to access statement qualifiers (e.g., award year via pq:P585). When dates matter, prefer xsd:dateTime and watch for year-only precision.
- Practical query patterns: use rdfs:label + FILTER(LANG(...)) for labels. Use wdt:Pxxx for direct/normalized values when qualifiers aren't needed. Use p:Pxxx / ps:Pxxx / pq:Pxxx to access qualifiers (dates via pq:P585). For dates use xsd:dateTime and expect year-only precision. For places: combine P17 with P131 or coordinate (P625) filters to avoid historical/overseas mismatches.
- Use OPTIONAL for pq: qualifiers (e.g., pq:P585), sort by qualifier (ORDER BY pq:P585 DESC) to prefer recent values. Use GROUP_CONCAT to combine multiple labels/values in one row. Watch for typed literals (xsd:dateTime, xsd:decimal) when filtering or sorting.
- Before querying, use search_entity to resolve human-friendly names to wd:Q identifiers and verify instance-of (e.g., check wdt:P31 = wd:Q5 for humans) to avoid ambiguous matches. Prefer the top match but programmatically confirm P31 before using its data.
- Use search_property to confirm property identifiers (e.g., "country" -> P17) before embedding them in queries. This prevents mistakes from assuming an ID and helps pick the best property if multiple choices exist.
- search_autocomplete can fall back to an unconstrained search or error when there are too many candidates. If this happens (e.g., "more than the maximum supported number of subject candidates"), retry with narrower constraints such as instance-of (wdt:P31), additional type filters, or short prefixes to reduce the candidate set; otherwise fallback to search_entity and verify wdt:P31.
- Use list(...) to inspect all triples on an entity for exploration, but expect large results for notable items. Prefer wdt: properties or targeted p:/ps:/pq: patterns in SPARQL when you need normalized values or qualifiers, respectively.
- Before embedding property or item IDs in SPARQL, use search_property, search_property_of_entity, and search_object_of_property to discover the appropriate P/PID or object QIDs. This reduces errors from guessing IDs and surfaces better property alternatives and qualifiers.
- search_constrained and search_autocomplete can return no results for constrained queries or when the index is large. If they fail, fallback to search_entity + verify P31 (or use search_property_of_entity). Constrain with instance-of (wdt:P31) or other properties in the SPARQL to improve matches.
- When selecting awards by year, prefer xsd:dateTime range filters (e.g., >= "2001-01-01T00:00:00Z"^^xsd:dateTime && < "2002-01-01T00:00:00Z"^^xsd:dateTime) instead of YEAR() for portability and precision.
- When selecting award winners via wdt:P166, filter ?person wdt:P31 wd:Q5 to ensure humans — fictional characters or non-humans may have award claims. If you need award years use p:P166 / ps:P166 / pq:P585 and OPTIONAL { ?stmt pq:P585 ?year } to retrieve qualifier years.
- Use wdt:P625 (coordinates) together with wdt:P131* and wdt:P17 checks to validate a place's modern country or to filter by geography. When country labels mismatch historically, inspect admin parents and coordinates to resolve whether the item refers to historical/colonial scope or current boundaries.
- Prefer wdt:Pxxx for normalized/direct values when qualifiers aren't needed. Use p:Pxxx / ps:Pxxx / pq:Pxxx to access qualifiers (e.g., pq:P585 for award year). Always fetch labels with rdfs:label + FILTER(LANG(?label) = "en").
- If search_autocomplete returns too many candidates or errors, retry with constraints (e.g., SELECT * WHERE { ?search wdt:P31 wd:Q5 }) or narrower query text. If still failing, fallback to search_entity and verify wdt:P31 for type checks.
- For award-year queries use p:P166 / ps:P166 / pq:P585 to access award statements and year qualifiers. Filter by xsd:dateTime ranges (e.g., >= "2020-01-01T00:00:00Z"^^xsd:dateTime && < "2021-01-01T00:00:00Z"^^xsd:dateTime) instead of YEAR() for robustness.
- Use search_property_of_entity to surface relevant properties for an entity (e.g., 'birth' -> P569/P19). list(...) can inspect triples but may return large results for notable items—prefer targeted wdt: patterns (wdt:Pxxx) or p:/ps:/pq: patterns when you need qualifiers.

SPARQL prefixes for use in function calls:
- bd: <http://www.bigdata.com/rdf#
- cc: <http://creativecommons.org/ns#
- data: <https://www.wikidata.org/wiki/Special:EntityData/
- dc: <http://purl.org/dc/elements/1.1/
- dct: <http://purl.org/dc/terms/
- foaf: <http://xmlns.com/foaf/0.1/
- geo: <http://www.opengis.net/ont/geosparql#
- geof: <http://www.opengis.net/def/function/geosparql/
- gn: <http://www.geonames.org/ontology#
- hint: <http://www.bigdata.com/queryHints#
- imdb: <https://www.imdb.com/
- math: <http://www.w3.org/2005/xpath-functions/math#
- ontolex: <http://www.w3.org/ns/lemon/ontolex#
- owl: <http://www.w3.org/2002/07/owl#
- p: <http://www.wikidata.org/prop/
- pq: <http://www.wikidata.org/prop/qualifier/
- pqn: <http://www.wikidata.org/prop/qualifier/value-normalized/
- pqv: <http://www.wikidata.org/prop/qualifier/value/
- pr: <http://www.wikidata.org/prop/reference/
- prn: <http://www.wikidata.org/prop/reference/value-normalized/
- prov: <http://www.w3.org/ns/prov#
- prv: <http://www.wikidata.org/prop/reference/value/
- ps: <http://www.wikidata.org/prop/statement/
- psn: <http://www.wikidata.org/prop/statement/value-normalized/
- psv: <http://www.wikidata.org/prop/statement/value/
- qb: <http://purl.org/linked-data/cube#
- qfn: <http://qlever.cs.uni-freiburg.de/function#
- ql: <http://qlever.cs.uni-freiburg.de/builtin-functions/
- qlss: <https://qlever.cs.uni-freiburg.de/spatialSearch/
- rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#
- rdfs: <http://www.w3.org/2000/01/rdf-schema#
- ref: <http://www.wikidata.org/reference/
- s: <http://www.wikidata.org/entity/statement/
- schema: <http://schema.org/
- skos: <http://www.w3.org/2004/02/skos/core#
- v: <http://www.wikidata.org/value/
- void: <http://rdfs.org/ns/void#
- wd: <http://www.wikidata.org/entity/
- wdno: <http://www.wikidata.org/prop/novalue/
- wdt: <http://www.wikidata.org/prop/direct/
- wdtn: <http://www.wikidata.org/prop/direct-normalized/
- wikibase: <http://wikiba.se/ontology#
- xsd: <http://www.w3.org/2001/XMLSchema#

Additional rules to follow:
- Explain your thought process before and after each step and function call.
- Do not just use or make up entity or property identifiers without verifying their existence in the knowledge graphs first.
- Do not ask the user for clarifications without first attempting to complete the task. If the task input is incomplete or ambiguous, try to make reasonable assumptions and document them.
- Do not use "SERVICE wikibase:label { bd:serviceParam wikibase:language ..." in SPARQL queries. It is not SPARQL standard and unsupported by the used QLever SPARQL endpoints. Use rdfs:label or similar properties to get labels instead.
- Always execute your final SPARQL query before giving an answer to make sure it returns the expected results.
- The SPARQL query should always return the actual identifiers / IRIs of the items in its result. It additionally may return labels or other human-readable information, but they are optional and should be put within optional clauses unless explicitly requested by the user.
- Do not stop early if there are still obvious improvements to be made to the SPARQL query. For example, keep refining your SPARQL query if its result contains irrelevant items or is missing items you expected.
- Do not perform additional computation (e.g. filtering, sorting, calculations) on the result of the SPARQL query to determine the answer. All computation should be done solely within SPARQL.
- For questions with a "True" or "False" answer the SPARQL query should be an ASK query.

[User] Which items have an official website URL that contains the string "twitter"?

[Assistant]
Step 1: Identify the property used for "official website" in Wikidata (I will search for the property so I don't assume an identifier). I'll search for properties matching "official website". I'll call the property search tool next.

Question: official website

Top 10 property alternatives:
1. official website (wd:P856 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as home page, homepage, home page (official), homepage (official), official homepage, etc.: URL of the official page of an item (current or former). ... see the "Hijacked or dead websites" section of the Talk page / is subproperty of URL
2. official wiki URL (wd:P12203 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via official wiki website), also known as official wiki, official wiki website, wiki, wiki URL, wiki website, etc.: URL of the official wiki for the item / is subproperty of URL
3. official shop URL (wd:P10225 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via official shop website), also known as merch store, official shop website, official store URL, official store website, official website shop, etc.: official URL where the agent sells products/merchandise / official URL where the agent sells products/merchandise / is subproperty of official website
4. official blog URL (wd:P1581 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via official weblog), also known as blog, corporate blog, official weblog, URL blog, weblog, etc.: URL to the blog of this person or organisation / URL to the blog of this person or organization / is subproperty of URL
5. FAQ URL (wd:P9214 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via official FAQ URL), also known as FAQ page, FAQ's URL, FAQs URL, FAQ webpage, FAQ website, etc.: FAQ (frequently asked questions) page of the subject
6. native label (wd:P1705 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via official name), also known as autonym, label in official language, label in original language, name in official language, name in original language, etc.: label for the items in their official language (P37) or their original language (P364) / label for the items in their official language (P37) or their original language (P364) / label for the items in their official language (P37) or their original language (P364) / label for the items in their official language  or their original language / is subproperty of name
7. official name (wd:P1448 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as be named, complete title, full title, legal name, long name, etc.: official name of the subject in its official language(s) / official name of the subject in its official language(s) / official name of the subject in its official language(s) / is subproperty of name
8. official forum URL (wd:P10027 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as Discourse URL, forums, forum URL, P10027: website whose main topic is the entity and users can discuss, post questions, answer existing questions to help other users
9. reference URL (wd:P854 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via site), also known as ref, site, URL, URL fonte, URL ref, etc.: should be used for Internet URLs as references. Use "Wikimedia import URL" (P4656) for imports from WMF sites / should be used for Internet URLs as references. Use "Wikimedia import URL" (P4656) for interwiki links / should be used for Internet URLs as references. Use P4656 for interwiki links / is subproperty of URL
10. official app (wd:P4290 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via official application), also known as app, mobile app, official application, official mobile application, P4290: official app for this organisation or other entity (a downloadable application for Android, iOS, etc.) / official app for this organisation or other entity (a downloadable application for Android, iOS, etc.) / official app for this organization or other entity (a downloadable application for Android, iOS, etc.)

[Assistant]
I'll run a SPARQL query that finds items with P856 (official website) where the URL contains "twitter" (case-insensitive). The query will return the item IRI, its English label (if any), and the URL. I'll execute it now.

execute

SELECT ?item ?itemLabel ?url WHERE {
  ?item wdt:P856 ?url .
  FILTER(CONTAINS(LCASE(STR(?url)), "twitter")) .
  OPTIONAL {
    ?item rdfs:label ?itemLabel .
    FILTER(LANG(?itemLabel) = "en")
  }
} LIMIT 1000

Got 69 rows and 3 columns, showing the first 5 and last 5 rows below:
| item                                          | itemLabel                               | url                                                                                |
| --------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| rain museum (wd:Q100138485)                   | rain museum (lang:en)                   | <https://mobile.twitter.com/regenmuseum>                                                                                |
| Luther E. Vann (wd:Q100208149)                | Luther E. Vann (lang:en)                | <https://www.author-poet-aberjhani.info/httpwwwauthor-poet-aberjhaniinfotwitter-tweets-news-notes/category/luther-e-vann> |
| Twemoji (wd:Q100601019)                       | Twemoji (lang:en)                       | <https://twemoji.twitter.com/>                                                                                |
| Alaa Maan (wd:Q100969271)                     | Alaa Maan (lang:en)                     | <https://twitter.com/alaamaan1?lang=en>                                                                                |
| West Wittering Parish Council (wd:Q104383379) | West Wittering Parish Council (lang:en) | <http://www.westwitteringparishcouncil.gov.uk>                                                                            |
| ...                                           | ...                                     | ...                                                                                |
| Ross Patterson (wd:Q7369567)                  | Ross Patterson (lang:en)                | <http://https://twitter.com/StJamesStJames>                                                                               |
| Tween (wd:Q7857509)                           | Tween (lang:en)                         | <https://sites.google.com/site/tweentwitterclient/>                                                                       |
| Twitterfall (wd:Q7858629)                     | Twitterfall (lang:en)                   | <http://www.twitterfall.com/>                                                                                |
| women to drive movement (wd:Q8031633)         | women to drive movement (lang:en)       | <https://twitter.com/hashtag/women2drive>                                                                                |
| X Pro (wd:Q931346)                            | X Pro (lang:en)                         | <http://tweetdeck.twitter.com>                                                                                |

[Assistant]
I will finalize by returning the SPARQL query I executed and a short summary of the results (including a few example rows). The full query results (69 matching items) are available by running the included query.

answer

SELECT ?item ?itemLabel ?url WHERE {
  ?item wdt:P856 ?url .
  FILTER(CONTAINS(LCASE(STR(?url)), "twitter")) .
  OPTIONAL {
    ?item rdfs:label ?itemLabel .
    FILTER(LANG(?itemLabel) = "en")
  }
} LIMIT 1000

Answer:
I searched for items whose official website (P856) contains the string "twitter" (case-insensitive) and executed the SPARQL query above. The query returned 69 matching items. Example results returned include:

- rain museum (wd:Q100138485) — https://mobile.twitter.com/regenmuseum
- Luther E. Vann (wd:Q100208149) — https://www.author-poet-aberjhani.info/httpwwwauthor-poet-aberjhaniinfotwitter-tweets-news-notes/category/luther-e-vann
- Twemoji (wd:Q100601019) — https://twemoji.twitter.com/
- Alaa Maan (wd:Q100969271) — https://twitter.com/alaamaan1?lang=en
- West Wittering Parish Council (wd:Q104383379) — http://www.westwitteringparishcouncil.gov.uk
...
- Ross Patterson (wd:Q7369567) — http://https://twitter.com/StJamesStJames
- Tween (wd:Q7857509) — https://sites.google.com/site/tweentwitterclient/
- Twitterfall (wd:Q7858629) — http://www.twitterfall.com/
- women to drive movement (wd:Q8031633) — https://twitter.com/hashtag/women2drive
- X Pro (wd:Q931346) — http://tweetdeck.twitter.com

If you want the full list returned in a particular format (CSV, JSON, or as a table), I can re-run the query and format the complete results accordingly.