PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?itemLabel WHERE {
  ?item wdt:P2093 "Fred Smith" .
  OPTIONAL {
    ?item rdfs:label ?itemLabel .
    FILTER ( LANG( ?itemLabel ) = "en" )
  }
}

Using properties:
- author name string (wd:P2093 as wdt), also known as author indicated as, author named as, author string, byline, creator indicated as, etc.: stores unspecified author or editor name for publications; ... author (P50) or editor (P98) does not exist or is not known / stores unspecified author or editor name for publications; ... editor (P98) does not exist or is not known. Do not use both. / string to store unspecified author name for publications; use if Wikidata item for author (P50) does not exist or is not known

Got 10 rows and 2 columns:
| item                                                                                | itemLabel                                                                                |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| Can Unions Be Sued for Following the Law? (wd:Q128767199)                                                  | Can Unions Be Sued for Following the Law? (lang:en)                                                  |
| A Better Hope: Resources for a Church Confronting Capitalism, Democracy, and Postmodernity (wd:Q128929105) | A Better Hope: Resources for a Church Confronting Capitalism, Democracy, and Postmodernity (lang:en) |
| Computerized Deep Structure Indexing System – A critical appraisal (wd:Q129292383)                         | Computerized Deep Structure Indexing System – A critical appraisal (lang:en)                         |
| Term and cross reference structure in computerized Deep Structure Indexing System (wd:Q129294127)          | Term and cross reference structure in computerized Deep Structure Indexing System (lang:en)          |
| FORTRAN programming standards (wd:Q130959327)                                                              | FORTRAN programming standards (lang:en)                                                              |
| Global effect of PEG-IFN-alpha and ribavirin on gene expression in PBMC in vitro (wd:Q47190483)            | Global effect of PEG-IFN-alpha and ribavirin on gene expression in PBMC in vitro (lang:en)           |
| Northampton General Hospital. (wd:Q55115073)                                                               | Northampton General Hospital. (lang:en)                                                              |
| FOR THE PERIOD JANUARY-SEPTEMBER, 2003 (wd:Q58549138)                                                      | FOR THE PERIOD JANUARY-SEPTEMBER, 2003 (lang:en)                                                     |
| 24 Hour Service at Georgia Southern University: 1989–2007 (wd:Q58602086)                                   | 24 Hour Service at Georgia Southern University: 1989–2007 (lang:en)                                  |
| Cardiac epithelioid hemangioendothelioma with 8-year follow-up (wd:Q80335651)                              | Cardiac epithelioid hemangioendothelioma with 8-year follow-up (lang:en)                             |

Answer:
The items that have exactly the string "Fred Smith" listed under its author name string (wdt:P2093) are:

1. Can Unions Be Sued for Following the Law? (wd:Q128767199)
2. A Better Hope: Resources for a Church Confronting Capitalism, Democracy, and Postmodernity (wd:Q128929105)
3. Computerized Deep Structure Indexing System – A critical appraisal (wd:Q129292383)
4. Term and cross reference structure in computerized Deep Structure Indexing System (wd:Q129294127)
5. FORTRAN programming standards (wd:Q130959327)
6. Global effect of PEG-IFN-alpha and ribavirin on gene expression in PBMC in vitro (wd:Q47190483)
7. Northampton General Hospital. (wd:Q55115073)
8. FOR THE PERIOD JANUARY-SEPTEMBER, 2003 (wd:Q58549138)
9. 24 Hour Service at Georgia Southern University: 1989–2007 (wd:Q58602086)
10. Cardiac epithelioid hemangioendothelioma with 8-year follow-up (wd:Q80335651)

These are publications or documents where the author 'Fred Smith' is recorded as a literal string because no Wikidata item exists for the author.

The items that have exactly the string "Fred Smith" listed under its author name string (wdt:P2093) are:

1. Can Unions Be Sued for Following the Law? (wd:Q128767199)
2. A Better Hope: Resources for a Church Confronting Capitalism, Democracy, and Postmodernity (wd:Q128929105)
3. Computerized Deep Structure Indexing System – A critical appraisal (wd:Q129292383)
4. Term and cross reference structure in computerized Deep Structure Indexing System (wd:Q129294127)
5. FORTRAN programming standards (wd:Q130959327)
6. Global effect of PEG-IFN-alpha and ribavirin on gene expression in PBMC in vitro (wd:Q47190483)
7. Northampton General Hospital. (wd:Q55115073)
8. FOR THE PERIOD JANUARY-SEPTEMBER, 2003 (wd:Q58549138)
9. 24 Hour Service at Georgia Southern University: 1989–2007 (wd:Q58602086)
10. Cardiac epithelioid hemangioendothelioma with 8-year follow-up (wd:Q80335651)

These are publications or documents where the author 'Fred Smith' is recorded as a literal string because no Wikidata item exists for the author.

