PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?institution WHERE {
  wd:Q7336 wdt:P69 ?institution
}

Using entities:
- Otto Heinrich Frank (wd:Q7336), also known as Otto H. Frank: has occupation merchant / has occupation amateur photographer / has occupation businessperson / has occupation banker / is instance of human / Father of Holocaust diarist Anne Frank (1889–1980)

Using properties:
- educated at (wd:P69 as wdt), also known as alma mater, alumna of, alumni of, alumnus of, attended, etc.: is subproperty of affiliation / educational institution attended by subject / educational institution attended by the subject / educational institution attended by the subject

Answer: Otto Frank went to college at Heidelberg University.

Otto Frank went to college at Heidelberg University.

SPARQL query over wikidata:
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?institution WHERE {
  wd:Q7336 wdt:P69 ?institution
}

Using entities:
- Otto Heinrich Frank (wd:Q7336), also known as Otto H. Frank: has occupation merchant / has occupation amateur photographer / has occupation businessperson / has occupation banker / is instance of human / Father of Holocaust diarist Anne Frank (1889–1980)

Using properties:
- educated at (wd:P69 as wdt), also known as alma mater, alumna of, alumni of, alumnus of, attended, etc.: is subproperty of affiliation / educational institution attended by subject / educational institution attended by the subject / educational institution attended by the subject

Execution result:
Got 1 row and 1 column:
| institution                        |
| ---------------------------------- |
| Heidelberg University (wd:Q151510) |

[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] where did otto frank go to college?

[Assistant]
To determine where Otto Frank went to college, I need to find information about his education, specifically the institution(s) he attended. Otto Frank is known as the father of Anne Frank, and he was a German-born businessman.

### Step 1: Search for Otto Frank in Wikidata
I will first search for Otto Frank to identify his Wikidata entity.

Question: otto frank

Top 10 entity alternatives:
1. Frank Otto (wd:Q1443909): has occupation water polo player / German water polo player / is instance of human
2. Otto Frank (wd:Q89925), also known as Friedrich Wilhelm Ferdinand Otto Frank, Otto Friedrich Frank: has occupation university teacher / German physiologist (1865–1944) / has occupation cardiologist / has occupation physiologist / has occupation physician / is instance of human / German physiologist / German physiologist
3. Frank Otto (wd:Q1443902): has occupation film director / German media entrepreneur / has occupation geologist / has occupation director / has occupation overseer / is instance of human
4. Frank Otto (wd:Q16104521): American linguist (1936-2017) / has occupation linguist / is instance of human
5. Frank Otto (wd:Q1443905): has occupation historian of Modern Age / German historian of modern age / has occupation writer / is instance of human
6. Otto Frank (wd:Q36977791): German FDP politician (1900-1963) / has occupation politician / is instance of human
7. Otto Frank (wd:Q94791903): has occupation military officer / has occupation cartographer / has occupation officer / is instance of human
8. Otto Frank (wd:Q104548689): holocaust victim, b. 1902-01-24 / is instance of human
9. Otto Frank (wd:Q104548688): holocaust victim, b. 1875-06-25 / is instance of human
10. Otto Frank (wd:Q116960730): has occupation architect / has occupation Architect / is instance of human / Austrian architect

[Assistant]
The correct Otto Frank is the father of Anne Frank, which corresponds to **wd:Q89925** — "Otto Frank (1889–1980), German businessman and father of Anne Frank". The other entries are different people with similar names.

### Step 2: Explore properties of Otto Frank (wd:Q89925)
I will now list the triples for Otto Frank to identify any education-related properties, such as "educated at" or "alma mater".

list

wd:Q89925

Got 218 rows and 3 columns, showing the first 10 rows below:
| subject                | property                         | object                              |
| ---------------------- | -------------------------------- | ----------------------------------- |
| Otto Frank (wd:Q89925) | instance of (wdt:P31)            | human (wd:Q5)                       |
| Otto Frank (wd:Q89925) | occupation (wdt:P106)            | physician (wd:Q39631)               |
| Otto Frank (wd:Q89925) | sex or gender (wdt:P21)          | male (wd:Q6581097)                  |
| Otto Frank (wd:Q89925) | given name (wdt:P735)            | Otto (wd:Q18029644)                 |
| Otto Frank (wd:Q89925) | date of birth (wdt:P569)         | 1865-06-21T00:00:00Z (xsd:dateTime) |
| Otto Frank (wd:Q89925) | Commons category (wdt:P373)      | Otto Frank (physiologist)           |
| Otto Frank (wd:Q89925) | family name (wdt:P734)           | Frank (wd:Q13560458)                |
| Otto Frank (wd:Q89925) | country of citizenship (wdt:P27) | German Reich (wd:Q1206012)          |
| Otto Frank (wd:Q89925) | Freebase ID (wdt:P646)           | /m/08h2p7                           |
| Otto Frank (wd:Q89925) | VIAF cluster ID (wdtn:P214)      | <http://viaf.org/viaf/50038410>     |
| ...                    | ...                              | ...                                 |

[Assistant]
I notice that the listed Otto Frank (wd:Q89925) is a **physiologist (1865–1944)**, not the father of Anne Frank. This is a mismatch.

The father of Anne Frank is **Otto Heinrich Frank (1889–1980)**, who is **not** in the top results. Let me search again with more precise terms.

