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 xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT DISTINCT ?item ?itemLabel ?part1 ?part1Label ?amt1 ?unit1Label ?part2 ?part2Label ?amt2 ?unit2Label WHERE {
  ?item p:P2044 ?st1 .
  ?item p:P2044 ?st2 .
  FILTER ( STR( ?st1 ) < STR( ?st2 ) ) ?st1 psv:P2044 ?raw1 .
  ?st2 psv:P2044 ?raw2 .
  OPTIONAL {
    ?raw1 wikibase:quantityNormalized ?norm1 .
    ?norm1 wikibase:quantityAmount ?normAmt1 .
    ?norm1 wikibase:quantityUnit ?normUnit1 .
  }
  OPTIONAL {
    ?raw1 wikibase:quantityAmount ?rawAmt1 .
    ?raw1 wikibase:quantityUnit ?rawUnit1 .
  }
  OPTIONAL {
    ?raw2 wikibase:quantityNormalized ?norm2 .
    ?norm2 wikibase:quantityAmount ?normAmt2 .
    ?norm2 wikibase:quantityUnit ?normUnit2 .
  }
  OPTIONAL {
    ?raw2 wikibase:quantityAmount ?rawAmt2 .
    ?raw2 wikibase:quantityUnit ?rawUnit2 .
  }
  BIND( COALESCE ( ?normAmt1 , ?rawAmt1 ) AS ?amt1 ) BIND( COALESCE ( ?normAmt2 , ?rawAmt2 ) AS ?amt2 ) BIND( COALESCE ( ?normUnit1 , ?rawUnit1 ) AS ?unit1 ) BIND( COALESCE ( ?normUnit2 , ?rawUnit2 ) AS ?unit2 ) OPTIONAL {
    ?st1 pq:P518 ?part1 .
  }
  OPTIONAL {
    ?st2 pq:P518 ?part2 .
  }
  FILTER ( BOUND( ?amt1 ) && BOUND( ?amt2 ) ) FILTER ( ABS( xsd:decimal ( ?amt1 ) - xsd:decimal ( ?amt2 ) ) > 500 ) ?item rdfs:label ?itemLabel .
  FILTER ( LANG( ?itemLabel ) = "en" ) OPTIONAL {
    ?part1 rdfs:label ?part1Label .
    FILTER ( LANG( ?part1Label ) = "en" )
  }
  OPTIONAL {
    ?part2 rdfs:label ?part2Label .
    FILTER ( LANG( ?part2Label ) = "en" )
  }
  OPTIONAL {
    ?unit1 rdfs:label ?unit1Label .
    FILTER ( LANG( ?unit1Label ) = "en" )
  }
  OPTIONAL {
    ?unit2 rdfs:label ?unit2Label .
    FILTER ( LANG( ?unit2Label ) = "en" )
  }
}
LIMIT 500

Using properties:
- elevation above sea level (wd:P2044 as p/psv), also known as altitude, AMSL, EASL, elevation, elevation above mean sea level, etc.: height of the item as measured relative to sea level / height of the item as measured relative to sea level / height of the item (geographical object) as measured relative to sea level
- applies to part (wd:P518 as pq), 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

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

Explanation:
I could not successfully execute the comprehensive SPARQL query against the local Wikidata endpoint: execution attempts timed out or failed (read timeout / thread failure). The intended query is fairly heavy because it joins p:P2044 statement nodes, their value nodes and normalized quantities across the entire dataset, and then compares every pair of elevation statements per item. The endpoint appears to be unable to return results for that broad query within the time limits.

Suggested mitigations:
- Run the provided query directly on a production Wikidata SPARQL endpoint (which may be more responsive) or on a local copy with more generous time limits.
- Or narrower queries: restrict to particular classes (e.g., mountains: ?item wdt:P31/wdt:P279* wd:Q8502 or wd:Q8502? check exact class), or geographic types, or a time window. This reduces result size and should run faster.
- If you want, I can re-run a narrower query (for example: only items that are instance of mountain, hill, summit, or city) and return results.

Below is my best SPARQL attempt (the query I tried to execute). It finds items with two distinct elevation statements (p:P2044), extracts normalized amounts (falling back to raw amounts), includes pq:P518 "applies to part" qualifiers where present, and filters pairs whose absolute difference exceeds 500 meters.