SPARQL query over wikidata:
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?itemLabel WHERE {
  ?item wdt:P2093 "Fred Smith" .
  OPTIONAL {
    ?item rdfs:label ?itemLabel .
    FILTER ( LANG( ?itemLabel ) = "en" )
  }
}

Using properties:
- author name string (wd:P2093 as wdt), also known as author indicated as, author named as, author string, byline, creator indicated as, etc.: stores unspecified author or editor name for publications; ... author (P50) or editor (P98) does not exist or is not known / stores unspecified author or editor name for publications; ... editor (P98) does not exist or is not known. Do not use both. / string to store unspecified author name for publications; use if Wikidata item for author (P50) does not exist or is not known

Execution result:
Got 10 rows and 2 columns:
| item                                                                                | itemLabel                                                                                |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| Can Unions Be Sued for Following the Law? (wd:Q128767199)                                                  | Can Unions Be Sued for Following the Law? (lang:en)                                                  |
| A Better Hope: Resources for a Church Confronting Capitalism, Democracy, and Postmodernity (wd:Q128929105) | A Better Hope: Resources for a Church Confronting Capitalism, Democracy, and Postmodernity (lang:en) |
| Computerized Deep Structure Indexing System – A critical appraisal (wd:Q129292383)                         | Computerized Deep Structure Indexing System – A critical appraisal (lang:en)                         |
| Term and cross reference structure in computerized Deep Structure Indexing System (wd:Q129294127)          | Term and cross reference structure in computerized Deep Structure Indexing System (lang:en)          |
| FORTRAN programming standards (wd:Q130959327)                                                              | FORTRAN programming standards (lang:en)                                                              |
| Global effect of PEG-IFN-alpha and ribavirin on gene expression in PBMC in vitro (wd:Q47190483)            | Global effect of PEG-IFN-alpha and ribavirin on gene expression in PBMC in vitro (lang:en)           |
| Northampton General Hospital. (wd:Q55115073)                                                               | Northampton General Hospital. (lang:en)                                                              |
| FOR THE PERIOD JANUARY-SEPTEMBER, 2003 (wd:Q58549138)                                                      | FOR THE PERIOD JANUARY-SEPTEMBER, 2003 (lang:en)                                                     |
| 24 Hour Service at Georgia Southern University: 1989–2007 (wd:Q58602086)                                   | 24 Hour Service at Georgia Southern University: 1989–2007 (lang:en)                                  |
| Cardiac epithelioid hemangioendothelioma with 8-year follow-up (wd:Q80335651)                              | Cardiac epithelioid hemangioendothelioma with 8-year follow-up (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] Which items have exactly the string "Fred Smith" listed under its author name string?

[Assistant]
To answer the question, "Which items have exactly the string 'Fred Smith' listed under its author name string?", I need to find items in Wikidata where the author name string (likely a property related to authorship) has the exact value "Fred Smith".

### Step 1: Identify the relevant property for "author name string"
The user is referring to an "author name string," which is likely a property that stores the name of an author as a literal string. In Wikidata, the most common property for author names is:
- **P2093**: "author name string" — used to store the name of an author as a literal string (e.g., "Fred Smith").

I will verify this property using `search_property` to confirm its existence and relevance.

Question: author name string

Top 10 property alternatives:
1. author name string (wd:P2093 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv), also known as author indicated as, author named as, author string, byline, creator indicated as, etc.: stores unspecified author or editor name for publications; ... editor (P98) does not exist or is not known. Do not use both. / stores unspecified author or editor name for publications; ... author (P50) or editor (P98) does not exist or is not known / string to store unspecified author name for publications; use if Wikidata item for author (P50) does not exist or is not known
2. object named as (wd:P1932 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via author named as), also known as as, author named as, credited as, location name string, named as, etc.: use as qualifier to indicate how the object's value was given in the source / use as qualifier to indicate how the value was given in the source / is subproperty of name
3. author given names (wd:P9687 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via author first name), also known as author first name, author first names, first name, given name, given names, etc.: qualifier for string representation of given or secondary ... in a bibliographic reference file (for example BibTeX) / is subproperty of given name
4. given name (wd:P735 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv), 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
5. website username or ID (wd:P554 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via account name), also known as account name, account name in social media, handle, public username, social media username, etc.: username or identifier on a website that the person or ... on, for use as qualifier of "website account on" (P553)
6. name of the character role (wd:P4633 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via character named as), also known as character name, character named as, character role named as, name of character role, name of role, etc.: name by which a character role is recorded in a database or ... a specific performance of a theatrical production of a play / name by which a character role is recorded in a database or ... a specific performance of a theatrical production of a play / is subproperty of name
7. lyricist (wd:P676 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via text author), also known as author, lyrics by, songwriter, text author, text by, etc.: author of song lyrics; also use P86 for music composer / is subproperty of author / author of song lyrics
8. theorized by (wd:P8403 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via author), also known as author, authored by, defined by, explained by, named by, etc.: subject who suggested or proposed this concept or immaterial invention / subject who suggested or proposed this concept or immaterial invention
9. author (wd:P50 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv), also known as co-author, creator, maker, playwright, poet, etc.: main creator(s) of a written work (use on works, not humans); ... name string) when Wikidata item is unknown or does not exist / main creator(s) of a written work (use on works, not humans) / main creator(s) of a written work (use on works, not humans) / is subproperty of creator
10. label in sign language (wd:P2919 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via name sign), also known as name in sign language, name sign, sign, sign language media, sign name, etc.: media file showing label of this item in sign language. Use ... work or name" (P407) as qualifier to indicate which language / media file showing label of this item in sign language. Use ... work or name" (P407) as qualifier to indicate which language