### Step 3: Search for Otto Frank, father of Anne Frank
I will search with more specific terms: "Otto Frank father of Anne Frank".

Question: otto frank father of anne frank

Top 10 entity alternatives:
1. Bois Anne Frank - Anne Frankbos (wd:Q107264746), also known as Anne Frankbos, Arthur Maespark, Bois Anne Frank, Parc Arthur Maes: small forest in Brussels, Belgium / is instance of forest
2. Anne Frank Fonds v. Anne Frankstichting (wd:Q61721934): legal case concerning the copyright ownership of Anne Frank's diary and derivative works / is instance of legal case
3. Diary of Anne Frank (wd:Q6911), also known as Anne Frank Diary, Anne Frank's diary, Anne Frank's Diary, Diary of Anne Franke, Diary of a Young Girl, etc.: famous diary of a 13-year old Dutch Jewish girl hiding from the Nazis to escape the Holocaust / famous diary of a 13-year old Dutch Jewish girl hiding from the Nazis to escape the Holocaust / is instance of posthumous work / is instance of literary work / is instance of written work
4. The Diary of Anne Frank (wd:Q707986), also known as Diary of Anne Frank: 1959 film directed by George Stevens / is instance of film
5. The Diary of Anne Frank (wd:Q2305113): is instance of literary work / 1955 theater play
6. The Diary of Anne Frank (wd:Q2575263): is instance of television series / is instance of miniseries / 2009 British miniseries / is instance of serial
7. The Attic: The Hiding of Anne Frank (wd:Q823148, matched via Attic: The Hiding of Anne Frank), also known as Attic: The Hiding of Anne Frank: 1988 television film directed by John Erman / is instance of television film / is instance of Television film
8. Mi Ricordo Anna Frank (wd:Q3855957, matched via Memories of Anne Frank), also known as Memories of Anne Frank, Mi ricordo Anna Frank: 2010 Italian television film about Anne Frank, directed by Alberto Negrin / is instance of television film / is instance of Television film
9. The Diary of Anne Frank (wd:Q7730106): is instance of dramatico-musical work / opera by Grigory Frid
10. The Diary of Anne Frank (wd:Q821121), also known as Diary of Anne Frank: 1980 film directed by Boris Sagal / is instance of television film / is instance of Television film

[Assistant]
The search did not return the correct Otto Frank (father of Anne Frank). This suggests that the Wikidata entry for **Otto Frank (1889–1980)** may not be well-populated or may be under a slightly different name.

Let me try searching for **Anne Frank** and then look at her father’s property.

### Step 4: Search for Anne Frank and find her father
I will search for Anne Frank and then check her family relationships.

Question: anne frank

Top 10 entity alternatives:
1. Anne Frank (wd:Q4583), also known as Anna Frank, Anna M Frank, Annelies Marie Frank, Anne Maries Frank, Anne M. Frank: German-born Dutch Jewish diarist and Holocaust victim (1929–1945) / has occupation diarist / has occupation writer / is instance of human
2. Statue of Anne Frank (wd:Q27918477, matched via Anne Frank), also known as Anne Frank: public artwork by Pieter d'Hont in Utrecht, the Netherlands / is instance of war memorial / is instance of sculpture / is instance of statue
3. Anne Frank (wd:Q128498127): is instance of dramatico-musical work / opera by Shulamit Ran
4. Anne Frank (wd:Q123907483), also known as No Guilt: 1990 single by Brainbombs / is instance of single
5. Anne Frank (wd:Q115618903): sculpture in Berlin, Germany / is instance of monument / is instance of statue
6. Bust of Anne Frank (wd:Q41688543, matched via Anne Frank), also known as Anne Frank: is instance of sculpture / sculpture by Doreen Kern
7. Aenne Pahl (wd:Q60540011, matched via Anne Frank), also known as Anne Frank: has occupation painter / is instance of human
8. Anne Frank (wd:Q99711206): television executive
9. Anne Frank (wd:Q121036909): has occupation producer / is instance of human
10. Anne Frank (wd:Q106898038): has occupation costume designer / has occupation theatre manager / has occupation textile worker / has occupation puppeteer / has occupation director / has occupation overseer / is instance of human

[Assistant]
The correct entity for Anne Frank is **wd:Q4583**.

Now, I will list the triples for Anne Frank to find her father, who should be linked via a family relationship property (e.g., P22 for father, P25 for mother).

wd:Q4583

Got 1,286 rows and 3 columns, showing the first 10 rows below:
| subject               | property                         | object                                                                                |
| --------------------- | -------------------------------- | ------------------------------------------------------------------------------------- |
| Anne Frank (wd:Q4583) | instance of (wdt:P31)            | human (wd:Q5)                                                                         |
| Anne Frank (wd:Q4583) | occupation (wdt:P106)            | writer (wd:Q36180)                                                                    |
| Anne Frank (wd:Q4583) | sex or gender (wdt:P21)          | female (wd:Q6581072)                                                                  |
| Anne Frank (wd:Q4583) | given name (wdt:P735)            | Annelies (wd:Q19689370)                                                               |
| Anne Frank (wd:Q4583) | date of birth (wdt:P569)         | 1929-06-12T00:00:00Z (xsd:dateTime)                                                   |
| Anne Frank (wd:Q4583) | Commons category (wdt:P373)      | Anne Frank                                                                            |
| Anne Frank (wd:Q4583) | image (wdt:P18)                  | <http://commons.wikimedia.org/wiki/Special:FilePath/Anne%20Frank%20%28cropped%29.jpg> |
| Anne Frank (wd:Q4583) | family name (wdt:P734)           | Frank (wd:Q13560458)                                                                  |
| Anne Frank (wd:Q4583) | country of citizenship (wdt:P27) | Nazi Germany (wd:Q7318)                                                               |
| Anne Frank (wd:Q4583) | part of (wdt:P361)               | Canon of Dutch Literature (wd:Q2773681)                                               |
| ...                   | ...                              | ...                                                                                |

