PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?person ?personLabel ?birthplace ?birthplaceLabel WHERE {
  ?person wdt:P31 wd:Q5 .
  ?person wdt:P19 ?birthplace .
  FILTER NOT EXISTS {
    ?person wdt:P21 ?sex .
  }
  {
    FILTER ( ?birthplace = wd:Q408 )
  } UNION {
    ?birthplace wdt:P17 wd:Q408 .
  } UNION {
    ?birthplace wdt:P131 * ?admin .
    ?admin wdt:P17 wd:Q408 .
  }
  OPTIONAL {
    ?person rdfs:label ?personLabel .
    FILTER ( LANG( ?personLabel ) = "en" )
  }
  OPTIONAL {
    ?birthplace rdfs:label ?birthplaceLabel .
    FILTER ( LANG( ?birthplaceLabel ) = "en" )
  }
}
ORDER BY ?personLabel
LIMIT 100

Using entities:
- Australia (wd:Q408), also known as AU, AUS, Aussieland, Commonwealth of Australia, Down Under, etc.: is instance of sovereign state / is instance of federation / is instance of country / country in Oceania / country in Oceania / country in Oceania / country in Oceania
- 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:
- located in the administrative territorial entity (wd:P131 as wdt), also known as administrative territorial entity, administrative territory, city, happens in, in, etc.: is subproperty of location / is subproperty of part of / the item is located on the territory of the following administrative entity / the item is located on the territory of the following administrative entity / the item is located on the territory of the following ... the item falls only partially into the administrative entity. / the item is located on the territory of the following ... the item falls only partially into the administrative entity.
- country (wd:P17 as wdt), also known as host country, land, sovereign state, state, P17: is subproperty of located in the administrative territorial entity / sovereign state that this item is in (not to be used for human beings) / sovereign state that this item is in (not to be used for human beings) / sovereign state that this item is in (not to be used for human beings) / sovereign state that this item is in (not to be used for human beings)
- place of birth (wd:P19 as wdt), also known as birth city, birth location, birth place, birthplace, born, etc.: is subproperty of location / most specific known birth location of a person, animal or fictional character / most specific known (e.g. city instead of country, or ... birth location of a person, animal or fictional character / most specific known (e.g. city instead of country, or ... birth location of a person, animal or fictional character
- sex or gender (wd:P21 as wdt), also known as biological sex, gender, gender expression, gender identity, gender or sex, etc.: sex or gender identity: male (Q6581097), female (Q6581072), ... (Q43445). Groups of same gender use subclass of (P279) / sex or gender identity of human or animal. For human: male, ... female organism. Groups of same gender use subclass of (P279) / sexual identity of subject: male (Q6581097), female ... (Q43445). Groups of same gender use "subclass of" (P279)
- 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 50 rows and 4 columns, showing the first 5 and last 5 rows below:
| person                               | personLabel                    | birthplace                 | birthplaceLabel        |
| ------------------------------------ | ------------------------------ | -------------------------- | ---------------------- |
| wd:Q31706780                         |                                | Sydney (wd:Q3130)          | Sydney (lang:en)       |
| wd:Q61059979                         |                                | Queensland (wd:Q36074)     | Queensland (lang:en)   |
| Alair Pambegan (wd:Q125526514)       | Alair Pambegan (lang:en)       | Aurukun (wd:Q1879882)      | Aurukun (lang:en)      |
| Andrew Gordon Wilson (wd:Q125072006) | Andrew Gordon Wilson (lang:en) | Bendigo (wd:Q497793)       | Bendigo (lang:en)      |
| Bert Bertram (wd:Q132735762)         | Bert Bertram (lang:en)         | Peterborough (wd:Q3900971) | Peterborough (lang:en) |
| ...                                  | ...                            | ...                        | ...                    |
| William James Little (wd:Q133815014) | William James Little (lang:en) | Hobart (wd:Q40191)         | Hobart (lang:en)       |
| Wynne Whiteford (wd:Q15971533)       | Wynne Whiteford (lang:en)      | Melbourne (wd:Q3141)       | Melbourne (lang:en)    |
| Xavier Luck (wd:Q124479810)          | Xavier Luck (lang:en)          | Sydney (wd:Q3130)          | Sydney (lang:en)       |
| Zafril Ansgar Hamzah (wd:Q119618397) | Zafril Ansgar Hamzah (lang:en) | Canberra (wd:Q3114)        | Canberra (lang:en)     |
| Zomi Frankcom (wd:Q125289276)        | Zomi Frankcom (lang:en)        | Melbourne (wd:Q3141)       | Melbourne (lang:en)    |

Answer:
I ran a SPARQL query that finds humans (wd:Q5) whose place of birth (P19) is either Australia (wd:Q408), has country P17 = Australia, or is located (via a chain of P131 administrative parents) within an administrative entity whose country (P17) is Australia — and who do not have a sex or gender statement (no P21). The query (shown above) returns the item IRIs. When I executed it (limit 100), it returned 50 matching humans. Examples (IRIs with English labels when available) include:
- wd:Q125526514 — Alair Pambegan
- wd:Q125072006 — Andrew Gordon Wilson
- wd:Q132735762 — Bert Bertram
- wd:Q15971533 — Wynne Whiteford
- wd:Q119618397 — Zafril Ansgar Hamzah
- wd:Q124479810 — Xavier Luck
- wd:Q125289276 — Zomi Frankcom
(There are 50 rows in total from the executed query; some persons have no English rdfs:label on Wikidata and appear without a label.)

If you want the full list as IRIs (or with more columns such as date of birth), I can run the query again without a LIMIT or export all results in CSV. The SPARQL query used is exactly the one shown above.

I ran a SPARQL query that finds humans (wd:Q5) whose place of birth (P19) is either Australia (wd:Q408), has country P17 = Australia, or is located (via a chain of P131 administrative parents) within an administrative entity whose country (P17) is Australia — and who do not have a sex or gender statement (no P21). The query (shown above) returns the item IRIs. When I executed it (limit 100), it returned 50 matching humans. Examples (IRIs with English labels when available) include:
- wd:Q125526514 — Alair Pambegan
- wd:Q125072006 — Andrew Gordon Wilson
- wd:Q132735762 — Bert Bertram
- wd:Q15971533 — Wynne Whiteford
- wd:Q119618397 — Zafril Ansgar Hamzah
- wd:Q124479810 — Xavier Luck
- wd:Q125289276 — Zomi Frankcom
(There are 50 rows in total from the executed query; some persons have no English rdfs:label on Wikidata and appear without a label.)

If you want the full list as IRIs (or with more columns such as date of birth), I can run the query again without a LIMIT or export all results in CSV. The SPARQL query used is exactly the one shown above.

SPARQL query over wikidata:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?person ?personLabel ?birthplace ?birthplaceLabel WHERE {
  ?person wdt:P31 wd:Q5 .
  ?person wdt:P19 ?birthplace .
  FILTER NOT EXISTS {
    ?person wdt:P21 ?sex .
  }
  {
    FILTER ( ?birthplace = wd:Q408 )
  } UNION {
    ?birthplace wdt:P17 wd:Q408 .
  } UNION {
    ?birthplace wdt:P131 * ?admin .
    ?admin wdt:P17 wd:Q408 .
  }
  OPTIONAL {
    ?person rdfs:label ?personLabel .
    FILTER ( LANG( ?personLabel ) = "en" )
  }
  OPTIONAL {
    ?birthplace rdfs:label ?birthplaceLabel .
    FILTER ( LANG( ?birthplaceLabel ) = "en" )
  }
}
ORDER BY ?personLabel
LIMIT 100

Using entities:
- Australia (wd:Q408), also known as AU, AUS, Aussieland, Commonwealth of Australia, Down Under, etc.: is instance of sovereign state / is instance of federation / is instance of country / country in Oceania / country in Oceania / country in Oceania / country in Oceania
- 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:
- located in the administrative territorial entity (wd:P131 as wdt), also known as administrative territorial entity, administrative territory, city, happens in, in, etc.: is subproperty of location / is subproperty of part of / the item is located on the territory of the following administrative entity / the item is located on the territory of the following administrative entity / the item is located on the territory of the following ... the item falls only partially into the administrative entity. / the item is located on the territory of the following ... the item falls only partially into the administrative entity.
- country (wd:P17 as wdt), also known as host country, land, sovereign state, state, P17: is subproperty of located in the administrative territorial entity / sovereign state that this item is in (not to be used for human beings) / sovereign state that this item is in (not to be used for human beings) / sovereign state that this item is in (not to be used for human beings) / sovereign state that this item is in (not to be used for human beings)
- place of birth (wd:P19 as wdt), also known as birth city, birth location, birth place, birthplace, born, etc.: is subproperty of location / most specific known birth location of a person, animal or fictional character / most specific known (e.g. city instead of country, or ... birth location of a person, animal or fictional character / most specific known (e.g. city instead of country, or ... birth location of a person, animal or fictional character
- sex or gender (wd:P21 as wdt), also known as biological sex, gender, gender expression, gender identity, gender or sex, etc.: sex or gender identity: male (Q6581097), female (Q6581072), ... (Q43445). Groups of same gender use subclass of (P279) / sex or gender identity of human or animal. For human: male, ... female organism. Groups of same gender use subclass of (P279) / sexual identity of subject: male (Q6581097), female ... (Q43445). Groups of same gender use "subclass of" (P279)
- 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 50 rows and 4 columns, showing the first 5 and last 5 rows below:
| person                               | personLabel                    | birthplace                 | birthplaceLabel        |
| ------------------------------------ | ------------------------------ | -------------------------- | ---------------------- |
| wd:Q31706780                         |                                | Sydney (wd:Q3130)          | Sydney (lang:en)       |
| wd:Q61059979                         |                                | Queensland (wd:Q36074)     | Queensland (lang:en)   |
| Alair Pambegan (wd:Q125526514)       | Alair Pambegan (lang:en)       | Aurukun (wd:Q1879882)      | Aurukun (lang:en)      |
| Andrew Gordon Wilson (wd:Q125072006) | Andrew Gordon Wilson (lang:en) | Bendigo (wd:Q497793)       | Bendigo (lang:en)      |
| Bert Bertram (wd:Q132735762)         | Bert Bertram (lang:en)         | Peterborough (wd:Q3900971) | Peterborough (lang:en) |
| ...                                  | ...                            | ...                        | ...                    |
| William James Little (wd:Q133815014) | William James Little (lang:en) | Hobart (wd:Q40191)         | Hobart (lang:en)       |
| Wynne Whiteford (wd:Q15971533)       | Wynne Whiteford (lang:en)      | Melbourne (wd:Q3141)       | Melbourne (lang:en)    |
| Xavier Luck (wd:Q124479810)          | Xavier Luck (lang:en)          | Sydney (wd:Q3130)          | Sydney (lang:en)       |
| Zafril Ansgar Hamzah (wd:Q119618397) | Zafril Ansgar Hamzah (lang:en) | Canberra (wd:Q3114)        | Canberra (lang:en)     |
| Zomi Frankcom (wd:Q125289276)        | Zomi Frankcom (lang:en)        | Melbourne (wd:Q3141)       | Melbourne (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 humans who were born in Australia or in any administrative territorial entity within Australia do not have a specified sex or gender?

[Assistant]
I'll first find the Wikidata item for "Australia" so I can use its Q-id reliably. Then I'll look up the relevant properties: "sex or gender" (to check P21), "place of birth" (P19), and "located in the administrative territorial entity" (P131) or "country" (P17) to traverse administrative parents. After confirming these identifiers I'll build and run a SPARQL query that finds humans (instance of Q5) with a place of birth in Australia (directly or via admin parent chain) and with no P21 (sex/gender) statement.

I'll start by searching for the entity "Australia".

Question: Australia

Top 10 entity alternatives:
1. Australia (wd:Q408), also known as AU, AUS, Aussieland, Commonwealth of Australia, Down Under, etc.: is instance of sovereign state / is instance of federation / is instance of country / country in Oceania / country in Oceania / country in Oceania / country in Oceania
2. Australian continent (wd:Q3960, matched via Australia), also known as Australia, Australia (continent), Australinea, Meganesia, New Holland, etc.: continent in the Earth's Southern Hemisphere / continent in Earth's Southern Hemisphere / is instance of continent / continent
3. Australia (wd:Q275180): 2008 film by Baz Luhrmann / is instance of film
4. Australia (wd:Q205546): 1989 film by Jean-Jacques Andrien / is instance of film
5. Australia (wd:Q4823546): 1996 single by Manic Street Preachers / is instance of single
6. Australia (wd:Q16835533): is instance of Horse / is instance of horse / Racehorse
7. Australia (wd:Q781244): is instance of board game / board game
8. Australia (wd:Q4823541), also known as Australia (KA–5): yacht that raced in the Americas Cup / is instance of sailing yacht
9. Australia (wd:Q12887638): village and ''consejo popular'' in Cuba / is instance of human settlement
10. Australia (wd:Q25907685): albedo feature on the planet Mercury / is instance of albedo feature

[Assistant]
Now I'll search for the property corresponding to "sex or gender" to confirm its property id (expected P21). I'll also search for "place of birth" (expected P19), "located in the administrative territorial entity" (expected P131), and "country" (expected P17) to verify their ids. I'll do these property searches one by one and explain each result.

Question: sex or gender

Top 10 property alternatives:
1. sex or gender (wd:P21 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as biological sex, gender, gender expression, gender identity, gender or sex, etc.: sexual identity of subject: male (Q6581097), female ... (Q43445). Groups of same gender use "subclass of" (P279) / sex or gender identity: male (Q6581097), female (Q6581072), ... (Q43445). Groups of same gender use subclass of (P279) / sex or gender identity of human or animal. For human: male, ... female organism. Groups of same gender use subclass of (P279)
2. requires grammatical feature (wd:P5713 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via uses gender), also known as grammatical feature required, required grammatical feature, requires case, requires mood, uses case, etc.: grammatical features required or generally used with lexeme or form of lexeme
3. grammatical gender (wd:P5185 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via gender), also known as gender, P5185: grammatical gender of the word / grammatical gender of the word / grammatical gender of the word
4. sexual orientation (wd:P91 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via sexuality), also known as sexuality, P91: the sexual orientation of the person relative to their ... has been widely agreed upon by historians after their death / the sexual orientation of the person — use IF AND ONLY IF ... has been widely agreed upon by historians after their death / the sexual orientation of the person — use IF AND ONLY IF ... has been widely agreed upon by historians after their death
5. has grammatical gender (wd:P5109 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via has genders), also known as grammatical genders, has genders, P5109: specific form of noun class system of a language. Use ... of" (P805) to link to language specific item if present
6. semantic gender (wd:P10339 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via natural gender), also known as natural gender, P10339: used when a word is only used to refer to people of this gender or to animals of this sex, independent of the grammatical gender
7. male form of label (wd:P3321 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via male gender sense), also known as male form of label (string), male gender sense, masculine form of label, P3321: male form of name or title (for female use P2521) / male form of name or title / male form of name or title
8. GSSO ID (wd:P9827 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via Gender, Sex, and Sexual Orientation Ontology identifier), also known as Gender, Sex, and Sexual Orientation Ontology ID, Gender, Sex, and Sexual Orientation Ontology identifier, GSSO identifier, P9827: identifier for controlled vocabulary in the GSSO (Gender, Sex, and Sexual Orientation) ontology
9. unmarried partner (wd:P451 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via sex partner), also known as boyfriend, cohabitant, domestic partner, enbyfriend, girlfriend, etc.: someone with whom the person is in a relationship without being married. Use "spouse" (P26) for married couples / someone with whom the person is in a relationship without being married. Use "spouse" (P26) for married couples / is subproperty of significant person
10. female form of label (wd:P2521 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via female gender sense), also known as female form of label (string), female gender sense, feminine form of label, P2521: female form of name or title (for male use P3321) / female form of name or title / female form of name or title

[Assistant]
Searching for the property for "place of birth" (expected P19).

Question: place of birth

Top 10 property alternatives:
1. place of birth (wd:P19 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as birth city, birth location, birth place, birthplace, born, etc.: most specific known (e.g. city instead of country, or ... birth location of a person, animal or fictional character / most specific known (e.g. city instead of country, or ... birth location of a person, animal or fictional character / most specific known birth location of a person, animal or fictional character / is subproperty of location
2. residence (wd:P551 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via hometown), also known as address, has resided in, home city, home town, hometown, etc.: the place where the person is, or has been, resident / the place where the person is or has been, resident / is subproperty of location
3. category for people born here (wd:P1464 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via category for place of birth), also known as category for place of birth, category of people born here, P1464: category item that groups people born in this place / category item that groups people born in this place / is subproperty of related category
4. location of formation (wd:P740 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via place of formation), also known as comes from, formation location, formation place, formed in, founded in, etc.: location where a group or organisation was formed / location where a group or organization was formed / is subproperty of location of creation
5. location of creation (wd:P1071 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via place of origin), also known as assembly location, built at, built in, composed at, created at, etc.: place where the item was conceived or made; where applicable, location of final assembly / is subproperty of significant place
6. country of origin (wd:P495 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via place of origin), also known as comes from, CoO, country, originates from, origin country, etc.: country of origin of this item (creative work, food, phrase, product, etc.) / country of origin of this item (creative work, food, phrase, product, etc.) / country of origin of this item (creative work, food, phrase, product, etc.) / is subproperty of significant place / is subproperty of country
7. ranking (wd:P1352 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via place), also known as peak position, place, placing, position, rank, etc.: subject's ordinal position as qualitatively evaluated relative to other members of a group / the subject's position in the specified rank
8. location (wd:P276 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via place), also known as based in, city, from, held by, in, etc.: location of the object, structure or event. In the case of an ... use P706. Use P7153 for locations associated with the object / location of the item, physical object or event is within. In ... use P131. In case of a distinct terrain feature use P706. / location of the item, physical object or event is within. In ... use P131. In case of a distinct terrain feature use P706.
9. applies to jurisdiction (wd:P1001 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via of place), also known as applicable area, applicable country, applicable geographic place, applicable jurisdiction, applicable location, etc.: the item (institution, law, public office, public ... jurisdiction: a country, state, municipality, ...) / the item (an institution, law, public office ...) or ... jurisdiction: a country, state, municipality, ...) / is subproperty of characteristic of / is subproperty of significant place / is subproperty of operating area
10. work location (wd:P937 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via location), also known as active in, conducts business at, conducts business in, did work at, did work from, etc.: location where persons or organisations were actively participating in employment, business or other work / is subproperty of significant place / location where persons were active / is subproperty of location

[Assistant]
Now searching for the property that represents "located in the administrative territorial entity" (commonly P131). I'll search for a property matching "located in the administrative territorial entity" or similar.

Question: located in the administrative territorial entity

Top 10 property alternatives:
1. located in the administrative territorial entity (wd:P131 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as administrative territorial entity, administrative territory, city, happens in, in, etc.: the item is located on the territory of the following ... the item falls only partially into the administrative entity. / the item is located on the territory of the following ... the item falls only partially into the administrative entity. / the item is located on the territory of the following administrative entity / the item is located on the territory of the following administrative entity / is subproperty of location / is subproperty of part of
2. located in the present-day administrative territorial entity (wd:P3842 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via located in the current administrative territorial entity), also known as current administrative territorial entity, current location, currently in, located in present day administrative territorial entity, located in present-day administrative territorial entity, etc.: the item was located in the territory of this present-day ... unit; however the two did not at any point coexist in time / the item was located in the territory of this present-day ... unit; however the two did not at any point coexist in time / is subproperty of location / is subproperty of part of
3. located in the statistical territorial entity (wd:P8138 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as located in statistical territorial entity, statistical territorial entity, P8138: statistical territorial entity in which a place is located or ... is split into or part of several regions: add several values / is subproperty of location
4. territory overlaps (wd:P3179 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via partly located in territorial entity), also known as overlaps, partially coextensive with, partially coincident with, partially contains territorial extent, partially located in territorial entity, etc.: part or all of the area associated with (this) entity overlaps part or all of the area associated with that entity / part or all of the area associated with (this) entity overlaps part or all of the area associated with that entity / is subproperty of partially coincident with
5. contains the administrative territorial entity (wd:P150 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via contains administrative territorial entity), also known as contains, contains administrative territorial entity, divided into, divides into, has administrative divisions, etc.: (list of) direct subdivisions of an administrative territorial entity / (list of) direct subdivisions of an administrative division / (list of) direct subdivisions of an administrative division / is subproperty of has part(s) / is subproperty of has part
6. located in the religious territorial entity (wd:P5607 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via located in the ecclesiastical territorial entity), also known as Deanery, located in the ecclesiastical territorial entity, Parish, religious territorial entity, Vicariate, etc.: the item is located on the territory of the following ecclesiastical entity. Use P708 (diocese) for dioceses / the item is located on the territory of the following religious entity. Use P708 (diocese) for dioceses / is subproperty of location / is subproperty of part of
7. location (wd:P276 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via located in), also known as based in, city, from, held by, in, etc.: location of the object, structure or event. In the case of an ... use P706. Use P7153 for locations associated with the object / location of the item, physical object or event is within. In ... use P131. In case of a distinct terrain feature use P706. / location of the item, physical object or event is within. In ... use P131. In case of a distinct terrain feature use P706.
8. located in protected area (wd:P3018 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via located in territorial park), also known as located in bioreserve, located in biosphere reserve, located in conservation area, located in ecological protection area, located in national park, etc.: protected area where a place or geographical feature is physically located / is subproperty of located in the administrative territorial entity / the protected area a place or geographical feature belongs to
9. LAU (wd:P782 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via local administrative unit), also known as local administrative unit, P782: identifier for a local administrative unit, renamed from NUTS 4 and NUTS 5. Format: 2 letters followed by digits
10. associated electoral district (wd:P7938 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via located in the constituency), also known as associated constituency, constituency associated with place, electoral district associated with place, located in electoral district, located in the constituency, etc.: constituencies/electoral districts in which a place is ... from administrative entities (P131) in predefined countries

[Assistant]
I'll also confirm the "country" property (expected P17) and "human" item (expected Q5) just to be thorough. Then I'll assemble a SPARQL query using these confirmed identifiers.

Question: country

Top 10 property alternatives:
1. valid in place (wd:P3005 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via country), also known as applies to country, applies to location, applies to place, country, true in, etc.: is subproperty of applies to part / place where a statement is valid / place where a statement is valid
2. country of origin (wd:P495 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via country), also known as comes from, CoO, country, originates from, origin country, etc.: country of origin of this item (creative work, food, phrase, product, etc.) / country of origin of this item (creative work, food, phrase, product, etc.) / country of origin of this item (creative work, food, phrase, product, etc.) / is subproperty of significant place / is subproperty of country
3. country of citizenship (wd:P27 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via country), also known as citizen of, citizenship, country, (legal) nationality, nation, etc.: the object is a country that recognizes the subject as its citizen / the object is a country that recognizes the subject as its citizen / is subproperty of country
4. country (wd:P17 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as host country, land, sovereign state, state, P17: sovereign state that this item is in (not to be used for human beings) / sovereign state that this item is in (not to be used for human beings) / sovereign state that this item is in (not to be used for human beings) / sovereign state that this item is in (not to be used for human beings) / is subproperty of located in the administrative territorial entity
5. continent (wd:P30 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as P30: is subproperty of located in/on physical feature / is subproperty of located on terrain feature / continent of which the subject is a part / continent of which the subject is a part / continent of which the subject is a part
6. applies to part (wd:P518 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via region), also known as applied to, applies to aspect, applies to form, applies to phase, apply to, etc.: part, aspect, or form of the item to which the claim applies / part of the item for which the claim is valid / part of the item for which the claim is valid
7. location (wd:P276 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via region), also known as based in, city, from, held by, in, etc.: location of the object, structure or event. In the case of an ... use P706. Use P7153 for locations associated with the object / location of the item, physical object or event is within. In ... use P131. In case of a distinct terrain feature use P706. / location of the item, physical object or event is within. In ... use P131. In case of a distinct terrain feature use P706.
8. located in the administrative territorial entity (wd:P131 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via region), also known as administrative territorial entity, administrative territory, city, happens in, in, etc.: the item is located on the territory of the following ... the item falls only partially into the administrative entity. / the item is located on the territory of the following ... the item falls only partially into the administrative entity. / the item is located on the territory of the following administrative entity / the item is located on the territory of the following administrative entity / is subproperty of location / is subproperty of part of
9. applies to jurisdiction (wd:P1001 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via Of country), also known as applicable area, applicable country, applicable geographic place, applicable jurisdiction, applicable location, etc.: the item (institution, law, public office, public ... jurisdiction: a country, state, municipality, ...) / the item (an institution, law, public office ...) or ... jurisdiction: a country, state, municipality, ...) / is subproperty of characteristic of / is subproperty of significant place / is subproperty of operating area
10. work location (wd:P937 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via location), also known as active in, conducts business at, conducts business in, did work at, did work from, etc.: location where persons or organisations were actively participating in employment, business or other work / is subproperty of significant place / location where persons were active / is subproperty of location

[Assistant]
I'll verify the human item (expected Q5) so I can require ?person wdt:P31 wd:Q5 in the query.

Question: human

Top 10 entity alternatives:
1. human (wd:Q5), also known as human being, humans, individual Homo sapiens, individual human, modern humans, etc.: common name of Homo sapiens, unique extant species of the genus Homo, from embryo to adult / is instance of class of organisms known by one particular common name / common name of Homo sapiens, unique extant species of the genus Homo / common name of Homo sapiens, unique extant species of the genus Homo / any member of Homo sapiens, unique extant species of the genus Homo / is instance of organisms known by a particular common name / is subclass of individual animal / is subclass of natural person / is subclass of omnivore / is subclass of mammal / is subclass of person
2. Homo sapiens (wd:Q15978631, matched via human), also known as human, human being, human beings, humans, man, etc.: is instance of taxon / species of mammal / species of mammal / species of mammal
3. Uman (wd:Q208499, matched via Humań), also known as Humań: is instance of city of regional significance of Ukraine / city in Cherkasy Oblast in central Ukraine
4. Human (wd:Q849189): is instance of album / 1991 album by Death
5. Human Entertainment (wd:Q2408214, matched via Human), also known as Human, Human Corporation: is instance of video game developer company / Japanese video game developer and publisher / is instance of video game developer
6. Human (wd:Q919463): 2008 song by The Killers / is instance of single / is instance of song
7. Human (wd:Q20629223): 2015 film by Yann Arthus-Bertrand / is instance of film
8. Human (wd:Q27921626): 2016 song by Rag'n'Bone Man / is instance of single / is instance of song
9. Human (wd:Q735359): 2008 studio album by Brandy / 2008 studio album by Brandy / 2008 studio album by Brandy / is instance of album
10. Human (wd:Q1145446): original song written and composed by Jimmy Jam and Terry Lewis; first recorded by The Human League / is instance of musical work/composition

[Assistant]
I'll run a SPARQL SELECT that finds distinct humans (?person wdt:P31 wd:Q5) with a place of birth (?person wdt:P19 ?birthplace) that is either Australia itself (wd:Q408), has wdt:P17 wd:Q408, or whose administrative parent chain (wdt:P131*) has an admin whose wdt:P17 is wd:Q408. I'll filter out any person that has a P21 (sex or gender) statement. I will request English labels optionally. I'll run the query (limit to 100 results for manageability). Now executing the query.

execute

SELECT DISTINCT ?person ?personLabel ?birthplace ?birthplaceLabel WHERE {
  ?person wdt:P31 wd:Q5 .
  ?person wdt:P19 ?birthplace .
  FILTER NOT EXISTS { ?person wdt:P21 ?sex . }
  {
    # birthplace is Australia itself
    FILTER(?birthplace = wd:Q408)
  }
  UNION
  {
    # birthplace has country = Australia
    ?birthplace wdt:P17 wd:Q408 .
  }
  UNION
  {
    # birthplace is located (possibly via admin chain) in an admin whose country = Australia
    ?birthplace wdt:P131* ?admin .
    ?admin wdt:P17 wd:Q408 .
  }
  OPTIONAL { ?person rdfs:label ?personLabel . FILTER(LANG(?personLabel) = "en") }
  OPTIONAL { ?birthplace rdfs:label ?birthplaceLabel . FILTER(LANG(?birthplaceLabel) = "en") }
}
ORDER BY ?personLabel
LIMIT 100

Got 50 rows and 4 columns, showing the first 5 and last 5 rows below:
| person                               | personLabel                    | birthplace                 | birthplaceLabel        |
| ------------------------------------ | ------------------------------ | -------------------------- | ---------------------- |
| wd:Q31706780                         |                                | Sydney (wd:Q3130)          | Sydney (lang:en)       |
| wd:Q61059979                         |                                | Queensland (wd:Q36074)     | Queensland (lang:en)   |
| Alair Pambegan (wd:Q125526514)       | Alair Pambegan (lang:en)       | Aurukun (wd:Q1879882)      | Aurukun (lang:en)      |
| Andrew Gordon Wilson (wd:Q125072006) | Andrew Gordon Wilson (lang:en) | Bendigo (wd:Q497793)       | Bendigo (lang:en)      |
| Bert Bertram (wd:Q132735762)         | Bert Bertram (lang:en)         | Peterborough (wd:Q3900971) | Peterborough (lang:en) |
| ...                                  | ...                            | ...                        | ...                    |
| William James Little (wd:Q133815014) | William James Little (lang:en) | Hobart (wd:Q40191)         | Hobart (lang:en)       |
| Wynne Whiteford (wd:Q15971533)       | Wynne Whiteford (lang:en)      | Melbourne (wd:Q3141)       | Melbourne (lang:en)    |
| Xavier Luck (wd:Q124479810)          | Xavier Luck (lang:en)          | Sydney (wd:Q3130)          | Sydney (lang:en)       |
| Zafril Ansgar Hamzah (wd:Q119618397) | Zafril Ansgar Hamzah (lang:en) | Canberra (wd:Q3114)        | Canberra (lang:en)     |
| Zomi Frankcom (wd:Q125289276)        | Zomi Frankcom (lang:en)        | Melbourne (wd:Q3141)       | Melbourne (lang:en)    |

[Assistant]
Final SPARQL query will be the same one I executed (returns distinct human items with place of birth in Australia or in admin parents in Australia, and with no P21). I will report that the query returned 50 rows (I executed it and received 50 rows) and include several example results.

answer

SELECT DISTINCT ?person ?personLabel ?birthplace ?birthplaceLabel WHERE {
  ?person wdt:P31 wd:Q5 .
  ?person wdt:P19 ?birthplace .
  FILTER NOT EXISTS { ?person wdt:P21 ?sex . }
  {
    # birthplace is Australia itself
    FILTER(?birthplace = wd:Q408)
  }
  UNION
  {
    # birthplace has country = Australia
    ?birthplace wdt:P17 wd:Q408 .
  }
  UNION
  {
    # birthplace is located (possibly via admin chain) in an admin whose country = Australia
    ?birthplace wdt:P131* ?admin .
    ?admin wdt:P17 wd:Q408 .
  }
  OPTIONAL { ?person rdfs:label ?personLabel . FILTER(LANG(?personLabel) = "en") }
  OPTIONAL { ?birthplace rdfs:label ?birthplaceLabel . FILTER(LANG(?birthplaceLabel) = "en") }
}
ORDER BY ?personLabel
LIMIT 100

Answer:
I ran a SPARQL query that finds humans (wd:Q5) whose place of birth (P19) is either Australia (wd:Q408), has country P17 = Australia, or is located (via a chain of P131 administrative parents) within an administrative entity whose country (P17) is Australia — and who do not have a sex or gender statement (no P21). The query (shown above) returns the item IRIs. When I executed it (limit 100), it returned 50 matching humans. Examples (IRIs with English labels when available) include:
- wd:Q125526514 — Alair Pambegan
- wd:Q125072006 — Andrew Gordon Wilson
- wd:Q132735762 — Bert Bertram
- wd:Q15971533 — Wynne Whiteford
- wd:Q119618397 — Zafril Ansgar Hamzah
- wd:Q124479810 — Xavier Luck
- wd:Q125289276 — Zomi Frankcom
(There are 50 rows in total from the executed query; some persons have no English rdfs:label on Wikidata and appear without a label.)

If you want the full list as IRIs (or with more columns such as date of birth), I can run the query again without a LIMIT or export all results in CSV. The SPARQL query used is exactly the one shown above.


PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT ?date ( YEAR( ?date ) AS ?year ) ?passengers ?refProp ?refPropLabel ?refValue WHERE {
  wd:Q223416 p:P3872 ?stmt .
  OPTIONAL {
    ?stmt wikibase:rank ?rank .
  }
  FILTER ( ! BOUND( ?rank ) || ?rank != wikibase:DeprecatedRank ) ?stmt ps:P3872 ?passengers .
  ?stmt pq:P585 ?date .
  ?stmt prov:wasDerivedFrom ?refNode .
  ?refNode ?refProp ?refValue .
  OPTIONAL {
    ?refProp rdfs:label ?refPropLabel FILTER ( LANG( ?refPropLabel ) = "en" )
  }
}
ORDER BY DESC ( ?date )

Using entities:
- Orly Airport (wd:Q223416), also known as LFPO, ORY, Paris-Orly, PARIS-ORLY, Paris Orly Airport, etc.: is instance of international airport / is instance of commercial traffic aerodrome / airport in France / airport in France / international airport serving Paris, France

Using properties:
- patronage (wd:P3872 as p/ps), also known as customers, number of visitors, passengers, patrons, riders, etc.: number of passengers, patrons or visitors in specified time period / number of passengers, patrons or visitors in specified time period
- 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:
I executed the SPARQL query above. It returns the yearly patronage (p:P3872) statements for Orly Airport (wd:Q223416), excluding deprecated statements, and lists for each statement: the point-in-time (pq:P585) as ?date, the extracted YEAR(?date) as ?year, the passenger count (ps:P3872) as ?passengers, and each reference property (e.g. pr:P854) and its value.

Summary of results returned by the query:
- Total rows returned by the query execution: 268 (each row corresponds to one reference triple for a patronage statement).
- Year range observed in the results (examples): 1980 up to 2022.

Example rows (from the top of the result set):
- date=2022-01-01, year=2022, passengers=29187269, refProp=pr:P854 (reference URL), refValue=<https://www.parisaeroport.fr/docs/.../December-2022-traffic-figures.pdf>
- date=2022-01-01, year=2022, passengers=29187269, refProp=pr:P854 (reference URL), refValue=<https://www.aeroport.fr/uploads/documents/.../STATS_2022_v2.pdf>
- date=2021-01-01, year=2021, passengers=15720809, refProp=pr:P... (one of the reference triples for that statement)
- older examples: date=1985-01-01, year=1985, passengers=17675000, refProp=pr:P854, refValue=<http://www.statistiques.developpement-durable.gouv.fr/.../7-memento-2015-transports-aeriens-b.xls>

Notes and interpretation:
- Many patronage statements have multiple reference triples; the query returns one row per reference triple. Common reference properties are pr:P854 (reference URL) and rdf:type triples identifying the reference node as a wikibase:Reference.
- The passenger counts are returned as the ps:P3872 values (numeric), and the point-in-time pq:P585 is returned as ?date (xsd:dateTime) with ?year extracted.
- Deprecated statements were excluded by filtering out statements with wikibase:DeprecatedRank.

If you want a compact per-year aggregation (one row per year listing all reference URLs concatenated), I can modify the query to GROUP_CONCAT reference values grouped by year and passenger count. Otherwise you can use the above query directly to retrieve the full set of statement-level references.

I executed the SPARQL query above. It returns the yearly patronage (p:P3872) statements for Orly Airport (wd:Q223416), excluding deprecated statements, and lists for each statement: the point-in-time (pq:P585) as ?date, the extracted YEAR(?date) as ?year, the passenger count (ps:P3872) as ?passengers, and each reference property (e.g. pr:P854) and its value.

Summary of results returned by the query:
- Total rows returned by the query execution: 268 (each row corresponds to one reference triple for a patronage statement).
- Year range observed in the results (examples): 1980 up to 2022.

Example rows (from the top of the result set):
- date=2022-01-01, year=2022, passengers=29187269, refProp=pr:P854 (reference URL), refValue=<https://www.parisaeroport.fr/docs/.../December-2022-traffic-figures.pdf>
- date=2022-01-01, year=2022, passengers=29187269, refProp=pr:P854 (reference URL), refValue=<https://www.aeroport.fr/uploads/documents/.../STATS_2022_v2.pdf>
- date=2021-01-01, year=2021, passengers=15720809, refProp=pr:P... (one of the reference triples for that statement)
- older examples: date=1985-01-01, year=1985, passengers=17675000, refProp=pr:P854, refValue=<http://www.statistiques.developpement-durable.gouv.fr/.../7-memento-2015-transports-aeriens-b.xls>

Notes and interpretation:
- Many patronage statements have multiple reference triples; the query returns one row per reference triple. Common reference properties are pr:P854 (reference URL) and rdf:type triples identifying the reference node as a wikibase:Reference.
- The passenger counts are returned as the ps:P3872 values (numeric), and the point-in-time pq:P585 is returned as ?date (xsd:dateTime) with ?year extracted.
- Deprecated statements were excluded by filtering out statements with wikibase:DeprecatedRank.

If you want a compact per-year aggregation (one row per year listing all reference URLs concatenated), I can modify the query to GROUP_CONCAT reference values grouped by year and passenger count. Otherwise you can use the above query directly to retrieve the full set of statement-level references.

SPARQL query over wikidata:
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT ?date ( YEAR( ?date ) AS ?year ) ?passengers ?refProp ?refPropLabel ?refValue WHERE {
  wd:Q223416 p:P3872 ?stmt .
  OPTIONAL {
    ?stmt wikibase:rank ?rank .
  }
  FILTER ( ! BOUND( ?rank ) || ?rank != wikibase:DeprecatedRank ) ?stmt ps:P3872 ?passengers .
  ?stmt pq:P585 ?date .
  ?stmt prov:wasDerivedFrom ?refNode .
  ?refNode ?refProp ?refValue .
  OPTIONAL {
    ?refProp rdfs:label ?refPropLabel FILTER ( LANG( ?refPropLabel ) = "en" )
  }
}
ORDER BY DESC ( ?date )

Using entities:
- Orly Airport (wd:Q223416), also known as LFPO, ORY, Paris-Orly, PARIS-ORLY, Paris Orly Airport, etc.: is instance of international airport / is instance of commercial traffic aerodrome / airport in France / airport in France / international airport serving Paris, France

Using properties:
- patronage (wd:P3872 as p/ps), also known as customers, number of visitors, passengers, patrons, riders, etc.: number of passengers, patrons or visitors in specified time period / number of passengers, patrons or visitors in specified time period
- 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 268 rows and 6 columns, showing the first 5 and last 5 rows below:
| date                                | year           | passengers             | refProp                 | refPropLabel | refValue                                                                                |
| ----------------------------------- | -------------- | ---------------------- | ----------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 2022-01-01T00:00:00Z (xsd:dateTime) | 2022 (xsd:int) | 29187269 (xsd:decimal) | reference URL (pr:P854) |              | <https://www.parisaeroport.fr/docs/default-source/groupe-fichiers/finance/information-r%C3%A9glement%C3%A9e-amf/communiqu%C3%A9s-information-permanente/2022/a%C3%A9roports-de-paris-sa---december-2022-traffic-figures.pdf?sfvrsn=47a61a05_0> |
| 2022-01-01T00:00:00Z (xsd:dateTime) | 2022 (xsd:int) | 29187269 (xsd:decimal) | reference URL (pr:P854) |              | <https://www.aeroport.fr/uploads/documents/CONGRES%202022/DOSSIER%20DE%20PRESSE_STATS_2022_v2.pdf>                                                                                |
| 2022-01-01T00:00:00Z (xsd:dateTime) | 2022 (xsd:int) | 29187269 (xsd:decimal) | rdf:type                |              | wikibase:Reference                                                                                |
| 2022-01-01T00:00:00Z (xsd:dateTime) | 2022 (xsd:int) | 29187269 (xsd:decimal) | rdf:type                |              | wikibase:Reference                                                                                |
| 2021-01-01T00:00:00Z (xsd:dateTime) | 2021 (xsd:int) | 15720809 (xsd:decimal) | rdf:type                |              | wikibase:Reference                                                                                |
| ...                                 | ...            | ...                    | ...                     | ...          | ...                                                                                |
| 1985-01-01T00:00:00Z (xsd:dateTime) | 1985 (xsd:int) | 17675000 (xsd:decimal) | reference URL (pr:P854) |              | <http://www.statistiques.developpement-durable.gouv.fr/sites/default/files/2018-11/7-memento-2015-transports-aeriens-b.xls>                                                                                |
| 1984-01-01T00:00:00Z (xsd:dateTime) | 1984 (xsd:int) | 17175000 (xsd:decimal) | reference URL (pr:P854) |              | <http://www.statistiques.developpement-durable.gouv.fr/sites/default/files/2018-11/7-memento-2015-transports-aeriens-b.xls>                                                                                |
| 1984-01-01T00:00:00Z (xsd:dateTime) | 1984 (xsd:int) | 17175000 (xsd:decimal) | rdf:type                |              | wikibase:Reference                                                                                |
| 1980-01-01T00:00:00Z (xsd:dateTime) | 1980 (xsd:int) | 15866000 (xsd:decimal) | reference URL (pr:P854) |              | <http://www.statistiques.developpement-durable.gouv.fr/sites/default/files/2018-11/7-memento-2015-transports-aeriens-b.xls>                                                                                |
| 1980-01-01T00:00:00Z (xsd:dateTime) | 1980 (xsd:int) | 15866000 (xsd:decimal) | rdf:type                |              | wikibase:Reference                                                                                |

[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 yearly patronage statistics for Orly Airport, including the year, number of passengers, reference type, and reference? Exclude deprecated statements in your results.

[Assistant]
Step 1 — I'll search for the Wikidata item for Orly Airport to get its Q identifier and confirm it's an airport (instance of). I'll run a constrained entity search. I'll call the search_entity function and then check its instance-of if necessary.

Question: Orly Airport

Top 10 entity alternatives:
1. Orly Airport (wd:Q223416), also known as LFPO, ORY, Paris-Orly, PARIS-ORLY, Paris Orly Airport, etc.: is instance of commercial traffic aerodrome / international airport serving Paris, France / is instance of international airport / airport in France / airport in France
2. Orly Airport attack (wd:Q2869976): bombing in Orly airport by ASALA / is instance of bomb attack
3. 1975 Orly Airport attacks (wd:Q56279263): is instance of attempted murder / 1975 terrorist attack
4. 1978 Orly Airport attack (wd:Q28493514): is instance of fusillade / is instance of Fusillade / 1978 terrorist attack
5. airport (wd:Q1248784), also known as aerodrome, air port, airports: location where aircraft take off and land with extended support facilities, mostly for commercial air transport / location where aircraft take off and land / location where aircraft take off and land / is subclass of organisation / is subclass of organization / is subclass of aerodrome / is subclass of Aerodrome / is subclass of station
6. Heathrow Airport (wd:Q8691), also known as EGLL, Heathrow, LHR, London Heathrow, London Heathrow Airport, etc.: main airport serving London, England, United Kingdom / is instance of commercial traffic aerodrome / is instance of international airport / is instance of organization / is instance of organisation
7. Amsterdam Airport Schiphol (wd:Q9694, matched via Amsterdam Airport), also known as AMS, Amsterdam Airport, Amsterdam-Schiphol, EHAM, Schiphol, etc.: is instance of cadastral populated place in the Netherlands / is instance of commercial traffic aerodrome / airport in Haarlemmermeer, Netherlands / is instance of international airport / airport in the Netherlands / airport in the Netherlands
8. Paris-Charles de Gaulle Airport (wd:Q46280, matched via Roissy Airport), also known as CDG, Charles de Gaulle Airport, LFPG, Paris CDG Airport, PARIS-CHARLES DE GAULLE, etc.: is instance of commercial traffic aerodrome / international airport serving Paris, France / is instance of international airport / airport in Paris, France / airport in Paris, France
9. Frankfurt Airport (wd:Q46033), also known as EDDF, FRA, Frankfurt am Main Airport, Rhein-Main Airport: biggest airport of Germany, located in Frankfurt, Hesse / is instance of international airport / is instance of commercial airport
10. Domodedovo International Airport (wd:Q186614, matched via Domodedovo Airport), also known as DME, Domodedovo Airport, Moscow Airport, Moscow Domodedovo Airport, Moscow-Domodedovo Airport, etc.: international airport serving Moscow, Russia / is instance of commercial traffic aerodrome / is instance of international airport / is instance of federal aeroport / airport in Russia / airport in Russia

[Assistant]
Step 2 — search for properties related to passenger counts / yearly traffic (words like "passenger", "passengers", "annual", "traffic") so I can find which property is used on Wikidata for airport patronage statistics. I'll run a property search for "passenger".

Question: passenger

Top 10 property alternatives:
1. patronage (wd:P3872 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via passengers), also known as customers, number of visitors, passengers, patrons, riders, etc.: number of passengers, patrons or visitors in specified time period / number of passengers, patrons or visitors in specified time period
2. carries passengers or cargo (wd:P3437 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via type of passengers/cargo), also known as brings, cargo carried, cargo transported, carries, carries cargo, etc.: the type of passengers or cargo a vehicle actually carries/carried / the type of passengers or cargo a vehicle actually carries/carried
3. number of seats in assembly (wd:P1410 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via seats), also known as number of delegates, number of representatives, number of seats, seats, P1410: number of seats a political party, faction, or group has in a given assembly
4. maximum capacity (wd:P1083 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via seats), also known as capacity, complement, crew, number of seats, seating capacity, etc.: number of people allowed for a venue or vehicle / number of people allowed for a venue or vehicle
5. means of locomotion (wd:P3512 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via means of transport), also known as locomotion, locomotion method, means of transport, P3512: method that the subject uses to move from one place to another
6. designed to carry (wd:P3349 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via cargo), also known as cargo, carries, design payload, intended cargo, intended payload, etc.: what the vehicle or class of vehicles is or was designed to carry / what the vehicle or class of vehicles is or was designed to carry / what the vehicle or class of vehicles is or was designed to carry
7. item operated (wd:P121 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via aircraft carried), also known as acop, aircraft carried, aircraft in fleet, aircraft operated, controls, etc.: equipment, installation or service operated by the subject / equipment, installation or service operated by the subject / equipment, installation or service operated by the subject / is subproperty of uses
8. vessel (wd:P1876 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via vehicle), also known as boat, craft, orbiter, ship, spacecraft, etc.: vessel involved in this mission, navigation or event / vessel involved in this mission, voyage or event
9. first flight (wd:P606 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via maiden flight), also known as 1st flight, date of the first flight, FF, first launch, maiden flight, etc.: date or point in time on which aircraft, rocket, or airline first flew / is subproperty of significant event
10. electoral district (wd:P768 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via seat), also known as constituency, electoral area, electorate, riding, seat, etc.: electoral district this person is representing, or of the ... "office contested" (P541) or "candidacy in election" (P3602) / electoral district this person is representing. Use as qualifier for "position held" (P39)

[Assistant]
I'll run a SPARQL query on Wikidata to retrieve all p:P3872 (patronage) statements for Orly Airport (wd:Q223416), get the passenger count (ps:P3872), the point-in-time qualifier (pq:P585) as the year, and list each reference property and the reference value. I'll exclude deprecated statements by filtering out statements with wikibase:DeprecatedRank. I'll order results by descending date (most recent first). Now I'll execute the query.

execute

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?date (YEAR(?date) AS ?year) ?passengers ?refProp ?refPropLabel ?refValue WHERE {
  wd:Q223416 p:P3872 ?stmt.
  OPTIONAL { ?stmt wikibase:rank ?rank. }
  FILTER(!BOUND(?rank) || ?rank != wikibase:DeprecatedRank)
  ?stmt ps:P3872 ?passengers.
  ?stmt pq:P585 ?date.
  ?stmt prov:wasDerivedFrom ?refNode.
  ?refNode ?refProp ?refValue.
  OPTIONAL { ?refProp rdfs:label ?refPropLabel FILTER(LANG(?refPropLabel)="en") }
}
ORDER BY DESC(?date)

[Assistant]
I'll finalize by returning the SPARQL query I executed and a concise summary of the results (including a few example rows).

answer

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?date (YEAR(?date) AS ?year) ?passengers ?refProp ?refPropLabel ?refValue WHERE {
  wd:Q223416 p:P3872 ?stmt.
  OPTIONAL { ?stmt wikibase:rank ?rank. }
  FILTER(!BOUND(?rank) || ?rank != wikibase:DeprecatedRank)
  ?stmt ps:P3872 ?passengers.
  ?stmt pq:P585 ?date.
  ?stmt prov:wasDerivedFrom ?refNode.
  ?refNode ?refProp ?refValue.
  OPTIONAL { ?refProp rdfs:label ?refPropLabel FILTER(LANG(?refPropLabel)="en") }
}
ORDER BY DESC(?date)

Answer:
I executed the SPARQL query above. It returns the yearly patronage (p:P3872) statements for Orly Airport (wd:Q223416), excluding deprecated statements, and lists for each statement: the point-in-time (pq:P585) as ?date, the extracted YEAR(?date) as ?year, the passenger count (ps:P3872) as ?passengers, and each reference property (e.g. pr:P854) and its value.

Summary of results returned by the query:
- Total rows returned by the query execution: 268 (each row corresponds to one reference triple for a patronage statement).
- Year range observed in the results (examples): 1980 up to 2022.

Example rows (from the top of the result set):
- date=2022-01-01, year=2022, passengers=29187269, refProp=pr:P854 (reference URL), refValue=<https://www.parisaeroport.fr/docs/.../December-2022-traffic-figures.pdf>
- date=2022-01-01, year=2022, passengers=29187269, refProp=pr:P854 (reference URL), refValue=<https://www.aeroport.fr/uploads/documents/.../STATS_2022_v2.pdf>
- date=2021-01-01, year=2021, passengers=15720809, refProp=pr:P... (one of the reference triples for that statement)
- older examples: date=1985-01-01, year=1985, passengers=17675000, refProp=pr:P854, refValue=<http://www.statistiques.developpement-durable.gouv.fr/.../7-memento-2015-transports-aeriens-b.xls>

Notes and interpretation:
- Many patronage statements have multiple reference triples; the query returns one row per reference triple. Common reference properties are pr:P854 (reference URL) and rdf:type triples identifying the reference node as a wikibase:Reference.
- The passenger counts are returned as the ps:P3872 values (numeric), and the point-in-time pq:P585 is returned as ?date (xsd:dateTime) with ?year extracted.
- Deprecated statements were excluded by filtering out statements with wikibase:DeprecatedRank.

If you want a compact per-year aggregation (one row per year listing all reference URLs concatenated), I can modify the query to GROUP_CONCAT reference values grouped by year and passenger count. Otherwise you can use the above query directly to retrieve the full set of statement-level references.