[Assistant]
The property **P2093** ("author name string") is the correct one for storing literal author names like "Fred Smith" when there is no Wikidata item for the author. This property is explicitly described as storing "unspecified author name for publications" and is meant for string values, not links to Wikidata items.

### Step 2: Construct a SPARQL query to find items with the exact string "Fred Smith" as the value of P2093
I will now write a SPARQL query to find all items (typically works like books, articles, etc.) that have **P2093** with the literal value **"Fred Smith"**.

The query will:
- Select items (`?item`) that have `wdt:P2093` with the value `"Fred Smith"`.
- Use `FILTER` to ensure exact string match (case-sensitive and exact).
- Return the item IRI and optionally its label for readability.

I will execute this query.

execute

SELECT ?item ?itemLabel WHERE { ?item wdt:P2093 "Fred Smith" . 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 must avoid using `SERVICE wikibase:label` and instead use `rdfs:label` with a language filter to get labels in English.

### Step 3: Rewrite the SPARQL query without `SERVICE wikibase:label`
I will now construct a correct SPARQL query that:
- Finds items with `wdt:P2093` equal to `"Fred Smith"`.
- Optionally retrieves the English label of those items using `rdfs:label` and `FILTER(LANG(?label) = "en")`.

I will execute this corrected query.

SELECT ?item ?itemLabel WHERE { ?item wdt:P2093 "Fred Smith" . OPTIONAL { ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en") } }

Got 10 rows and 2 columns:
| item                                                                                | itemLabel                                                                                |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| Can Unions Be Sued for Following the Law? (wd:Q128767199)                                                  | Can Unions Be Sued for Following the Law? (lang:en)                                                  |
| A Better Hope: Resources for a Church Confronting Capitalism, Democracy, and Postmodernity (wd:Q128929105) | A Better Hope: Resources for a Church Confronting Capitalism, Democracy, and Postmodernity (lang:en) |
| Computerized Deep Structure Indexing System – A critical appraisal (wd:Q129292383)                         | Computerized Deep Structure Indexing System – A critical appraisal (lang:en)                         |
| Term and cross reference structure in computerized Deep Structure Indexing System (wd:Q129294127)          | Term and cross reference structure in computerized Deep Structure Indexing System (lang:en)          |
| FORTRAN programming standards (wd:Q130959327)                                                              | FORTRAN programming standards (lang:en)                                                              |
| Global effect of PEG-IFN-alpha and ribavirin on gene expression in PBMC in vitro (wd:Q47190483)            | Global effect of PEG-IFN-alpha and ribavirin on gene expression in PBMC in vitro (lang:en)           |
| Northampton General Hospital. (wd:Q55115073)                                                               | Northampton General Hospital. (lang:en)                                                              |
| FOR THE PERIOD JANUARY-SEPTEMBER, 2003 (wd:Q58549138)                                                      | FOR THE PERIOD JANUARY-SEPTEMBER, 2003 (lang:en)                                                     |
| 24 Hour Service at Georgia Southern University: 1989–2007 (wd:Q58602086)                                   | 24 Hour Service at Georgia Southern University: 1989–2007 (lang:en)                                  |
| Cardiac epithelioid hemangioendothelioma with 8-year follow-up (wd:Q80335651)                              | Cardiac epithelioid hemangioendothelioma with 8-year follow-up (lang:en)                             |

[Assistant]
The query successfully returned 10 items that have the exact string **"Fred Smith"** listed as the author name string (`wdt:P2093`). These are primarily academic publications, reports, or documents where the author is not linked to a Wikidata item, and the name is stored as a literal string.

### Final Answer:
The items that have exactly the string **"Fred Smith"** listed under its author name string (`wdt:P2093`) are:

1. [Can Unions Be Sued for Following the Law?](http://www.wikidata.org/entity/Q128767199)
2. [A Better Hope: Resources for a Church Confronting Capitalism, Democracy, and Postmodernity](http://www.wikidata.org/entity/Q128929105)
3. [Computerized Deep Structure Indexing System – A critical appraisal](http://www.wikidata.org/entity/Q129292383)
4. [Term and cross reference structure in computerized Deep Structure Indexing System](http://www.wikidata.org/entity/Q129294127)
5. [FORTRAN programming standards](http://www.wikidata.org/entity/Q130959327)
6. [Global effect of PEG-IFN-alpha and ribavirin on gene expression in PBMC in vitro](http://www.wikidata.org/entity/Q47190483)
7. [Northampton General Hospital.](http://www.wikidata.org/entity/Q55115073)
8. [FOR THE PERIOD JANUARY-SEPTEMBER, 2003](http://www.wikidata.org/entity/Q58549138)
9. [24 Hour Service at Georgia Southern University: 1989–2007](http://www.wikidata.org/entity/Q58602086)
10. [Cardiac epithelioid hemangioendothelioma with 8-year follow-up](http://www.wikidata.org/entity/Q80335651)

These are all works where "Fred Smith" is recorded as the author name string, likely because no Wikidata item exists for the author.

### Final SPARQL Query:
```sparql
SELECT ?item ?itemLabel WHERE {
  ?item wdt:P2093 "Fred Smith" .
  OPTIONAL { ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en") }
}
```

I will now provide the final answer.

answer

SELECT ?item ?itemLabel WHERE { ?item wdt:P2093 "Fred Smith" . OPTIONAL { ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en") } }

Answer:
The items that have exactly the string "Fred Smith" listed under its author name string (wdt:P2093) are:

1. Can Unions Be Sued for Following the Law? (wd:Q128767199)
2. A Better Hope: Resources for a Church Confronting Capitalism, Democracy, and Postmodernity (wd:Q128929105)
3. Computerized Deep Structure Indexing System – A critical appraisal (wd:Q129292383)
4. Term and cross reference structure in computerized Deep Structure Indexing System (wd:Q129294127)
5. FORTRAN programming standards (wd:Q130959327)
6. Global effect of PEG-IFN-alpha and ribavirin on gene expression in PBMC in vitro (wd:Q47190483)
7. Northampton General Hospital. (wd:Q55115073)
8. FOR THE PERIOD JANUARY-SEPTEMBER, 2003 (wd:Q58549138)
9. 24 Hour Service at Georgia Southern University: 1989–2007 (wd:Q58602086)
10. Cardiac epithelioid hemangioendothelioma with 8-year follow-up (wd:Q80335651)

These are publications or documents where the author 'Fred Smith' is recorded as a literal string because no Wikidata item exists for the author.


PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?person ?year WHERE {
  ?person wdt:P31 wd:Q5 .
  ?person p:P166 ?stmt .
  ?stmt ps:P166 wd:Q55455135 .
  ?stmt pq:P585 ?year .
}
ORDER BY ?year

Using entities:
- honorary doctorate of the Bordeaux Montaigne University (wd:Q55455135): is instance of award / is subclass of honorary doctorate
- human (wd:Q5), also known as human being, humans, individual Homo sapiens, individual human, modern humans, etc.: is instance of class of organisms known by one particular common name / is instance of organisms known by a particular common name / is subclass of mammal / is subclass of natural person / is subclass of omnivore / is subclass of person / is subclass of individual animal / any member of Homo sapiens, unique extant species of the genus Homo / common name of Homo sapiens, unique extant species of the genus Homo / common name of Homo sapiens, unique extant species of the genus Homo / common name of Homo sapiens, unique extant species of the genus Homo, from embryo to adult

Using properties:
- award received (wd:P166 as p/ps), 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
- instance of (wd:P31 as wdt), also known as example of, has type, is a, is an, is of type, etc.: that class of which this subject is a particular example and ... a subclass of mountain (and an instance of volcanic landform) / type to which this subject corresponds/belongs. Different ... and the volcano is a type (instance) of volcanic landform
- point in time (wd:P585 as pq), also known as as of, at time, by date, date, during, etc.: date something took place, existed or a statement was true; for providing time use the "refine date" property (P4241) / time and date something took place, existed or a statement was true / time and date something took place, existed or a statement was true / time and date something took place, existed or a statement was true

Answer: 60 individuals have received an honorary doctorate from Bordeaux Montaigne University. The earliest recipient was in 1974 (Manuel Alvar, Ludwig Buisson, Christian Adolf Isermeyer, and Richard Hoggart), and the most recent was Trina Robbins in 2023. The results are ordered chronologically by year.

60 individuals have received an honorary doctorate from Bordeaux Montaigne University. The earliest recipient was in 1974 (Manuel Alvar, Ludwig Buisson, Christian Adolf Isermeyer, and Richard Hoggart), and the most recent was Trina Robbins in 2023. The results are ordered chronologically by year.

SPARQL query over wikidata:
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?person ?year WHERE {
  ?person wdt:P31 wd:Q5 .
  ?person p:P166 ?stmt .
  ?stmt ps:P166 wd:Q55455135 .
  ?stmt pq:P585 ?year .
}
ORDER BY ?year

Using entities:
- honorary doctorate of the Bordeaux Montaigne University (wd:Q55455135): is instance of award / is subclass of honorary doctorate
- human (wd:Q5), also known as human being, humans, individual Homo sapiens, individual human, modern humans, etc.: is instance of class of organisms known by one particular common name / is instance of organisms known by a particular common name / is subclass of mammal / is subclass of natural person / is subclass of omnivore / is subclass of person / is subclass of individual animal / any member of Homo sapiens, unique extant species of the genus Homo / common name of Homo sapiens, unique extant species of the genus Homo / common name of Homo sapiens, unique extant species of the genus Homo / common name of Homo sapiens, unique extant species of the genus Homo, from embryo to adult

Using properties:
- award received (wd:P166 as p/ps), 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
- instance of (wd:P31 as wdt), also known as example of, has type, is a, is an, is of type, etc.: that class of which this subject is a particular example and ... a subclass of mountain (and an instance of volcanic landform) / type to which this subject corresponds/belongs. Different ... and the volcano is a type (instance) of volcanic landform
- point in time (wd:P585 as pq), also known as as of, at time, by date, date, during, etc.: date something took place, existed or a statement was true; for providing time use the "refine date" property (P4241) / time and date something took place, existed or a statement was true / time and date something took place, existed or a statement was true / time and date something took place, existed or a statement was true

Execution result:
Got 60 rows and 2 columns, showing the first 5 and last 5 rows below:
| person                                   | year                                |
| ---------------------------------------- | ----------------------------------- |
| Manuel Alvar (wd:Q1891429)               | 1974-01-01T00:00:00Z (xsd:dateTime) |
| Ludwig Buisson (wd:Q1563209)             | 1974-01-01T00:00:00Z (xsd:dateTime) |
| Christian Adolf Isermeyer (wd:Q15226554) | 1974-01-01T00:00:00Z (xsd:dateTime) |
| Richard Hoggart (wd:Q1534871)            | 1974-01-01T00:00:00Z (xsd:dateTime) |
| Nicolás Guillén (wd:Q334118)             | 1976-01-01T00:00:00Z (xsd:dateTime) |
| ...                                      | ...                                 |
| Kaija Saariaho (wd:Q241432)              | 2015-01-01T00:00:00Z (xsd:dateTime) |
| Richard Dyer (wd:Q7325332)               | 2018-12-06T00:00:00Z (xsd:dateTime) |
| Patricio Guzmán (wd:Q2057315)            | 2019-03-12T00:00:00Z (xsd:dateTime) |
| Ibrahima Thioub (wd:Q1656025)            | 2020-01-20T00:00:00Z (xsd:dateTime) |
| Trina Robbins (wd:Q458714)               | 2023-11-30T00:00:00Z (xsd:dateTime) |

[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] Who has received an honorary doctorate from Bordeaux Montaigne University? Please also include the year they received the doctorate and order results by year

[Assistant]
To answer the question, I need to find individuals who have received an honorary doctorate from Bordeaux Montaigne University, along with the year they received it, and order the results by year.

### Step 1: Identify the entity for Bordeaux Montaigne University
First, I need to find the Wikidata item for "Bordeaux Montaigne University".

I'll use `search_entity` to look for this university.

Question: Bordeaux Montaigne University

Top 10 entity alternatives:
1. Bordeaux Montaigne University (wd:Q13342), also known as Michel de Montaigne University, University of Bordeaux 3: is instance of university in France / French university founded in 1971
2. honorary doctorate of the Bordeaux Montaigne University (wd:Q55455135): is subclass of honorary doctorate / is instance of award
3. University of Bordeaux (wd:Q13344), also known as UB, u-bordeaux.fr: is instance of university in France / university in France
4. Bordeaux Segalen University (wd:Q13340), also known as University of Bordeaux 2: former French university abolished and replaced in 2014 / is instance of university in France
5. IUT Bordeaux Montaigne (wd:Q3152663), also known as IUT Michel de Montaigne, University Institute of Journalism Technology of Bordeaux: is instance of University Institute of Technology / is instance of University Technical Institute
6. Bordeaux University Foundation (wd:Q117197454): is instance of foundation
7. University of Bordeaux (wd:Q20791505): French university from 1896 to 1971 / is instance of university
8. University of Bordeaux 1 (wd:Q13338): former French university founded in 1971, replaced and abolished in 2014 / is instance of university in France
9. prix Montaigne de Bordeaux (wd:Q16671140): is instance of literary award / French literary prize
10. Bordeaux University Law Library (wd:Q97667454): University law and economics library / is instance of academic library / is instance of law library / is instance of Law library

[Assistant]
The correct entity for Bordeaux Montaigne University is `wd:Q13342` (Michel de Montaigne University, University of Bordeaux 3).

### Step 2: Identify the property for "honorary doctorate"
Next, I need to find the property used to represent "honorary doctorate" in Wikidata. I'll use `search_property` to look for properties related to "honorary doctorate".

Question: honorary doctorate

Top 10 property alternatives:
1. award received (wd:P166 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via honorary title), 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
2. commemorates (wd:P547 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via honors), also known as anniversary of, birthday of, celebrates, commemorandum, honors, etc.: what the place, monument, memorial, or holiday, commemorates / what the place, monument, memorial, or holiday, commemorates / what the place, monument, memorial, holiday, commemorates / is subproperty of main subject
3. educated at (wd:P69 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via graduate of), 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
4. patient of (wd:P3205 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via doctor), also known as doctor, physician, P3205: was treated or studied as a patient by this person / is subproperty of significant person
5. professorship (wd:P803 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via named professorship), also known as chair, endowed chair, endowed professorship, named chair, named professorship, etc.: professorship position held by this academic person / is subproperty of position held
6. academic appointment (wd:P8413 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv), also known as P8413: this person has been appointed to a role within the given ... or department; distinct from employment or affiliation
7. academic degree (wd:P512 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via diploma), also known as academic diploma, degree, diploma, P512: academic degree that the person holds / academic degree that the person holds / academic degree that the person holds / academic degree that the person holds
8. doctoral student (wd:P185 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via doctoral candidate), also known as doctoral candidate, Ph.D. student, supervised doctoral student, supervisee, P185: doctoral student(s) of a professor / doctoral student(s) of a professor / is subproperty of student
9. academic thesis (wd:P1026 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via doctoral dissertation), also known as A.B. thesis, bachelor's thesis, bachelor thesis, B.A. thesis, B.S. thesis, etc.: thesis or dissertation written for a degree / thesis or dissertation written for a degree
10. trophy awarded (wd:P4622 as psn/wdtn/p/prv/prn/pq/ps/psv/pr/wdt/pqn/pqv, matched via diploma awarded), also known as cup awarded, diploma awarded, medal awarded, P4622: trophy awarded at the end of a selection process or of a ... or finishers under the form of a cup, a medal, a diploma

[Assistant]
The property for "award received" is `wdt:P166`. This is the most relevant property for honorary doctorates, as they are awards given to individuals.

### Step 3: Find the item for "honorary doctorate from Bordeaux Montaigne University"
Now, I need to find the specific award item for "honorary doctorate from Bordeaux Montaigne University". I'll use `search_object_of_property` to search for objects (awards) associated with `wdt:P166` and the query "honorary doctorate Bordeaux Montaigne University".

Question: honorary doctorate Bordeaux Montaigne University

Top 10 entity alternatives:
1. honorary doctorate of the Bordeaux Montaigne University (wd:Q55455135): is subclass of honorary doctorate / is instance of award
2. honorary doctor of Harvard University (wd:Q39384825, matched via honorary doctorate from Harvard University), also known as honorary doctorate from Harvard University: is subclass of honorary doctorate / is instance of award
3. honorary doctorate from Princeton University (wd:Q42309226): is subclass of honorary doctorate / is instance of honorary degree / is instance of Honorary degree
4. honorary doctorate of Barcelona University (wd:Q50616507): is subclass of honorary doctorate / is instance of award
5. honorary doctorate of Lund University (wd:Q66881732): is subclass of honorary doctorate / is instance of award
6. honorary doctorate of Seville University (wd:Q50610776): is subclass of honorary doctorate / is instance of award
7. honorary doctorate of Haifa University (wd:Q42591771): is subclass of honorary doctorate / is instance of award
8. honorary doctorate from Brown University (wd:Q41795411): is subclass of honorary doctorate / is instance of award
9. honorary doctorate from the McGill University (wd:Q62061080, matched via honorary doctorate from McGill University), also known as honorary doctorate from McGill University: rank of honorary doctorate or doctor honoris causa / is subclass of honorary doctorate / is instance of award
10. Honorary doctorate of Umeå University (wd:Q55787581): is subclass of honorary doctorate / is instance of award

No other items found

No literal items found

[Assistant]
The item for "honorary doctorate of the Bordeaux Montaigne University" is `wd:Q55455135`. This is the specific award we are looking for.

### Step 4: Construct the SPARQL query
Now, I need to find all individuals who have received this award (`wd:Q55455135`) and retrieve the year they received it. The year is stored as a qualifier (`pq:P585`) on the award statement.

The query structure will be:
- Find people (`?person`) who received the award (`wd:Q55455135`) via `wdt:P166`.
- Use the statement pattern (`p:P166`) to access qualifiers.
- Extract the award year using `pq:P585`.
- Filter to ensure the person is a human (`wdt:P31 wd:Q5`).
- Order results by year (`ORDER BY ?year`).

I'll write the SPARQL query accordingly.

execute

SELECT ?person ?year WHERE { ?person wdt:P31 wd:Q5 ; wdt:P166 wd:Q55455135 . ?stmt p:P166 ?person ; ps:P166 wd:Q55455135 ; pq:P585 ?year . } ORDER BY ?year

[Assistant]
The query returned no results, which suggests that the direct use of `wdt:P166` might not be capturing the award correctly. Instead, we should use the statement pattern (`p:P166`) to ensure we are correctly linking the person to the award and extracting the qualifier.

Let me revise the query. The issue might be in how the subject of the statement is referenced. The correct pattern is:
- `?person p:P166 ?stmt` — the person has a statement about an award.
- `?stmt ps:P166 wd:Q55455135` — the statement's value is the honorary doctorate from Bordeaux Montaigne University.
- `?stmt pq:P585 ?year` — the statement has a qualifier for the year.

I'll fix the query accordingly.

SELECT ?person ?year WHERE { ?person wdt:P31 wd:Q5 . ?person p:P166 ?stmt . ?stmt ps:P166 wd:Q55455135 . ?stmt pq:P585 ?year . } ORDER BY ?year

[Assistant]
The query successfully returned 60 results of individuals who received an honorary doctorate from Bordeaux Montaigne University, along with the year they received it, ordered chronologically.

### Final Answer
The SPARQL query correctly retrieves the list of recipients and the years they received the honorary doctorate. The results include notable individuals such as Manuel Alvar (1974), Nicolás Guillén (1976), and Trina Robbins (2023), among others.

I will now provide the final answer with the SPARQL query and the results summary.

answer

SELECT ?person ?year WHERE { ?person wdt:P31 wd:Q5 . ?person p:P166 ?stmt . ?stmt ps:P166 wd:Q55455135 . ?stmt pq:P585 ?year . } ORDER BY ?year

Answer: 60 individuals have received an honorary doctorate from Bordeaux Montaigne University. The earliest recipient was in 1974 (Manuel Alvar, Ludwig Buisson, Christian Adolf Isermeyer, and Richard Hoggart), and the most recent was Trina Robbins in 2023. The results are ordered chronologically by year.


PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?praenomen ?label WHERE {
  ?praenomen wdt:P31 wd:Q1240901 .
  ?praenomen rdfs:label ?label .
  FILTER ( LANG( ?label ) = "la" )
}

Using entities:
- praenomen (wd:Q1240901), also known as first names of Romans, Roman first names, Roman given names, Roman praenomen: is instance of name particle / is subclass of first name / first aspect of a personal name ancient Rome

Using properties:
- instance of (wd:P31 as wdt), also known as example of, has type, is a, is an, is of type, etc.: that class of which this subject is a particular example and ... a subclass of mountain (and an instance of volcanic landform) / type to which this subject corresponds/belongs. Different ... and the volcano is a type (instance) of volcanic landform

Got 66 rows and 2 columns, showing the first 5 and last 5 rows below:
| praenomen               | label              |
| ----------------------- | ------------------ |
| Fausta (wd:Q100325240)  | Fausta (lang:la)   |
| Potitus (wd:Q100742089) | Potitus (lang:la)  |
| Paculla (wd:Q100785430) | Paculla (lang:la)  |
| Hispala (wd:Q100933398) | Hispala (lang:la)  |
| Novius (wd:Q100934274)  | Novius (lang:la)   |
| ...                     | ...                |
| Herius (wd:Q94301903)   | Herius (lang:la)   |
| Pacuvius (wd:Q94554559) | Pacuvius (lang:la) |
| Numa (wd:Q98346041)     | Numa (lang:la)     |
| Ancus (wd:Q98660919)    | Ancus (lang:la)    |
| Sthenius (wd:Q99228944) | Sthenius (lang:la) |

Answer: There are 66 known Roman praenomen in Wikidata with their native Latin labels. Examples include: Fausta, Potitus, Paculla, Hispala, Novius, Herius, Pacuvius, Numa, Ancus, and Sthenius. The full list includes all Latin-labeled praenomen instances of wd:Q1240901.

There are 66 known Roman praenomen in Wikidata with their native Latin labels. Examples include: Fausta, Potitus, Paculla, Hispala, Novius, Herius, Pacuvius, Numa, Ancus, and Sthenius. The full list includes all Latin-labeled praenomen instances of wd:Q1240901.

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

Using entities:
- praenomen (wd:Q1240901), also known as first names of Romans, Roman first names, Roman given names, Roman praenomen: is instance of name particle / is subclass of first name / first aspect of a personal name ancient Rome

Using properties:
- instance of (wd:P31 as wdt), also known as example of, has type, is a, is an, is of type, etc.: that class of which this subject is a particular example and ... a subclass of mountain (and an instance of volcanic landform) / type to which this subject corresponds/belongs. Different ... and the volcano is a type (instance) of volcanic landform

Execution result:
Got 66 rows and 2 columns, showing the first 5 and last 5 rows below:
| praenomen               | label              |
| ----------------------- | ------------------ |
| Fausta (wd:Q100325240)  | Fausta (lang:la)   |
| Potitus (wd:Q100742089) | Potitus (lang:la)  |
| Paculla (wd:Q100785430) | Paculla (lang:la)  |
| Hispala (wd:Q100933398) | Hispala (lang:la)  |
| Novius (wd:Q100934274)  | Novius (lang:la)   |
| ...                     | ...                |
| Herius (wd:Q94301903)   | Herius (lang:la)   |
| Pacuvius (wd:Q94554559) | Pacuvius (lang:la) |
| Numa (wd:Q98346041)     | Numa (lang:la)     |
| Ancus (wd:Q98660919)    | Ancus (lang:la)    |
| Sthenius (wd:Q99228944) | Sthenius (lang:la) |

[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 praenomen in anicent Rome, and what are their native labels (e.g. 'Octavus'), if available?

[Assistant]
To answer the question about praenomen in ancient Rome and their native labels, I need to:

1. Understand what "praenomen" means in the context of ancient Rome: Praenomen were personal names used by individuals in ancient Rome, typically the first part of a Roman name (e.g., Gaius, Marcus, Lucius, Octavus).

2. Determine if Wikidata contains entities representing Roman praenomen and whether they have native labels (e.g., in Latin).

3. Construct a SPARQL query to retrieve:
   - The praenomen entities (likely instances of "Roman praenomen" or similar)
   - Their native labels (in Latin, if available)

First, I will search for entities related to "praenomen" in Wikidata to identify the correct item or property.

Question: praenomen

Top 10 entity alternatives:
1. praenomen (wd:Q1240901), also known as first names of Romans, Roman first names, Roman given names, Roman praenomen: first aspect of a personal name ancient Rome / is instance of name particle / is subclass of first name
2. Marcus (wd:Q6757977, matched via Marcus (praenomen)), also known as M., Marcus (praenomen), Marcvs: is instance of praenomen / ancient Roman praenomen
3. Tiberius (wd:Q21485162, matched via Tiberius (praenomen)), also known as Ti., Tib., Tiberius (praenomen): is instance of praenomen / ancient Roman praenomen
4. A Note on the use of the Praenomen (wd:Q56209493): is instance of scholarly article / is instance of academic article

[Assistant]
Great! I now see that Wikidata has a specific entity for "praenomen" (wd:Q1240901), which is described as a "name particle" and a subclass of "first name". Additionally, there are specific instances of praenomen like Marcus (wd:Q6757977) and Tiberius (wd:Q21485162), which are instances of "praenomen".

I need to:
1. Retrieve all entities that are instances of "praenomen" (wd:Q1240901).
2. Get their labels in Latin (native language) if available. Since Latin is the native language of ancient Rome, I will look for labels with language tag "la".

I will now construct a SPARQL query to:
- Find all items that are instances of wd:Q1240901 (praenomen)
- Retrieve their rdfs:label, filtering for Latin language ("la")

Let me execute this query.

execute

SELECT ?praenomen ?label WHERE { ?praenomen wdt:P31 wd:Q1240901 . ?praenomen rdfs:label ?label . FILTER(LANG(?label) = "la") }

Got 66 rows and 2 columns, showing the first 5 and last 5 rows below:
| praenomen               | label              |
| ----------------------- | ------------------ |
| Fausta (wd:Q100325240)  | Fausta (lang:la)   |
| Potitus (wd:Q100742089) | Potitus (lang:la)  |
| Paculla (wd:Q100785430) | Paculla (lang:la)  |
| Hispala (wd:Q100933398) | Hispala (lang:la)  |
| Novius (wd:Q100934274)  | Novius (lang:la)   |
| ...                     | ...                |
| Herius (wd:Q94301903)   | Herius (lang:la)   |
| Pacuvius (wd:Q94554559) | Pacuvius (lang:la) |
| Numa (wd:Q98346041)     | Numa (lang:la)     |
| Ancus (wd:Q98660919)    | Ancus (lang:la)    |
| Sthenius (wd:Q99228944) | Sthenius (lang:la) |

[Assistant]
The query successfully retrieved 66 Roman praenomen entities with their native Latin labels. The results include well-known praenomen like "Numa" and "Ancus", as well as less common ones like "Paculla" and "Hispala".

The labels are correctly returned in Latin (language tag "la"), as requested. Each result shows the entity IRI and its Latin label.

I now have a complete and accurate answer to the question. I will provide the final SPARQL query and the answer.

Note: The query returns the IRIs of the praenomen entities and their Latin labels. If the user wants a list of just the labels, they can extract them from the result. Since the question asks for "their native labels (e.g. 'Octavus')", the Latin labels are the direct answer.

I will now finalize the answer.

answer

SELECT ?praenomen ?label WHERE { ?praenomen wdt:P31 wd:Q1240901 . ?praenomen rdfs:label ?label . FILTER(LANG(?label) = "la") }

Answer: There are 66 known Roman praenomen in Wikidata with their native Latin labels. Examples include: Fausta, Potitus, Paculla, Hispala, Novius, Herius, Pacuvius, Numa, Ancus, and Sthenius. The full list includes all Latin-labeled praenomen instances of wd:Q1240901.