[Assistant]
I need to find the property that links Anne Frank to her father. Common family relationship properties in Wikidata include:

- **P22**: father
- **P25**: mother
- **P40**: child

I will search for properties related to "father" for Anne Frank.

Question: father

Top 10 property alternatives:
1. father (wd:P22 as p/wdt), also known as child of, dad, daddy, daughter of, has father, etc.: male parent of the subject. For stepfather, use "stepparent' (P3448) / male parent of the subject. For stepfather, use "stepparent" (P3448) / male parent of the subject. For stepfather, use "stepparent" (P3448) / is subproperty of parent
2. relative (wd:P1038 as p/wdt, matched via father-in-law), also known as ancestor, aunt, aunt-in-law, brother-in-law, co-brother-in-law, etc.: family member (qualify with "kinship to subject", P1039; for direct family member please use specific property) / family member (qualify with "type of kinship", P1039; for direct family member please use specific property) / is subproperty of significant person
3. mother (wd:P25 as p/wdt, matched via parent), also known as child of, daughter of, has mother, is child of, is daughter of, etc.: female parent of the subject. For stepmother, use "stepparent" (P3448) / female parent of the subject. For stepmother, use "stepparent" (P3448) / female parent of the subject. For stepmother, use "stepparent" (P3448) / is subproperty of parent
4. sibling (wd:P3373 as p/wdt, matched via brother), also known as bro, brother, brother of, brother or sister, brothers, etc.: the subject and the object have at least one common parent ... etc.) and step-siblings (step-brothers, step-sisters, etc.) / the subject has the object as their sibling (brother, sister, ... etc.) and step-siblings (step-brothers, step-sisters, etc.) / is subproperty of relative
5. family name (wd:P734 as p/wdt), also known as clan name, last name, surname, P734: last name or family name of a person / part of full name of person / part of full name of person / is subproperty of name
6. ethnic group (wd:P172 as p, matched via people), also known as (cultural) nationality, culture, ethnicity, ethnic or cultural origin, people, etc.: subject's ethnicity (consensus is that a VERY high standard ... on by scholars, or 3) is fictional and portrayed as such) / subject's ethnicity (consensus is that a VERY high standard ... on by scholars, or 3) is fictional and portrayed as such)
7. given name (wd:P735 as p/wdt, matched via forename), also known as Christian name, first name, forename, middle name, name, etc.: first name or another given name of this person; values used with the property should not link disambiguations nor family names / first name or another given name of this person; values used with the property shouldn't link disambiguations nor family names / first name or another given name of this person; values used with the property shouldn't link disambiguations nor family names / is subproperty of name

No other items found

[Assistant]
The property **P22 (father)** is listed. Now I will retrieve the father of Anne Frank using this property.

execute

SELECT ?father WHERE { wd:Q4583 wdt:P22 ?father }

[Assistant]
Great! Now I have the correct Wikidata ID for Otto Frank, father of Anne Frank: **wd:Q7336**.

### Step 5: Find where Otto Frank (wd:Q7336) went to college
I will now list the triples for Otto Frank (wd:Q7336) to find education-related properties such as "educated at" (P69) or "alma mater" (P69).

list

wd:Q7336

Got 429 rows and 3 columns, showing the first 10 rows below:
| subject                        | property                         | object                                                                             |
| ------------------------------ | -------------------------------- | ---------------------------------------------------------------------------------- |
| Otto Heinrich Frank (wd:Q7336) | instance of (wdt:P31)            | human (wd:Q5)                                                                      |
| Otto Heinrich Frank (wd:Q7336) | occupation (wdt:P106)            | merchant (wd:Q215536)                                                              |
| Otto Heinrich Frank (wd:Q7336) | sex or gender (wdt:P21)          | male (wd:Q6581097)                                                                 |
| Otto Heinrich Frank (wd:Q7336) | given name (wdt:P735)            | Otto (wd:Q18029644)                                                                |
| Otto Heinrich Frank (wd:Q7336) | date of birth (wdt:P569)         | 1889-05-12T00:00:00Z (xsd:dateTime)                                                |
| Otto Heinrich Frank (wd:Q7336) | Commons category (wdt:P373)      | Otto Frank                                                                         |
| Otto Heinrich Frank (wd:Q7336) | image (wdt:P18)                  | <http://commons.wikimedia.org/wiki/Special:FilePath/Otto%20Frank%20%281961%29.jpg> |
| Otto Heinrich Frank (wd:Q7336) | family name (wdt:P734)           | Frank (wd:Q13560458)                                                               |
| Otto Heinrich Frank (wd:Q7336) | country of citizenship (wdt:P27) | Germany (wd:Q183)                                                                  |
| Otto Heinrich Frank (wd:Q7336) | Freebase ID (wdt:P646)           | /m/01c9j8                                                                          |
| ...                            | ...                              | ...                                                                                |