I could not successfully execute the comprehensive SPARQL query against the local Wikidata endpoint: execution attempts timed out or failed (read timeout / thread failure). The intended query is fairly heavy because it joins p:P2044 statement nodes, their value nodes and normalized quantities across the entire dataset, and then compares every pair of elevation statements per item. The endpoint appears to be unable to return results for that broad query within the time limits.

Suggested mitigations:
- Run the provided query directly on a production Wikidata SPARQL endpoint (which may be more responsive) or on a local copy with more generous time limits.
- Or narrower queries: restrict to particular classes (e.g., mountains: ?item wdt:P31/wdt:P279* wd:Q8502 or wd:Q8502? check exact class), or geographic types, or a time window. This reduces result size and should run faster.
- If you want, I can re-run a narrower query (for example: only items that are instance of mountain, hill, summit, or city) and return results.

Below is my best SPARQL attempt (the query I tried to execute). It finds items with two distinct elevation statements (p:P2044), extracts normalized amounts (falling back to raw amounts), includes pq:P518 "applies to part" qualifiers where present, and filters pairs whose absolute difference exceeds 500 meters.

SPARQL query over wikidata:
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 xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT DISTINCT ?item ?itemLabel ?part1 ?part1Label ?amt1 ?unit1Label ?part2 ?part2Label ?amt2 ?unit2Label WHERE {
  ?item p:P2044 ?st1 .
  ?item p:P2044 ?st2 .
  FILTER ( STR( ?st1 ) < STR( ?st2 ) ) ?st1 psv:P2044 ?raw1 .
  ?st2 psv:P2044 ?raw2 .
  OPTIONAL {
    ?raw1 wikibase:quantityNormalized ?norm1 .
    ?norm1 wikibase:quantityAmount ?normAmt1 .
    ?norm1 wikibase:quantityUnit ?normUnit1 .
  }
  OPTIONAL {
    ?raw1 wikibase:quantityAmount ?rawAmt1 .
    ?raw1 wikibase:quantityUnit ?rawUnit1 .
  }
  OPTIONAL {
    ?raw2 wikibase:quantityNormalized ?norm2 .
    ?norm2 wikibase:quantityAmount ?normAmt2 .
    ?norm2 wikibase:quantityUnit ?normUnit2 .
  }
  OPTIONAL {
    ?raw2 wikibase:quantityAmount ?rawAmt2 .
    ?raw2 wikibase:quantityUnit ?rawUnit2 .
  }
  BIND( COALESCE ( ?normAmt1 , ?rawAmt1 ) AS ?amt1 ) BIND( COALESCE ( ?normAmt2 , ?rawAmt2 ) AS ?amt2 ) BIND( COALESCE ( ?normUnit1 , ?rawUnit1 ) AS ?unit1 ) BIND( COALESCE ( ?normUnit2 , ?rawUnit2 ) AS ?unit2 ) OPTIONAL {
    ?st1 pq:P518 ?part1 .
  }
  OPTIONAL {
    ?st2 pq:P518 ?part2 .
  }
  FILTER ( BOUND( ?amt1 ) && BOUND( ?amt2 ) ) FILTER ( ABS( xsd:decimal ( ?amt1 ) - xsd:decimal ( ?amt2 ) ) > 500 ) ?item rdfs:label ?itemLabel .
  FILTER ( LANG( ?itemLabel ) = "en" ) OPTIONAL {
    ?part1 rdfs:label ?part1Label .
    FILTER ( LANG( ?part1Label ) = "en" )
  }
  OPTIONAL {
    ?part2 rdfs:label ?part2Label .
    FILTER ( LANG( ?part2Label ) = "en" )
  }
  OPTIONAL {
    ?unit1 rdfs:label ?unit1Label .
    FILTER ( LANG( ?unit1Label ) = "en" )
  }
  OPTIONAL {
    ?unit2 rdfs:label ?unit2Label .
    FILTER ( LANG( ?unit2Label ) = "en" )
  }
}
LIMIT 500

Using properties:
- elevation above sea level (wd:P2044 as p/psv), also known as altitude, AMSL, EASL, elevation, elevation above mean sea level, etc.: height of the item as measured relative to sea level / height of the item as measured relative to sea level / height of the item (geographical object) as measured relative to sea level
- applies to part (wd:P518 as pq), 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

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

