PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?spouse ?spouseLabel WHERE {
  wd:Q34969 wdt:P26 ?spouse .
  OPTIONAL {
    ?spouse rdfs:label ?spouseLabel FILTER ( LANG( ?spouseLabel ) = 'en' )
  }
}

Deborah Read Franklin

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

You have access to the following knowledge graphs:
wikidata at https://qlever.cs.uni-freiburg.de/api/wikidata-sebastian

You can use the following SPARQL prefixes implicitly in all functions:
cc: <http://creativecommons.org/ns#
data: <https://www.wikidata.org/wiki/Special:EntityData/
dct: <http://purl.org/dc/terms/
geo: <http://www.opengis.net/ont/geosparql#
geof: <http://www.opengis.net/def/function/geosparql/
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/
qfn: <http://qlever.cs.uni-freiburg.de/function#
ql: <http://qlever.cs.uni-freiburg.de/builtin-functions/
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/
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#
foaf: <http://xmlns.com/foaf/0.1/
dc: <http://purl.org/dc/elements/1.1/
gn: <http://www.geonames.org/ontology#
bd: <http://www.bigdata.com/rdf#
hint: <http://www.bigdata.com/queryHints#
qb: <http://purl.org/linked-data/cube#
void: <http://rdfs.org/ns/void#

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. Use the functions to search for 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. Use the execute function to get feedback on intermediate queries. You can go back and forth between knowledge graph searches and SPARQL query executions to refine the query.
4. Use the answer or cancel function to finalize your answer and stop the generation process.

Additional rules:
1. Explain your thought process before and after each step and function call.
2. Do not assume or make up any entities or properties without verifying them with the knowledge graphs and functions.
3. 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.
4. 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.
5. 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.
6. For questions with a "True" or "False" answer the SPARQL query should be an ASK query.
7. 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.

[User] what was the name of benjamin franklin wife?

[Assistant] To answer the question about Benjamin Franklin's wife, we need to identify the entity for Benjamin Franklin and then find the property that represents his spouse. Let's start by searching for Benjamin Franklin in the knowledge graph.

[Tool]
Top 10 entity alternatives:
1. Benjamin Franklin, also known as The First American, Silence Dogood, Poor Richard, Ben Franklin, Franklin (wd:Q34969): American polymath and statesman (1706–1790), politician, polymath, diplomat, writer
2. Benjamin Franklin, also known as The First American, Silence Dogood, Poor Richard, Franklin, Ben Franklin (wd:Q34969): American polymath and statesman (1706–1790), politician, polymath, diplomat, writer
3. Statue of Benjamin Franklin, also known as Benjamin Franklin, Benjamin Franklin Statue (wd:Q4888607): statue in Washington, D.C.
4. Statue of Benjamin Franklin, also known as statue of Benjamin Franklin (Boston), Benjamin Franklin (wd:Q49474378): statue in Boston, Massachusetts
5. Benjamin Franklin (wd:Q23016654): sculpture in San Francisco
6. Benjamin Franklin, also known as Sir Benjamin Franklin (wd:Q4888611): military physician, British surgeon, surgeon
7. Benjamin Franklin (wd:Q4888609): 1974 miniseries
8. Benjamin Franklin (wd:Q4888604): 2002 television series
9. Statue of Benjamin Franklin, also known as Benjamin Franklin (wd:Q4888606): statue outside College Hall, University of Pennsylvania, Philadelphia
10. Statue of Benjamin Franklin, also known as Benjamin Franklin (wd:Q22021867): statue in Portland, Oregon

[Assistant] The top result for Benjamin Franklin is `wd:Q34969`. Now, let's find the property that represents his spouse. We can search for properties related to "spouse" or "wife" to find the appropriate property.

[Tool]
Top 10 property alternatives:
1. spouse, also known as married partner, married to, marry, partner, spouses (wd:P26 as prv/pq/pqn/ps/psn/psv/wdt/pr/wdtn/prn/pqv/p): the subject has the object as their spouse (husband, wife, partn...etc.). Use "unmarried partner" (P451) for non-married companions, significant person, relative
2. relative, also known as relatives, grandparent, relation, non-binary parent, niece (wd:P1038 as prv/pq/pqn/ps/psn/psv/wdt/pr/wdtn/prn/pqv/p): family member (qualify with "kinship to subject", P1039; for direct family member please use specific property), significant person
3. unmarried partner, also known as romantic partner, partner of, partners, posslq, relationship (wd:P451 as prv/pq/pqn/ps/psn/psv/wdt/pr/wdtn/prn/pqv/p): someone with whom the person is in a relationship without being married. Use "spouse" (P26) for married couples, significant person
4. married name, also known as full name (married) (wd:P2562 as prv/pq/pqn/ps/psn/psv/wdt/pr/wdtn/prn/pqv/p): name or surname adopted by a person upon marriage, name
5. place of marriage, also known as marriage location, wedding location, wed at, married in, married at (wd:P2842 as prv/pq/pqn/ps/psn/psv/wdt/pr/wdtn/prn/pqv/p): location where the marriage was celebrated. Use as qualifier for property "spouse" (P26), significant place
6. birth name, also known as née, name at birth, name before marriage, ne, né (wd:P1477 as prv/pq/pqn/ps/psn/psv/wdt/pr/wdtn/prn/pqv/p): full name of a person at birth, if different from their current, generally used name, name
7. connects with, also known as contacts, couples with, intersects at grade, links to, mates with (wd:P2789 as prv/pq/pqn/ps/psn/psv/wdt/pr/wdtn/prn/pqv/p): item with which the item is physically connected, physically interacts with
8. companion of, also known as has astronomical companion, has companion, companion, astronomic companion of, astronomic companion (wd:P399 as prv/pq/pqn/ps/psn/psv/wdt/pr/wdtn/prn/pqv/p): two or more astronomic bodies of the same type relating to each other
9. end time, also known as ends, stop time, endtime, fall date, ineffective (wd:P582 as prv/pq/pqn/ps/psn/psv/wdt/pr/wdtn/prn/pqv/p): moment when an entity ceases to exist and a statement stops being entirely valid or no longer be true, point in time
10. relation (wd:P2309 as prv/pq/pqn/ps/psn/psv/wdt/pr/wdtn/prn/pqv/p): qualifier to define a property constraint in combination with P2...h the property "relative" is "type of kinship" (P1039), not this

[Assistant]
The property for "spouse" is `wd:P26`. Now, let's construct a SPARQL query to find Benjamin Franklin's spouse.

We will query for the spouse of `wd:Q34969` (Benjamin Franklin) using the property `wd:P26`.

[Tool]
Got 1 row and 1 column:
| ?spouse                             |
| ----------------------------------- |
| Deborah Read Franklin (wd:Q3020859) |

[Assistant]
The spouse of Benjamin Franklin is Deborah Read Franklin. To provide a complete answer, we can include the label of the spouse in the SPARQL query.

Let's modify the query to include the label of the spouse.

[Tool]
Got 1 row and 2 columns:
| ?spouse                             | ?spouseLabel          |
| ----------------------------------- | --------------------- |
| Deborah Read Franklin (wd:Q3020859) | Deborah Read Franklin |

[Assistant]
The name of Benjamin Franklin's wife is Deborah Read Franklin.

Here is the final SPARQL query and answer:

```sparql
SELECT ?spouse ?spouseLabel
WHERE {
  wd:Q34969 wdt:P26 ?spouse .
  OPTIONAL { ?spouse rdfs:label ?spouseLabel FILTER(LANG(?spouseLabel) = 'en') }
}
```

The answer to the question is: **Deborah Read Franklin**.

[Tool] Stopped generation process