[Assistant]
I don’t see an explicit "educated at" (P69) or "alma mater" (P69) property in the first results. Let me search for properties related to education or university.

Question: education

Top 10 property alternatives:
1. educated at (wd:P69 as p/wdt, matched via education), also known as alma mater, alumna of, alumni of, alumnus of, attended, etc.: educational institution attended by the subject / educational institution attended by the subject / educational institution attended by subject / is subproperty of affiliation
2. occupation (wd:P106 as p/wdt, matched via career), also known as avocation, career, craft, employ, employment, etc.: occupation of a person; see also "field of work" (Property:P101), "position held" (Property:P39) / occupation of a person; see also "field of work" (Property:P101), "position held" (Property:P39) / occupation of a person; see also "field of work" (Property:P101), "position held" (Property:P39)
3. country of citizenship (wd:P27 as p/wdt, matched via nation), also known as citizen of, citizenship, country, (legal) nationality, nation, etc.: the object is a country that recognizes the subject as its citizen / the object is a country that recognizes the subject as its citizen / is subproperty of country
4. described by source (wd:P1343 as p/wdt, matched via entry), also known as defined in, described by biography, described by encyclopedia, described by obituary, described by reference work, etc.: dictionary, encyclopaedia, etc. where this item is described / work where this item is described / is subproperty of attested in
5. religion or worldview (wd:P140 as p/wdt, matched via worldview), also known as belief system, believes, denomination, devotee of, faith, etc.: religion of a person, organisation or religious building, or associated with this subject / religion of a person, organisation or religious building, or associated with this subject / religion of a person, organization or religious building, or associated with this subject
6. Commons category (wd:P373 as p/wdt, matched via category Commons), also known as category Commons, category on Commons, category on Wikimedia Commons, category Wikipedia Commons, commonscat, etc.: name of the Wikimedia Commons category containing files related to this item (without the prefix "Category:") / name of the Wikimedia Commons category containing files related to this item (without the prefix "Category") / name of the Wikimedia Commons category containing files related to this item (without the prefix "Category")
7. child (wd:P40 as p/wdt, matched via children), also known as children, daughter, daughters, descendants, father of, etc.: subject has object as child. Do not use for stepchildren—use "relative" (P1038), qualified with "type of kinship" (P1039) / subject has the object in their family as their offspring son or daughter (independently of their age) / subject has object as biological, foster, and/or adoptive child / is subproperty of significant person / is subproperty of relative
8. number of children (wd:P1971 as p/wdt, matched via children), also known as children, children (number), how many children, issue, kids, etc.: number of children of the person. Mainly in cases where the full list isn't or shouldn't be added in "child" (P40). / number of children of the person, animal, or character
9. birth name (wd:P1477 as p/wdt, matched via né), also known as birthname, bn, bname, born as, full birth name, etc.: full name of a person at birth, if different from their ... John Peter Doe for Joe Doe, Ann Smith for Ann Miller) / full name of a person at birth, if different from their current, generally used name / full name of a person at birth, if different from their current name / is subproperty of name
10. languages spoken, written or signed (wd:P1412 as p/wdt, matched via language), also known as language, language of expression, language read, language signed, languages of expression, etc.: language(s) that a person or a people speaks, writes or signs, including the native language(s) / language(s) that a person speaks or writes, including the native language(s) / language(s) that a person speaks or writes, including the native language(s)

No other items found

[Assistant]
Perfect! The property **P69 (educated at)** is available. Now I will query for the educational institution(s) Otto Frank attended.

execute

SELECT ?institution WHERE { wd:Q7336 wdt:P69 ?institution }

[Assistant]
Otto Frank (father of Anne Frank) attended **Heidelberg University**.

### Final Answer:
Otto Frank went to college at **Heidelberg University**.

I will now provide the final SPARQL query and answer.

answer

SELECT ?institution WHERE { wd:Q7336 wdt:P69 ?institution }

Answer: Otto Frank went to college at Heidelberg University.


PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?institution ?institutionLabel WHERE {
  wd:Q52651 wdt:P69 ?institution .
  ?institution rdfs:label ?institutionLabel .
  FILTER ( LANG( ?institutionLabel ) = "en" )
}

Using entities:
- Jesse Owens (wd:Q52651), also known as James Cleveland "Jesse" Owens, James Cleveland Owens: has occupation athletics competitor / has occupation long jumper / has occupation sprinter / is instance of human / American track and field athlete (1913–1980)

Using properties:
- educated at (wd:P69 as wdt), also known as alma mater, alumna of, alumni of, alumnus of, attended, etc.: is subproperty of affiliation / educational institution attended by subject / educational institution attended by the subject / educational institution attended by the subject

Got 3 rows and 2 columns:
| institution                              | institutionLabel                     |
| ---------------------------------------- | ------------------------------------ |
| Ohio State University (wd:Q309331)       | Ohio State University (lang:en)      |
| East Technical High School (wd:Q5329490) | East Technical High School (lang:en) |
| North Platte High School (wd:Q7056353)   | North Platte High School (lang:en)   |

Answer: Jesse Owens attended North Platte High School, East Technical High School, and Ohio State University.

Jesse Owens attended North Platte High School, East Technical High School, and Ohio State University.