[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 objects have two statements of elevation above sea level with a difference of more than 500 meters between the two statements? For each object, please include the specific part to which the elevation applies (if available) and the elevation (in meters) for both elevation statements.

[Assistant]
Step 1 — plan: I will (a) find the Wikidata property for "elevation above sea level" and relevant qualifier properties (like "applies to part"), (b) inspect how elevation statements are represented, and (c) build a SPARQL query that finds items with at least two p:P2044 statements whose ps:P2044 values differ by more than 500 meters, returning the two elevation values and any "applies to part" qualifiers. I'll start by searching for the elevation property and the "applies to part" qualifier property to confirm their property IDs. I'll run a property search for "elevation" and for "applies to part".

Question: elevation above sea level

Top 10 property alternatives:
1. elevation above sea level (wd:P2044 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as altitude, AMSL, EASL, elevation, elevation above mean sea level, etc.: height of the item (geographical object) as measured relative to sea level / height of the item as measured relative to sea level / height of the item as measured relative to sea level
2. floors above ground (wd:P1101 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via levels above ground), also known as floor count, levels above ground, number of floors, number of stories, storeys, etc.: above ground floor count of a building (ground floor and attic included) / above ground floor count of a building (ground floor included)
3. clearance (wd:P2793 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via height above ground), also known as air draft, air draught, bridge height, clearance below, deck height, etc.: distance between surface under bridge and bottom of a bridge deck / distance between surface and bottom of a bridge deck
4. highest point (wd:P610 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via elevation of highest point), also known as elevation of highest point, extreme point highest, highest peak, pinnacle, summit, etc.: point with the highest elevation in the country, region, city, town, or area / point with highest elevation in the country, region, city or area / point with highest elevation in a region or path / is subproperty of has part(s) / is subproperty of has part
5. maximum operating altitude (wd:P2254 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via maximum altitude), also known as ceiling, maximum altitude, service ceiling, P2254: ceiling or maximum density altitude at which an aircraft can operate / is subproperty of elevation above sea level
6. cumulative elevation gain (wd:P7297 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as P7297: measure of the difference in height between two points on the terrain, when following a track
7. ride height (wd:P8594 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as ground clearance, P8594: ground clearance of vehicle or distance between the base of a vehicle tire and the lowest point
8. precipitation height (wd:P3036 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via snow height), also known as amount of precipitation, amount of rain, amount of snow, precipitation amount, rain amount, etc.: maximum height of snow or rain during an event or space of time / maximum height of snow or rain during an event or space of time
9. vertical depth (wd:P4511 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via lakedepth), also known as depth, lakedepth, oceandepth, P4511: vertical distance from a horizontal area to a point below. Compare with "horizontal depth" (P5524) / is subproperty of length
10. horizontal depth (wd:P5524 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as depth, spatial depth, thickness, P5524: spatial extent for 3D object along the third axis, what is ... to as its depth. Compare with "vertical depth" (P4511) / spatial extent for 3D object along the third axis, what is ... to as its depth. Compare with "vertical depth" (P4511) / is subproperty of length

[Assistant]
I'll search for the property that indicates which part of an item a statement applies to (commonly used as a qualifier on statements, e.g., to indicate a subpart like 'summit' or 'base'). I will search for "applies to part" and related phrases.

Question: applies to part

Top 10 property alternatives:
1. applies to part (wd:P518 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), 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
2. excluding (wd:P1011 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via does not apply to part), also known as apart from, aside from, bar, does not apply to part, does not include, etc.: usually used as a qualifier
3. has part(s) (wd:P527 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via includes part), also known as amalgamation of, assembled from, assembled out of, composed of, comprised of, etc.: part of this subject; inverse property of "part of" (P361). See also "has parts of the class" (P2670). / part of this subject; inverse property of "part of" (P361). See also "has parts of the class" (P2670). / part of this subject, also valuable subclass or exemplar. Inverse property of "part of".
4. of (wd:P642 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via applies to), also known as applies to, for, in, in scope of, in the scope of, etc.: (This property is being deprecated, see details at WD:P642) ... a statement applies within the scope of a particular item / (This property is being deprecated, see details at WD:P642) ... a statement applies within the scope of a particular item / (This property is being deprecated, see details at WD:P642) ... a statement applies within the scope of a particular item / (being deprecated, find alternatives at WD:P642) qualifier ... a statement applies within the scope of a particular item
5. participant in (wd:P1344 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via takes part), also known as attended, competed in, competes in, participant of, participant of event, etc.: event in which a person or organisation was/is a participant; inverse of P710 or P1923 / event in which a person or organization was/is a participant; inverse of P710 or P1923 / is subproperty of significant event / is subproperty of part of
6. valid in place (wd:P3005 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via applies to place), 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
7. applies to jurisdiction (wd:P1001 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via applies to 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
8. valid in period (wd:P1264 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via applies to period), also known as applies to era, applies to period, applies to season, applies to time, period of applicability, etc.: time period when a statement is valid / time period when a statement is valid
9. parent organization (wd:P749 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via part of), also known as chapter of, has organizational parent, holding, holding company, owned by (company or organisation), etc.: parent organization of an organization, opposite of subsidiaries (P355) / is subproperty of owned by / is subproperty of part of
10. part of (wd:P361 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as assembly of, branch of, chain, collateral branch of, component of, etc.: object of which the subject is a part (if this subject is ... "has part" (P527, see also "has parts of the class" (P2670)) / object of which the subject is a part (if this subject is ... "has part" (P527, see also "has parts of the class" (P2670)) / object of which the subject is a part (if this subject is ... "has part" (P527, see also "has parts of the class" (P2670)) / object of which the subject is a part (if this subject is ... "has part" (P527, see also "has parts of the class" (P2670))

[Assistant]
I'll search for "Mount Everest" to inspect how elevation statements are modelled (one or more statements) so I can craft the correct query pattern for quantities. I will verify how the ps:P2044 values are represented (direct literal or quantity node).

Question: Mount Everest

Top 10 entity alternatives:
1. Mount Everest (wd:Q513), also known as Chomolangma, Chomolungma, Everest, Himalaya Peak XV, Mount Chomolubutangma, etc.: Earth's highest mountain, with a peak at 8,848 metres (29,029 ... part of the Himalaya mountain range between Nepal and China / Earth's highest mountain, with a peak at 8,850 metres (29,035 ... part of the Himalaya mountain range between Nepal and China / Earth's highest mountain above sea level, located in the Mahalangur Himal sub-range of the Himalayas / is instance of tourist attraction / is instance of mountain
2. The Climbers (wd:Q61882061, matched via Mount Everest), also known as Chomolungma, Mount Everest, Qomolangma: 2019 film directed by Daniel Lee / is instance of film
3. Mount Everest (wd:Q31505139), also known as Mount Everest, South Africa: mountain in the Free State Province, South Africa / is instance of mountain
4. Mount Everest (wd:Q21939846), also known as Mount Everest, Australia: mountain in New South Wales, Australia / is instance of mountain
5. Mount Everest (wd:Q19977041): is instance of musical group / band
6. Mount Everest (wd:Q84260471), also known as IMO 9470985: is instance of ship / ship built in 2010
7. Mount Everest (wd:Q119187184): painting by G. Hemwell, Hampshire Cultural Trust Headquarters, Winchester (Hampshire County Council’s Fine Art Collection) / is instance of painting
8. Mount Everest (wd:Q60102972): is instance of scholarly article / is instance of academic article / article published March 1921
9. Mount Everest (wd:Q60106019): is instance of scholarly article / is instance of academic article / article published November 1921
10. Mount Everest (wd:Q60259462): is instance of scholarly article / is instance of academic article / article published January 1933

[Assistant]
I'll list the p:P2044 triples for Mount Everest to see how the elevation statements are represented and whether qualifiers like P518 (applies to part) appear.

list

wd:Q513

[Assistant] I'll inspect one statement node to see how the elevation value and qualifiers are encoded.

[Assistant] I will inspect the value node referenced by psv:P2044 to find the numeric amount and its unit or normalized amount. This helps ensure we compare elevations in meters.

[Assistant] I'll inspect the normalized quantity node to get the quantity in meters.

[Assistant]
I'll run a SPARQL query that:
- finds items with at least two p:P2044 statement nodes,
- extracts normalized quantity amounts (meters) for both statements, falling back to raw amounts if normalized is absent,
- extracts pq:P518 "applies to part" qualifiers for each statement if present,
- filters for absolute difference > 500 meters,
- returns labels for the item, parts and units.

Now I will execute that 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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX v: <http://www.wikidata.org/value/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?item ?itemLabel ?part1 ?part1Label ?amt1 ?unit1Label ?part2 ?part2Label ?amt2 ?unit2Label WHERE {
  ?item p:P2044 ?st1 .
  ?item p:P2044 ?st2 .
  FILTER(STR(?st1) < STR(?st2))

  ?st1 psv:P2044 ?raw1 .
  ?st2 psv:P2044 ?raw2 .

  OPTIONAL {
    ?raw1 wikibase:quantityNormalized ?norm1 .
    ?norm1 wikibase:quantityAmount ?normAmt1 .
    ?norm1 wikibase:quantityUnit ?normUnit1 .
  }
  OPTIONAL {
    ?raw1 wikibase:quantityAmount ?rawAmt1 .
    ?raw1 wikibase:quantityUnit ?rawUnit1 .
  }

  OPTIONAL {
    ?raw2 wikibase:quantityNormalized ?norm2 .
    ?norm2 wikibase:quantityAmount ?normAmt2 .
    ?norm2 wikibase:quantityUnit ?normUnit2 .
  }
  OPTIONAL {
    ?raw2 wikibase:quantityAmount ?rawAmt2 .
    ?raw2 wikibase:quantityUnit ?rawUnit2 .
  }

  BIND(COALESCE(?normAmt1, ?rawAmt1) AS ?amt1)
  BIND(COALESCE(?normAmt2, ?rawAmt2) AS ?amt2)
  BIND(COALESCE(?normUnit1, ?rawUnit1) AS ?unit1)
  BIND(COALESCE(?normUnit2, ?rawUnit2) AS ?unit2)

  OPTIONAL { ?st1 pq:P518 ?part1 . }
  OPTIONAL { ?st2 pq:P518 ?part2 . }

  FILTER(BOUND(?amt1) && BOUND(?amt2))
  FILTER(ABS(xsd:decimal(?amt1) - xsd:decimal(?amt2)) > 500)

  ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en")
  OPTIONAL { ?part1 rdfs:label ?part1Label . FILTER(LANG(?part1Label) = "en") }
  OPTIONAL { ?part2 rdfs:label ?part2Label . FILTER(LANG(?part2Label) = "en") }
  OPTIONAL { ?unit1 rdfs:label ?unit1Label . FILTER(LANG(?unit1Label) = "en") }
  OPTIONAL { ?unit2 rdfs:label ?unit2Label . FILTER(LANG(?unit2Label) = "en") }
}
ORDER BY ?itemLabel ?amt1
LIMIT 500

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

[Assistant]
The query timed out on the first execution (endpoint read timeout). I'll retry with a lighter query (no ORDER BY, smaller LIMIT) to get results and verify the pattern. If that succeeds, I'll expand or adjust as needed. I'll run a reduced query (LIMIT 200, no ordering).

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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX v: <http://www.wikidata.org/value/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?item ?itemLabel ?part1 ?part1Label ?amt1 ?unit1Label ?part2 ?part2Label ?amt2 ?unit2Label WHERE {
  ?item p:P2044 ?st1 .
  ?item p:P2044 ?st2 .
  FILTER(STR(?st1) < STR(?st2))

  ?st1 psv:P2044 ?raw1 .
  ?st2 psv:P2044 ?raw2 .

  OPTIONAL {
    ?raw1 wikibase:quantityNormalized ?norm1 .
    ?norm1 wikibase:quantityAmount ?normAmt1 .
    ?norm1 wikibase:quantityUnit ?normUnit1 .
  }
  OPTIONAL {
    ?raw1 wikibase:quantityAmount ?rawAmt1 .
    ?raw1 wikibase:quantityUnit ?rawUnit1 .
  }

  OPTIONAL {
    ?raw2 wikibase:quantityNormalized ?norm2 .
    ?norm2 wikibase:quantityAmount ?normAmt2 .
    ?norm2 wikibase:quantityUnit ?normUnit2 .
  }
  OPTIONAL {
    ?raw2 wikibase:quantityAmount ?rawAmt2 .
    ?raw2 wikibase:quantityUnit ?rawUnit2 .
  }

  BIND(COALESCE(?normAmt1, ?rawAmt1) AS ?amt1)
  BIND(COALESCE(?normAmt2, ?rawAmt2) AS ?amt2)
  BIND(COALESCE(?normUnit1, ?rawUnit1) AS ?unit1)
  BIND(COALESCE(?normUnit2, ?rawUnit2) AS ?unit2)

  OPTIONAL { ?st1 pq:P518 ?part1 . }
  OPTIONAL { ?st2 pq:P518 ?part2 . }

  FILTER(BOUND(?amt1) && BOUND(?amt2))
  FILTER(ABS(xsd:decimal(?amt1) - xsd:decimal(?amt2)) > 500)

  ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en")
  OPTIONAL { ?part1 rdfs:label ?part1Label . FILTER(LANG(?part1Label) = "en") }
  OPTIONAL { ?part2 rdfs:label ?part2Label . FILTER(LANG(?part2Label) = "en") }
  OPTIONAL { ?unit1 rdfs:label ?unit1Label . FILTER(LANG(?unit1Label) = "en") }
  OPTIONAL { ?unit2 rdfs:label ?unit2Label . FILTER(LANG(?unit2Label) = "en") }
}
LIMIT 200

SPARQL execution failed:
Waited for a result from another thread which then failed

[Assistant]
I will call cancel because the endpoint timed out repeatedly when executing the comprehensive query across all items. I'll explain the problem and provide the best SPARQL query I constructed (the one I tried), so you can run it locally or I can retry with constraints (e.g., limit to mountains, buildings, or other types) if you want.

cancel

Explanation:
I could not successfully execute the comprehensive SPARQL query against the local Wikidata endpoint: execution attempts timed out or failed (read timeout / thread failure). The intended query is fairly heavy because it joins p:P2044 statement nodes, their value nodes and normalized quantities across the entire dataset, and then compares every pair of elevation statements per item. The endpoint appears to be unable to return results for that broad query within the time limits.

Suggested mitigations:
- Run the provided query directly on a production Wikidata SPARQL endpoint (which may be more responsive) or on a local copy with more generous time limits.
- Or narrower queries: restrict to particular classes (e.g., mountains: ?item wdt:P31/wdt:P279* wd:Q8502 or wd:Q8502? check exact class), or geographic types, or a time window. This reduces result size and should run faster.
- If you want, I can re-run a narrower query (for example: only items that are instance of mountain, hill, summit, or city) and return results.

Below is my best SPARQL attempt (the query I tried to execute). It finds items with two distinct elevation statements (p:P2044), extracts normalized amounts (falling back to raw amounts), includes pq:P518 "applies to part" qualifiers where present, and filters pairs whose absolute difference exceeds 500 meters.

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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX v: <http://www.wikidata.org/value/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?item ?itemLabel ?part1 ?part1Label ?amt1 ?unit1Label ?part2 ?part2Label ?amt2 ?unit2Label WHERE {
  ?item p:P2044 ?st1 .
  ?item p:P2044 ?st2 .
  FILTER(STR(?st1) < STR(?st2))

  ?st1 psv:P2044 ?raw1 .
  ?st2 psv:P2044 ?raw2 .

  OPTIONAL {
    ?raw1 wikibase:quantityNormalized ?norm1 .
    ?norm1 wikibase:quantityAmount ?normAmt1 .
    ?norm1 wikibase:quantityUnit ?normUnit1 .
  }
  OPTIONAL {
    ?raw1 wikibase:quantityAmount ?rawAmt1 .
    ?raw1 wikibase:quantityUnit ?rawUnit1 .
  }

  OPTIONAL {
    ?raw2 wikibase:quantityNormalized ?norm2 .
    ?norm2 wikibase:quantityAmount ?normAmt2 .
    ?norm2 wikibase:quantityUnit ?normUnit2 .
  }
  OPTIONAL {
    ?raw2 wikibase:quantityAmount ?rawAmt2 .
    ?raw2 wikibase:quantityUnit ?rawUnit2 .
  }

  BIND(COALESCE(?normAmt1, ?rawAmt1) AS ?amt1)
  BIND(COALESCE(?normAmt2, ?rawAmt2) AS ?amt2)
  BIND(COALESCE(?normUnit1, ?rawUnit1) AS ?unit1)
  BIND(COALESCE(?normUnit2, ?rawUnit2) AS ?unit2)

  OPTIONAL { ?st1 pq:P518 ?part1 . }
  OPTIONAL { ?st2 pq:P518 ?part2 . }

  FILTER(BOUND(?amt1) && BOUND(?amt2))
  FILTER(ABS(xsd:decimal(?amt1) - xsd:decimal(?amt2)) > 500)

  ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en")
  OPTIONAL { ?part1 rdfs:label ?part1Label . FILTER(LANG(?part1Label) = "en") }
  OPTIONAL { ?part2 rdfs:label ?part2Label . FILTER(LANG(?part2Label) = "en") }
  OPTIONAL { ?unit1 rdfs:label ?unit1Label . FILTER(LANG(?unit1Label) = "en") }
  OPTIONAL { ?unit2 rdfs:label ?unit2Label . FILTER(LANG(?unit2Label) = "en") }
}
LIMIT 500