SPARQL query over wikidata:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?institution ?institutionLabel WHERE {
  wd:Q52651 wdt:P69 ?institution .
  ?institution rdfs:label ?institutionLabel .
  FILTER ( LANG( ?institutionLabel ) = "en" )
}

Using entities:
- Jesse Owens (wd:Q52651), also known as James Cleveland "Jesse" Owens, James Cleveland Owens: has occupation athletics competitor / has occupation long jumper / has occupation sprinter / is instance of human / American track and field athlete (1913–1980)

Using properties:
- educated at (wd:P69 as wdt), also known as alma mater, alumna of, alumni of, alumnus of, attended, etc.: is subproperty of affiliation / educational institution attended by subject / educational institution attended by the subject / educational institution attended by the subject

Execution result:
Got 3 rows and 2 columns:
| institution                              | institutionLabel                     |
| ---------------------------------------- | ------------------------------------ |
| Ohio State University (wd:Q309331)       | Ohio State University (lang:en)      |
| East Technical High School (wd:Q5329490) | East Technical High School (lang:en) |
| North Platte High School (wd:Q7056353)   | North Platte High School (lang:en)   |

[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] what was jesse owens education?

[Assistant]
To determine Jesse Owens' education, I need to find information about his educational background. This typically includes the schools or universities he attended.

Step 1: Identify Jesse Owens in the knowledge graph.
I'll start by searching for "Jesse Owens" to find the correct entity.

Question: jesse owens

Top 10 entity alternatives:
1. Jesse Owens (wd:Q52651), also known as James Cleveland "Jesse" Owens, James Cleveland Owens: American track and field athlete (1913–1980) / has occupation athletics competitor / has occupation long jumper / has occupation sprinter / is instance of human
2. Jesse Owens (wd:Q6186721): is instance of film / 2012 film
3. Jesse Owens Award (wd:Q3540423): awards given out by USA Track and Field / is instance of award
4. Jesse Hickman (wd:Q6186412, matched via Jesse Owens Hickman), also known as Jesse Owens Hickman: has occupation baseball player / American baseball player / is instance of human
5. The Jesse Owens Story (wd:Q7743138, matched via Jesse Owens Story), also known as Jesse Owens Story, Jessie Owens Story: is instance of television film / is instance of Television film / 1984 television film
6. rue Jesse Owens (wd:Q100740397): street in Saint-Denis, Seine-Saint-Denis, France / is instance of street
7. Jesse Owens Park (wd:Q49507611): park in Pima County, Arizona, United States of America / is instance of park
8. Jesse Owens Park (wd:Q49507612): park in Los Angeles County, California, United States of America / is instance of park
9. Jesse Owens Playground (wd:Q49507615): park in Kings County, New York, United States of America / is instance of park
10. Jesse Owens Plaza (wd:Q49507617): park in Franklin County, Ohio, United States of America / is instance of park

[Assistant]
The correct entity for Jesse Owens, the American track and field athlete, is wd:Q52651. Now I will investigate his educational background by exploring properties related to education, such as "educated at" (P69) or other relevant properties.

Step 2: Use `list` to examine the triples associated with Jesse Owens (wd:Q52651) to find education-related properties.

list

wd:Q52651

Got 628 rows and 3 columns, showing the first 10 rows below:
| subject                 | property                         | object                                                                        |
| ----------------------- | -------------------------------- | ----------------------------------------------------------------------------- |
| Jesse Owens (wd:Q52651) | instance of (wdt:P31)            | human (wd:Q5)                                                                 |
| Jesse Owens (wd:Q52651) | occupation (wdt:P106)            | athletics competitor (wd:Q11513337)                                           |
| Jesse Owens (wd:Q52651) | sex or gender (wdt:P21)          | male (wd:Q6581097)                                                            |
| Jesse Owens (wd:Q52651) | given name (wdt:P735)            | Jesse (wd:Q2227398)                                                           |
| Jesse Owens (wd:Q52651) | date of birth (wdt:P569)         | 1913-09-12T00:00:00Z (xsd:dateTime)                                           |
| Jesse Owens (wd:Q52651) | Commons category (wdt:P373)      | Jesse Owens                                                                   |
| Jesse Owens (wd:Q52651) | image (wdt:P18)                  | <http://commons.wikimedia.org/wiki/Special:FilePath/Jesse%20Owens%201936.jpg> |
| Jesse Owens (wd:Q52651) | family name (wdt:P734)           | Owens (wd:Q357139)                                                            |
| Jesse Owens (wd:Q52651) | country of citizenship (wdt:P27) | United States (wd:Q30)                                                        |
| Jesse Owens (wd:Q52651) | Freebase ID (wdt:P646)           | /m/0cmr3                                                                      |
| ...                     | ...                              | ...                                                                           |

[Assistant]
I see that the direct property for "educated at" (P69) is not immediately visible in the first few triples. I'll use `search_property_of_entity` to search for education-related properties for Jesse Owens.

Question: education

Top 10 property alternatives:
1. educated at (wd:P69 as p/wdt, matched via education), also known as alma mater, alumna of, alumni of, alumnus of, attended, etc.: educational institution attended by the subject / educational institution attended by the subject / educational institution attended by subject / is subproperty of affiliation
2. occupation (wd:P106 as p/wdt, matched via career), also known as avocation, career, craft, employ, employment, etc.: occupation of a person; see also "field of work" (Property:P101), "position held" (Property:P39) / occupation of a person; see also "field of work" (Property:P101), "position held" (Property:P39) / occupation of a person; see also "field of work" (Property:P101), "position held" (Property:P39)
3. ethnic group (wd:P172 as p/wdt, matched via culture), also known as (cultural) nationality, culture, ethnicity, ethnic or cultural origin, people, etc.: subject's ethnicity (consensus is that a VERY high standard ... on by scholars, or 3) is fictional and portrayed as such) / subject's ethnicity (consensus is that a VERY high standard ... on by scholars, or 3) is fictional and portrayed as such)
4. topic's main category (wd:P910 as p/wdt, matched via category), also known as article's main category, category, category for this topic, catmain, has category, etc.: main category of this topic / main Wikimedia category
5. award received (wd:P166 as p/wdt, matched via honors), also known as award, awarded, awards, awards received, award won, etc.: award or recognition received by a person, organisation or creative work / award or recognition received by a person, organization or creative work / award or recognition received by a person, organization or creative work / awards received by a person, organisation or creative work
6. country of citizenship (wd:P27 as p/wdt, matched via nation), also known as citizen of, citizenship, country, (legal) nationality, nation, etc.: the object is a country that recognizes the subject as its citizen / the object is a country that recognizes the subject as its citizen / is subproperty of country
7. described by source (wd:P1343 as p/wdt, matched via entry), also known as defined in, described by biography, described by encyclopedia, described by obituary, described by reference work, etc.: dictionary, encyclopaedia, etc. where this item is described / work where this item is described / is subproperty of attested in
8. Commons category (wd:P373 as p/wdt, matched via category Commons), also known as category Commons, category on Commons, category on Wikimedia Commons, category Wikipedia Commons, commonscat, etc.: name of the Wikimedia Commons category containing files related to this item (without the prefix "Category:") / name of the Wikimedia Commons category containing files related to this item (without the prefix "Category") / name of the Wikimedia Commons category containing files related to this item (without the prefix "Category")
9. languages spoken, written or signed (wd:P1412 as p/wdt, matched via language), also known as language, language of expression, language read, language signed, languages of expression, etc.: language(s) that a person or a people speaks, writes or signs, including the native language(s) / language(s) that a person speaks or writes, including the native language(s) / language(s) that a person speaks or writes, including the native language(s)
10. sport (wd:P641 as p/wdt, matched via sports), also known as play, plays, sport played, sports, P641: sport that the subject participates or participated in or is associated with / sport or discipline in which the entity participates or belongs to

No other items found

[Assistant]
I found the property "educated at" (wdt:P69), which is relevant for determining Jesse Owens' educational background. Now I will construct a SPARQL query to retrieve the educational institutions he attended.

execute

SELECT ?institution ?institutionLabel WHERE { wd:Q52651 wdt:P69 ?institution . SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }

SPARQL execution failed:
Error while executing a SERVICE request to <http://wikiba.se:80/ontology#label>: SERVICE responded with HTTP status code: 301, Moved Permanently. First 100 bytes of the response: '
<title>301 Moved Permanently</title>

301 Moved Permanently'

[Assistant]
I see that the `SERVICE wikibase:label` is not supported in this environment. I need to use `rdfs:label` with a language filter instead. Let me correct the SPARQL query to fetch the labels properly.

SELECT ?institution ?institutionLabel WHERE { wd:Q52651 wdt:P69 ?institution . ?institution rdfs:label ?institutionLabel . FILTER(LANG(?institutionLabel) = "en") }

Got 3 rows and 2 columns:
| institution                              | institutionLabel                     |
| ---------------------------------------- | ------------------------------------ |
| Ohio State University (wd:Q309331)       | Ohio State University (lang:en)      |
| East Technical High School (wd:Q5329490) | East Technical High School (lang:en) |
| North Platte High School (wd:Q7056353)   | North Platte High School (lang:en)   |

[Assistant]
Jesse Owens attended the following educational institutions:

1. North Platte High School
2. East Technical High School
3. Ohio State University

I will now provide the final answer with the SPARQL query used.

answer

SELECT ?institution ?institutionLabel WHERE { wd:Q52651 wdt:P69 ?institution . ?institution rdfs:label ?institutionLabel . FILTER(LANG(?institutionLabel) = "en") }

Answer: Jesse Owens attended North Platte High School, East Technical High School, and Ohio State University.


PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?religion ?religionLabel WHERE {
  wd:Q252 wdt:P140 ?religion .
  ?religion rdfs:label ?religionLabel .
  FILTER ( LANG( ?religionLabel ) = "en" )
}

Using entities:
- Indonesia (wd:Q252), also known as id, ID, IDN, INA, Republic of Indonesia: is instance of sovereign state / is instance of country / is instance of presidential system / is instance of island country / is instance of constitutional republic / is instance of Archipelagic state / is instance of archipelagic state / is instance of island nation / country in Southeast Asia / country in Southeast Asia and Oceania / island country in Southeast Asia and Oceania / republic in Southeast Asia

Using properties:
- religion or worldview (wd:P140 as wdt), also known as belief system, believes, denomination, devotee of, faith, etc.: religion of a person, organisation or religious building, or associated with this subject / religion of a person, organisation or religious building, or associated with this subject / religion of a person, organization or religious building, or associated with this subject

Got 6 rows and 2 columns:
| religion                  | religionLabel           |
| ------------------------- | ----------------------- |
| Catholicism (wd:Q1841)    | Catholicism (lang:en)   |
| Protestantism (wd:Q23540) | Protestantism (lang:en) |
| Islam (wd:Q432)           | Islam (lang:en)         |
| Buddhism (wd:Q748)        | Buddhism (lang:en)      |
| Hinduism (wd:Q9089)       | Hinduism (lang:en)      |
| Confucianism (wd:Q9581)   | Confucianism (lang:en)  |

Answer: The religions practiced in Indonesia are Islam, Protestantism, Catholicism, Hinduism, Buddhism, and Confucianism.

The religions practiced in Indonesia are Islam, Protestantism, Catholicism, Hinduism, Buddhism, and Confucianism.

SPARQL query over wikidata:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?religion ?religionLabel WHERE {
  wd:Q252 wdt:P140 ?religion .
  ?religion rdfs:label ?religionLabel .
  FILTER ( LANG( ?religionLabel ) = "en" )
}

Using entities:
- Indonesia (wd:Q252), also known as id, ID, IDN, INA, Republic of Indonesia: is instance of sovereign state / is instance of country / is instance of presidential system / is instance of island country / is instance of constitutional republic / is instance of Archipelagic state / is instance of archipelagic state / is instance of island nation / country in Southeast Asia / country in Southeast Asia and Oceania / island country in Southeast Asia and Oceania / republic in Southeast Asia

Using properties:
- religion or worldview (wd:P140 as wdt), also known as belief system, believes, denomination, devotee of, faith, etc.: religion of a person, organisation or religious building, or associated with this subject / religion of a person, organisation or religious building, or associated with this subject / religion of a person, organization or religious building, or associated with this subject

Execution result:
Got 6 rows and 2 columns:
| religion                  | religionLabel           |
| ------------------------- | ----------------------- |
| Catholicism (wd:Q1841)    | Catholicism (lang:en)   |
| Protestantism (wd:Q23540) | Protestantism (lang:en) |
| Islam (wd:Q432)           | Islam (lang:en)         |
| Buddhism (wd:Q748)        | Buddhism (lang:en)      |
| Hinduism (wd:Q9089)       | Hinduism (lang:en)      |
| Confucianism (wd:Q9581)   | Confucianism (lang:en)  |

[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] what are the religions practiced in indonesia?

[Assistant]
To determine the religions practiced in Indonesia, I need to find information about the official or commonly practiced religions in the country. This can be done by querying Wikidata for properties related to religion in Indonesia.

### Step 1: Identify the entity for Indonesia
I will first search for the entity representing Indonesia in Wikidata.

Question: indonesia

Top 10 entity alternatives:
1. Indonesia (wd:Q252), also known as id, ID, IDN, INA, Republic of Indonesia: island country in Southeast Asia and Oceania / is instance of constitutional republic / country in Southeast Asia and Oceania / is instance of presidential system / is instance of Archipelagic state / is instance of archipelagic state / is instance of sovereign state / is instance of island country / is instance of island nation / republic in Southeast Asia / country in Southeast Asia / is instance of country
2. Nusantara (wd:Q49332, matched via Indonesia), also known as Indonesia, Indonesian Archipelago, Indonesian Islands, Nusantara Archipelago, Nusantara Islands, etc.: Old Javanese term for the archipelagic Majapahit territory / Old Javanese term for the archipelagic Majapahit territory / is instance of geography term / is instance of native label / is instance of archipelago
3. Indonesia (wd:Q6025895), also known as Indonesia Raya: is instance of musical work/composition / song
4. Indonesia (wd:Q12497996), also known as Kota Palopo, Palopo: village in Palopo Kota Palopo Sulawesi Selatan, South Sulawesi, Indonesia / village in Mojokerto, East Java Province, Indonesia / village in Mojokerto, East Java Province, Indonesia / is instance of desa
5. Indonesia (wd:Q20203516): 1981 single by Sandra Reemer / is instance of single
6. Indonesia at the 1982 Asian Games (wd:Q16927493, matched via Indonesia), also known as Indonesia: is instance of nation at sport competition / sporting event delegation
7. Indonesia (wd:Q43379569): is instance of board game / board game
8. indonesia (wd:Q97375377)
9. Indonesia (wd:Q130900077): scientific article published in January 2003 / is instance of scholarly article / is instance of academic article
10. Indonesia (wd:Q130828643): is instance of scholarly article / is instance of academic article

[Assistant]
The primary entity for Indonesia is `wd:Q252`, which represents the Republic of Indonesia. I will now investigate the properties related to religion in Indonesia.

### Step 2: Search for properties related to religion
I will search for properties that might indicate religion, such as "religion" or "official religion," to find relevant information about religions practiced in Indonesia.

Question: religion

Top 10 property alternatives:
1. religion or worldview (wd:P140 as ps/psv/p/pqv/pqn/psn/pq/wdt/pr/prn/prv/wdtn, matched via religion), also known as belief system, believes, denomination, devotee of, faith, etc.: religion of a person, organisation or religious building, or associated with this subject / religion of a person, organisation or religious building, or associated with this subject / religion of a person, organization or religious building, or associated with this subject
2. official religion (wd:P3075 as ps/psv/p/pqv/pqn/psn/pq/wdt/pr/prn/prv/wdtn), also known as established religion, state religion, P3075: official religion in this administrative entity / official religion in this country
3. religious name (wd:P1635 as ps/psv/p/pqv/pqn/psn/pq/wdt/pr/prn/prv/wdtn, matched via name in religion), also known as baptismal name, monastic name, name in religion, P1635: name taken or used as a member of a religious community / name taken or used as a member of a religious community / name taken or used as a member of a religious community / name taken or used as a member of a religious community
4. religious order (wd:P611 as ps/psv/p/pqv/pqn/psn/pq/wdt/pr/prn/prv/wdtn), also known as monastic order, order, P611: order of monks or nuns to which an individual or religious house belongs / order of monks or nuns which the monastery housed / is subproperty of member of
5. worshipped by (wd:P1049 as ps/psv/p/pqv/pqn/psn/pq/wdt/pr/prn/prv/wdtn, matched via deity of), also known as deity of, P1049: religion or group/civilization that worships a given deity / religion or group/civilization that worships a given deity / is subproperty of part of
6. denomination (wd:P12949 as ps/psv/p/pqv/pqn/psn/pq/wdt/pr/prn/prv/wdtn), also known as P12949: value of a currency or type of currency
7. Christian liturgical rite (wd:P3501 as ps/psv/p/pqv/pqn/psn/pq/wdt/pr/prn/prv/wdtn, matched via Christian rite), also known as Catholic liturgical rite, Catholic rite, Christian rite, P3501: Christian liturgical rite associated with this item
8. madhhab (wd:P9929 as ps/psv/p/pqv/pqn/psn/pq/wdt/pr/prn/prv/wdtn), also known as madhab, mazhab, school of thought, P9929: Islamic school of thought within Fiqh
9. domain of saint or deity (wd:P2925 as ps/psv/p/pqv/pqn/psn/pq/wdt/pr/prn/prv/wdtn, matched via sacred domain), also known as angel of, divine patron, domain of deity or saint, goddess of, god of, etc.: domain(s) which this saint or deity controls or protects / domain(s) which this saint or deity controls
10. place of devotion (wd:P5873 as ps/psv/p/pqv/pqn/psn/pq/wdt/pr/prn/prv/wdtn), also known as P5873: place where a religious devotion was practiced and for which this devotional image (or text) was produced

[Assistant]
Two relevant properties are identified:
1. **P140 (religion or worldview)**: This property links an entity to a religion or worldview it is associated with.
2. **P3075 (official religion)**: This property specifies the official religion of a country or administrative entity.

Since the question asks about **religions practiced in Indonesia**, it is more appropriate to use **P140** (religion or worldview), as it captures all religions practiced in the country, not just the official one. However, I will also check **P3075** to see if there is an official religion declared.

### Step 3: Query for religions practiced in Indonesia using P140
I will now query Wikidata to find the religions associated with Indonesia (`wd:Q252`) using the `wdt:P140` property and retrieve their English labels.

execute

SELECT ?religion ?religionLabel WHERE { wd:Q252 wdt:P140 ?religion . SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }

SPARQL execution failed:
Error while executing a SERVICE request to <http://wikiba.se:80/ontology#label>: SERVICE responded with HTTP status code: 301, Moved Permanently. First 100 bytes of the response: '
<title>301 Moved Permanently</title>

301 Moved Permanently'

[Assistant]
The error occurred because I used `SERVICE wikibase:label`, which is not supported in this environment. I need to use `rdfs:label` with a language filter instead.

I will rewrite the query to fetch the English labels of religions associated with Indonesia using `rdfs:label` and `FILTER(LANG(?label) = "en")`.

### Step 4: Rewrite query using `rdfs:label` instead of `SERVICE wikibase:label`
I will now execute the corrected SPARQL query to find the religions practiced in Indonesia.

SELECT ?religion ?religionLabel WHERE { wd:Q252 wdt:P140 ?religion . ?religion rdfs:label ?religionLabel . FILTER(LANG(?religionLabel) = "en") }

Got 6 rows and 2 columns:
| religion                  | religionLabel           |
| ------------------------- | ----------------------- |
| Catholicism (wd:Q1841)    | Catholicism (lang:en)   |
| Protestantism (wd:Q23540) | Protestantism (lang:en) |
| Islam (wd:Q432)           | Islam (lang:en)         |
| Buddhism (wd:Q748)        | Buddhism (lang:en)      |
| Hinduism (wd:Q9089)       | Hinduism (lang:en)      |
| Confucianism (wd:Q9581)   | Confucianism (lang:en)  |

[Assistant]
The query successfully returned the six major religions practiced in Indonesia:

1. **Islam**
2. **Protestantism**
3. **Catholicism**
4. **Hinduism**
5. **Buddhism**
6. **Confucianism**

These are the officially recognized religions in Indonesia, as per the country's constitution and government policy.

### Final Answer:
The religions practiced in Indonesia are Islam, Protestantism, Catholicism, Hinduism, Buddhism, and Confucianism.

I will now provide the final SPARQL query and answer.

answer

SELECT ?religion ?religionLabel WHERE { wd:Q252 wdt:P140 ?religion . ?religion rdfs:label ?religionLabel . FILTER(LANG(?religionLabel) = "en") }

Answer: The religions practiced in Indonesia are Islam, Protestantism, Catholicism, Hinduism, Buddhism, and Confucianism.