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 ?place ?placeLabel ( GROUP_CONCAT( DISTINCT STR( ?instance ) ; separator = "|" ) AS ?instanceIRIs ) ( GROUP_CONCAT( DISTINCT ?instanceLabel ; separator = "|" ) AS ?instanceLabels ) ( GROUP_CONCAT( DISTINCT STR( ?part ) ; separator = "|" ) AS ?partIRIs ) ( GROUP_CONCAT( DISTINCT ?partLabel ; separator = "|" ) AS ?partLabels ) WHERE {
  ?place wdt:P37 wd:Q9027 .
  ?place wdt:P31 / wdt:P279 * wd:Q56061 .
  OPTIONAL {
    ?place wdt:P31 ?instance .
    ?instance rdfs:label ?instanceLabel .
    FILTER ( LANG( ?instanceLabel ) = "en" )
  }
  OPTIONAL {
    ?place wdt:P131 ?part .
    ?part rdfs:label ?partLabel .
    FILTER ( LANG( ?partLabel ) = "en" )
  }
  ?place rdfs:label ?placeLabel .
  FILTER ( LANG( ?placeLabel ) = "en" )
}
GROUP BY ?place ?placeLabel
ORDER BY ?placeLabel

Using entities:
- administrative territorial entity (wd:Q56061), also known as administrative divisions, administrative region, administrative unit, constituent unit: is subclass of human-geographic territorial entity / is subclass of political entity / territorial entity for administration purposes, with or without its own local government / territorial entity for administration purposes, with or without its own local government / territorial entity for administration purposes, with or without its own local government
- Swedish (wd:Q9027), also known as sv, Svenska, swe, swed1254, Swedish language: is instance of modern language / is instance of language / is subclass of East Scandinavian / North Germanic language spoken in Sweden / North Germanic language spoken in Sweden and Finland

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.
- subclass of (wd:P279 as wdt), also known as all members of this class also belong to, category of, form of, has superclass, is a class of, etc.: this item is a subclass (subset) of that item; ALL instances ... of volcanic landform); Everest is an instance of mountain / this item is a subclass (subset) of that item; all instances ... instance of volcanic landform); K2 is an instance of mountain / this item is a subclass (subset) of that item; all instances ... instance of volcanic landform); K2 is an instance of mountain / this item is a subclass (subset) of that item; all instances ... instance of volcanic landform); K2 is an instance of mountain
- 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
- official language (wd:P37 as wdt), also known as language official, language spoken, speaking, spoken in, P37: is subproperty of language used / language designated as official by this item / language designated as official by this item / language designated as official by this item / language designated as official by this item

Got 147 rows and 6 columns, showing the first 5 and last 5 rows below:
| place                                | placeLabel                        | instanceIRIs                                                                  | instanceLabels                                | partIRIs                               | partLabels                    |
| ------------------------------------ | --------------------------------- | ----------------------------------------------------------------------------- | --------------------------------------------- | -------------------------------------- | ----------------------------- |
| Åland (wd:Q5689)                     | Åland (lang:en)                   | http://www.wikidata.org/entity/Q782614|http://www.wikidata.org/entity/Q193512 | autonomous region|region of Finland (lang:en) | http://www.wikidata.org/entity/Q33     | Finland (lang:en)             |
| Älvdalen Municipality (wd:Q123855)   | Älvdalen Municipality (lang:en)   | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q103732 | Dalarna County (lang:en)      |
| Älvkarleby Municipality (wd:Q59858)  | Älvkarleby Municipality (lang:en) | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q104926 | Uppsala County (lang:en)      |
| Åre Municipality (wd:Q271153)        | Åre Municipality (lang:en)        | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q103679 | Jämtland County (lang:en)     |
| Arjeplog Municipality (wd:Q493855)   | Arjeplog Municipality (lang:en)   | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q103686 | Norrbotten County (lang:en)   |
| ...                                  | ...                               | ...                                                                           | ...                                           | ...                                    | ...                           |
| Vantaa (wd:Q127623)                  | Vantaa (lang:en)                  | http://www.wikidata.org/entity/Q856076|http://www.wikidata.org/entity/Q515    | municipality of Finland|city (lang:en)        | http://www.wikidata.org/entity/Q5711   | Uusimaa (lang:en)             |
| Vårdö (wd:Q179749)                   | Vårdö (lang:en)                   | http://www.wikidata.org/entity/Q856076                                        | municipality of Finland (lang:en)             | http://www.wikidata.org/entity/Q5689   | Åland (lang:en)               |
| Västerås Municipality (wd:Q34550)    | Västerås Municipality (lang:en)   | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q105075 | Västmanland County (lang:en)  |
| Vilhelmina Municipality (wd:Q515861) | Vilhelmina Municipality (lang:en) | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q104877 | Västerbotten County (lang:en) |
| Vörå (wd:Q2156306)                   | Vörå (lang:en)                    | http://www.wikidata.org/entity/Q856076                                        | municipality of Finland (lang:en)             | http://www.wikidata.org/entity/Q5702   | Ostrobothnia (lang:en)        |

Answer:
I executed the query and found 147 places matching the criterion (items that are administrative/territorial entities and have Swedish as an official language).

Returned columns:
- place: the place IRI (Wikidata entity)
- placeLabel: the English label of the place
- instanceIRIs: pipe-separated list of distinct P31 IRIs (instance-of values) for that place
- instanceLabels: pipe-separated list of the corresponding English labels for those instances
- partIRIs: pipe-separated list of distinct P131 IRIs (entities the place is part of)
- partLabels: pipe-separated list of the corresponding English labels for those part-of entities

The results are ordered alphabetically by placeLabel. Example rows (from the results):
- Åland (wd:Q5689): instanceLabels = "autonomous region|region of Finland"; partLabels = "Finland"
- Vantaa (wd:Q127623): instanceLabels = "municipality of Finland|city"; partLabels = "Uusimaa"
- Vörå (wd:Q2156306): instanceLabels = "municipality of Finland"; partLabels = "Ostrobothnia"

If you want, I can (a) return the full result table here, (b) expand instanceIRIs/partIRIs into separate rows so each instance/part-of appears on its own row, or (c) relax/strengthen the place filter (for example include non-administrative places or organizations). Which would you prefer?

I executed the query and found 147 places matching the criterion (items that are administrative/territorial entities and have Swedish as an official language).

Returned columns:
- place: the place IRI (Wikidata entity)
- placeLabel: the English label of the place
- instanceIRIs: pipe-separated list of distinct P31 IRIs (instance-of values) for that place
- instanceLabels: pipe-separated list of the corresponding English labels for those instances
- partIRIs: pipe-separated list of distinct P131 IRIs (entities the place is part of)
- partLabels: pipe-separated list of the corresponding English labels for those part-of entities

The results are ordered alphabetically by placeLabel. Example rows (from the results):
- Åland (wd:Q5689): instanceLabels = "autonomous region|region of Finland"; partLabels = "Finland"
- Vantaa (wd:Q127623): instanceLabels = "municipality of Finland|city"; partLabels = "Uusimaa"
- Vörå (wd:Q2156306): instanceLabels = "municipality of Finland"; partLabels = "Ostrobothnia"

If you want, I can (a) return the full result table here, (b) expand instanceIRIs/partIRIs into separate rows so each instance/part-of appears on its own row, or (c) relax/strengthen the place filter (for example include non-administrative places or organizations). Which would you prefer?

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 ?place ?placeLabel ( GROUP_CONCAT( DISTINCT STR( ?instance ) ; separator = "|" ) AS ?instanceIRIs ) ( GROUP_CONCAT( DISTINCT ?instanceLabel ; separator = "|" ) AS ?instanceLabels ) ( GROUP_CONCAT( DISTINCT STR( ?part ) ; separator = "|" ) AS ?partIRIs ) ( GROUP_CONCAT( DISTINCT ?partLabel ; separator = "|" ) AS ?partLabels ) WHERE {
  ?place wdt:P37 wd:Q9027 .
  ?place wdt:P31 / wdt:P279 * wd:Q56061 .
  OPTIONAL {
    ?place wdt:P31 ?instance .
    ?instance rdfs:label ?instanceLabel .
    FILTER ( LANG( ?instanceLabel ) = "en" )
  }
  OPTIONAL {
    ?place wdt:P131 ?part .
    ?part rdfs:label ?partLabel .
    FILTER ( LANG( ?partLabel ) = "en" )
  }
  ?place rdfs:label ?placeLabel .
  FILTER ( LANG( ?placeLabel ) = "en" )
}
GROUP BY ?place ?placeLabel
ORDER BY ?placeLabel

Using entities:
- administrative territorial entity (wd:Q56061), also known as administrative divisions, administrative region, administrative unit, constituent unit: is subclass of human-geographic territorial entity / is subclass of political entity / territorial entity for administration purposes, with or without its own local government / territorial entity for administration purposes, with or without its own local government / territorial entity for administration purposes, with or without its own local government
- Swedish (wd:Q9027), also known as sv, Svenska, swe, swed1254, Swedish language: is instance of modern language / is instance of language / is subclass of East Scandinavian / North Germanic language spoken in Sweden / North Germanic language spoken in Sweden and Finland

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.
- subclass of (wd:P279 as wdt), also known as all members of this class also belong to, category of, form of, has superclass, is a class of, etc.: this item is a subclass (subset) of that item; ALL instances ... of volcanic landform); Everest is an instance of mountain / this item is a subclass (subset) of that item; all instances ... instance of volcanic landform); K2 is an instance of mountain / this item is a subclass (subset) of that item; all instances ... instance of volcanic landform); K2 is an instance of mountain / this item is a subclass (subset) of that item; all instances ... instance of volcanic landform); K2 is an instance of mountain
- 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
- official language (wd:P37 as wdt), also known as language official, language spoken, speaking, spoken in, P37: is subproperty of language used / language designated as official by this item / language designated as official by this item / language designated as official by this item / language designated as official by this item

Execution result:
Got 147 rows and 6 columns, showing the first 5 and last 5 rows below:
| place                                | placeLabel                        | instanceIRIs                                                                  | instanceLabels                                | partIRIs                               | partLabels                    |
| ------------------------------------ | --------------------------------- | ----------------------------------------------------------------------------- | --------------------------------------------- | -------------------------------------- | ----------------------------- |
| Åland (wd:Q5689)                     | Åland (lang:en)                   | http://www.wikidata.org/entity/Q782614|http://www.wikidata.org/entity/Q193512 | autonomous region|region of Finland (lang:en) | http://www.wikidata.org/entity/Q33     | Finland (lang:en)             |
| Älvdalen Municipality (wd:Q123855)   | Älvdalen Municipality (lang:en)   | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q103732 | Dalarna County (lang:en)      |
| Älvkarleby Municipality (wd:Q59858)  | Älvkarleby Municipality (lang:en) | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q104926 | Uppsala County (lang:en)      |
| Åre Municipality (wd:Q271153)        | Åre Municipality (lang:en)        | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q103679 | Jämtland County (lang:en)     |
| Arjeplog Municipality (wd:Q493855)   | Arjeplog Municipality (lang:en)   | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q103686 | Norrbotten County (lang:en)   |
| ...                                  | ...                               | ...                                                                           | ...                                           | ...                                    | ...                           |
| Vantaa (wd:Q127623)                  | Vantaa (lang:en)                  | http://www.wikidata.org/entity/Q856076|http://www.wikidata.org/entity/Q515    | municipality of Finland|city (lang:en)        | http://www.wikidata.org/entity/Q5711   | Uusimaa (lang:en)             |
| Vårdö (wd:Q179749)                   | Vårdö (lang:en)                   | http://www.wikidata.org/entity/Q856076                                        | municipality of Finland (lang:en)             | http://www.wikidata.org/entity/Q5689   | Åland (lang:en)               |
| Västerås Municipality (wd:Q34550)    | Västerås Municipality (lang:en)   | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q105075 | Västmanland County (lang:en)  |
| Vilhelmina Municipality (wd:Q515861) | Vilhelmina Municipality (lang:en) | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q104877 | Västerbotten County (lang:en) |
| Vörå (wd:Q2156306)                   | Vörå (lang:en)                    | http://www.wikidata.org/entity/Q856076                                        | municipality of Finland (lang:en)             | http://www.wikidata.org/entity/Q5702   | Ostrobothnia (lang:en)        |

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

You should follow a step-by-step approach to generate the SPARQL query:
1. Determine possible entities and properties implied by the user question.
2. Search for the entities and properties in the knowledge graphs. Where applicable, constrain the searches with already identified entities and properties.
3. Gradually build up the SPARQL query using the identified entities and properties. Start with simple queries and add more complexity as needed. Execute intermediate queries to get feedback and to verify your assumptions. You may need to refine or rethink your current plan based on the query results and go back to step 2 if needed, possibly multiple times.
4. Use the answer or cancel function to finalize your answer and stop the generation process.

Available knowledge graphs:
- wikidata at http://localhost:7001 with prefix index for entities and similarity index for properties, and notes:
  - P106 = occupation. Use wdt:P106 to get occupations and fetch English labels with rdfs:label + FILTER(LANG(?label)="en"). When returning human occupations confirm the subject is human (wdt:P31 wd:Q5) to avoid non-human items.
  - Population (P1082) and tabular (P4179): use wdt:P1082 for quick/direct values; for time-series/point-in-time use p:P1082 + ps:P1082 + pq:P585 and ORDER BY pq:P585 DESC. Inspect statement qualifiers (e.g., 'applies to part') and prov:wasDerivedFrom references (pr:P854 etc.) to detect city-proper vs metro/prefecture scopes before using values.
  - Common person properties: P31 (instance of human Q5), P106 (occupation), P569 (date of birth), P19 (place of birth), P27 (country of citizenship), P21 (sex/gender), P166 (award received). Use wdt: for direct values when possible.
  - P17 (country) can be incomplete/misleading for places (historical/overseas tags). To get modern cities in a country combine: instance-of city (P31=Q515) + wdt:P17 OR use wdt:P131* to find an admin parent whose wdt:P17 = the country. Also cross-check coordinates (P625) or admin hierarchy to spot outliers.
  - When filtering by date of birth (P569) use xsd:dateTime comparisons (e.g. >= "1900-01-01T00:00:00Z"^^xsd:dateTime). Be aware many items have year-only or imprecise dates and coverage is biased toward notable/public figures (sportspeople, politicians, artists).
  - To retrieve qualifiers (e.g., award year) use the statement/qualifier pattern: p:Pxxx / ps:Pxxx / pq:P585. Use wdt:Pxxx for normalized/direct values when you don't need qualifiers. Example: p:P166 + pq:P585 gives award year.
  - To get a person's occupations: use wdt:P106 for direct/normalized values and rdfs:label for human-readable names (FILTER(LANG(...))). Example: wd:Q... wdt:P106 ?occ . ?occ rdfs:label ?occLabel . FILTER(LANG(?occLabel)="en").
  - P166 = award received. Use wdt:P166 for normalized/direct values when you only need award items. To get award years or qualifiers use p:P166 / ps:P166 / pq:P585. Many statements lack pq:P585 — use OPTIONAL { ?stmt pq:P585 ?date } and ORDER BY DESC(?date). When listing award winners, filter ?person wdt:P31 wd:Q5 to ensure humans.
  - Population time-series pattern: wd:Q... p:P1082 ?stmt . ?stmt ps:P1082 ?pop . OPTIONAL { ?stmt pq:P585 ?date } . ORDER BY DESC(?date). pq:P585 is the point-in-time qualifier. IMPORTANT: time-series may mix scopes (city proper vs metro) — e.g., Tokyo has a 2016 entry ~38,140,000 likely metro vs smaller city figures. Inspect qualifiers/references for scope before use.
  - Use wdt:P131* to traverse the admin hierarchy and compare wdt:P17 on the place vs an admin parent to detect historical/colonial country assignments. When mismatches appear, inspect the admin parent's instance-of (P31), labels, qualifiers and references to interpret the historical scope.
  - wdt:P106 often yields multiple occupations for a person. Use GROUP_CONCAT(DISTINCT ?occLabel; separator=", ") or return multiple rows. Always fetch labels with rdfs:label + FILTER(LANG(?label)="en") to get readable occupation names.
  - When a search_entity returns multiple hits (person vs sculpture vs memorial), confirm you selected the human/statements by checking wdt:P31 (instance of) and relevant wdt: properties (e.g., wdt:P106). This avoids using a non-human QID by mistake.
  - search_autocomplete can be constrained with a SPARQL pattern containing ?search (e.g., SELECT * WHERE { ?search wdt:P31 wd:Q5 }). Use constraints to focus results (e.g., humans) and avoid ambiguous fallbacks; if it returns no results, fallback to search_entity and verify wdt:P31.
  - Use search_property_of_entity to find relevant properties for an entity (e.g., 'award' -> P166) and search_object_of_property to discover candidate objects (e.g., 'physicist' for P106). This reduces guessing P/Q ids and surfaces qualifiers.
  - Inspect statement references and qualifiers: use prov:wasDerivedFrom on p: statements to find sources, and check qualifiers (e.g., 'applies to part' or other scope qualifiers) to disambiguate city vs metro vs admin area. Reference labels can be empty; inspect reference node properties for URLs or publication dates.

Index types used for entities and properties:
- Prefix index: Retrieves items by overlap between query keywords and item words. The query keywords can match item words exactly or as prefixes.
- Similarity index: Retrieves items by cosine similarity between their embeddings and the query embedding.

General notes across knowledge graphs:
- Use rdfs:label + FILTER(LANG(?label)="en") for labels; avoid SERVICE wikibase:label. Use wdt:Pxxx for normalized/direct values when qualifiers aren't needed. Use p:Pxxx / ps:Pxxx / pq:Pxxx to access statement qualifiers (e.g., award year via pq:P585). When dates matter, prefer xsd:dateTime and watch for year-only precision.
- Practical query patterns: use rdfs:label + FILTER(LANG(...)) for labels. Use wdt:Pxxx for direct/normalized values when qualifiers aren't needed. Use p:Pxxx / ps:Pxxx / pq:Pxxx to access qualifiers (dates via pq:P585). For dates use xsd:dateTime and expect year-only precision. For places: combine P17 with P131 or coordinate (P625) filters to avoid historical/overseas mismatches.
- Use OPTIONAL for pq: qualifiers (e.g., pq:P585), sort by qualifier (ORDER BY pq:P585 DESC) to prefer recent values. Use GROUP_CONCAT to combine multiple labels/values in one row. Watch for typed literals (xsd:dateTime, xsd:decimal) when filtering or sorting.
- Before querying, use search_entity to resolve human-friendly names to wd:Q identifiers and verify instance-of (e.g., check wdt:P31 = wd:Q5 for humans) to avoid ambiguous matches. Prefer the top match but programmatically confirm P31 before using its data.
- Use search_property to confirm property identifiers (e.g., "country" -> P17) before embedding them in queries. This prevents mistakes from assuming an ID and helps pick the best property if multiple choices exist.
- search_autocomplete can fall back to an unconstrained search or error when there are too many candidates. If this happens (e.g., "more than the maximum supported number of subject candidates"), retry with narrower constraints such as instance-of (wdt:P31), additional type filters, or short prefixes to reduce the candidate set; otherwise fallback to search_entity and verify wdt:P31.
- Use list(...) to inspect all triples on an entity for exploration, but expect large results for notable items. Prefer wdt: properties or targeted p:/ps:/pq: patterns in SPARQL when you need normalized values or qualifiers, respectively.
- Before embedding property or item IDs in SPARQL, use search_property, search_property_of_entity, and search_object_of_property to discover the appropriate P/PID or object QIDs. This reduces errors from guessing IDs and surfaces better property alternatives and qualifiers.
- search_constrained and search_autocomplete can return no results for constrained queries or when the index is large. If they fail, fallback to search_entity + verify P31 (or use search_property_of_entity). Constrain with instance-of (wdt:P31) or other properties in the SPARQL to improve matches.
- When selecting awards by year, prefer xsd:dateTime range filters (e.g., >= "2001-01-01T00:00:00Z"^^xsd:dateTime && < "2002-01-01T00:00:00Z"^^xsd:dateTime) instead of YEAR() for portability and precision.
- When selecting award winners via wdt:P166, filter ?person wdt:P31 wd:Q5 to ensure humans — fictional characters or non-humans may have award claims. If you need award years use p:P166 / ps:P166 / pq:P585 and OPTIONAL { ?stmt pq:P585 ?year } to retrieve qualifier years.
- Use wdt:P625 (coordinates) together with wdt:P131* and wdt:P17 checks to validate a place's modern country or to filter by geography. When country labels mismatch historically, inspect admin parents and coordinates to resolve whether the item refers to historical/colonial scope or current boundaries.
- Prefer wdt:Pxxx for normalized/direct values when qualifiers aren't needed. Use p:Pxxx / ps:Pxxx / pq:Pxxx to access qualifiers (e.g., pq:P585 for award year). Always fetch labels with rdfs:label + FILTER(LANG(?label) = "en").
- If search_autocomplete returns too many candidates or errors, retry with constraints (e.g., SELECT * WHERE { ?search wdt:P31 wd:Q5 }) or narrower query text. If still failing, fallback to search_entity and verify wdt:P31 for type checks.
- For award-year queries use p:P166 / ps:P166 / pq:P585 to access award statements and year qualifiers. Filter by xsd:dateTime ranges (e.g., >= "2020-01-01T00:00:00Z"^^xsd:dateTime && < "2021-01-01T00:00:00Z"^^xsd:dateTime) instead of YEAR() for robustness.
- Use search_property_of_entity to surface relevant properties for an entity (e.g., 'birth' -> P569/P19). list(...) can inspect triples but may return large results for notable items—prefer targeted wdt: patterns (wdt:Pxxx) or p:/ps:/pq: patterns when you need qualifiers.

SPARQL prefixes for use in function calls:
- bd: <http://www.bigdata.com/rdf#
- cc: <http://creativecommons.org/ns#
- data: <https://www.wikidata.org/wiki/Special:EntityData/
- dc: <http://purl.org/dc/elements/1.1/
- dct: <http://purl.org/dc/terms/
- foaf: <http://xmlns.com/foaf/0.1/
- geo: <http://www.opengis.net/ont/geosparql#
- geof: <http://www.opengis.net/def/function/geosparql/
- gn: <http://www.geonames.org/ontology#
- hint: <http://www.bigdata.com/queryHints#
- imdb: <https://www.imdb.com/
- math: <http://www.w3.org/2005/xpath-functions/math#
- ontolex: <http://www.w3.org/ns/lemon/ontolex#
- owl: <http://www.w3.org/2002/07/owl#
- p: <http://www.wikidata.org/prop/
- pq: <http://www.wikidata.org/prop/qualifier/
- pqn: <http://www.wikidata.org/prop/qualifier/value-normalized/
- pqv: <http://www.wikidata.org/prop/qualifier/value/
- pr: <http://www.wikidata.org/prop/reference/
- prn: <http://www.wikidata.org/prop/reference/value-normalized/
- prov: <http://www.w3.org/ns/prov#
- prv: <http://www.wikidata.org/prop/reference/value/
- ps: <http://www.wikidata.org/prop/statement/
- psn: <http://www.wikidata.org/prop/statement/value-normalized/
- psv: <http://www.wikidata.org/prop/statement/value/
- qb: <http://purl.org/linked-data/cube#
- qfn: <http://qlever.cs.uni-freiburg.de/function#
- ql: <http://qlever.cs.uni-freiburg.de/builtin-functions/
- qlss: <https://qlever.cs.uni-freiburg.de/spatialSearch/
- rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#
- rdfs: <http://www.w3.org/2000/01/rdf-schema#
- ref: <http://www.wikidata.org/reference/
- s: <http://www.wikidata.org/entity/statement/
- schema: <http://schema.org/
- skos: <http://www.w3.org/2004/02/skos/core#
- v: <http://www.wikidata.org/value/
- void: <http://rdfs.org/ns/void#
- wd: <http://www.wikidata.org/entity/
- wdno: <http://www.wikidata.org/prop/novalue/
- wdt: <http://www.wikidata.org/prop/direct/
- wdtn: <http://www.wikidata.org/prop/direct-normalized/
- wikibase: <http://wikiba.se/ontology#
- xsd: <http://www.w3.org/2001/XMLSchema#

Additional rules to follow:
- Explain your thought process before and after each step and function call.
- Do not just use or make up entity or property identifiers without verifying their existence in the knowledge graphs first.
- Do not ask the user for clarifications without first attempting to complete the task. If the task input is incomplete or ambiguous, try to make reasonable assumptions and document them.
- Do not use "SERVICE wikibase:label { bd:serviceParam wikibase:language ..." in SPARQL queries. It is not SPARQL standard and unsupported by the used QLever SPARQL endpoints. Use rdfs:label or similar properties to get labels instead.
- Always execute your final SPARQL query before giving an answer to make sure it returns the expected results.
- The SPARQL query should always return the actual identifiers / IRIs of the items in its result. It additionally may return labels or other human-readable information, but they are optional and should be put within optional clauses unless explicitly requested by the user.
- Do not stop early if there are still obvious improvements to be made to the SPARQL query. For example, keep refining your SPARQL query if its result contains irrelevant items or is missing items you expected.
- Do not perform additional computation (e.g. filtering, sorting, calculations) on the result of the SPARQL query to determine the answer. All computation should be done solely within SPARQL.
- For questions with a "True" or "False" answer the SPARQL query should be an ASK query.

[User] What are the distinct places where the official language is Swedish, along with their labels, the unique instances they belong to (if available), and the unique entities they are part of (if available)? Order results alphabetically by place label.

[Assistant]
I'll first look up the property for "official language" and the item for the Swedish language so I can use their exact identifiers in the query. I'll search for the property "official language" and the entity "Swedish". Then I'll build a SPARQL query that finds items with that property pointing to Swedish, returning the place, its rdfs:label, the item's instance(s) (P31) and their labels, and the entities the place is part of via P131 and their labels. I'll include OPTIONALs for P31 and P131 since they may be missing, and ensure labels are English. I'll order results alphabetically by the place label.

Now I'll search for the property "official language".

Question: official language

Top 10 property alternatives:
1. official language (wd:P37 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as language official, language spoken, speaking, spoken in, P37: language designated as official by this item / language designated as official by this item / language designated as official by this item / language designated as official by this item / is subproperty of language used
2. native label (wd:P1705 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via official language name), also known as autonym, label in official language, label in original language, name in official language, name in original language, etc.: label for the items in their official language (P37) or their original language (P364) / label for the items in their official language (P37) or their original language (P364) / label for the items in their official language (P37) or their original language (P364) / label for the items in their official language  or their original language / is subproperty of name
3. original language of film or TV show (wd:P364 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via original language), also known as created on language, language of the original work, media language, original language, P364: language in which a film or a performance work was originally ... and songs; use P407 ("language of work or name") instead. / language in which a film or a performance work was originally ... written works; use P407 ("language of work or name") instead. / language in which a film or a performance work was originally ... written works; use P407 ("language of work or name") instead. / is subproperty of language of work or name
4. language used (wd:P2936 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via working language), also known as languages used, medium of instruction, used language, uses language, working language, etc.: language widely used (spoken or written) in this place or at this event or organisation
5. native language (wd:P103 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via first language), also known as first language, L1 speaker of, language native, mother tongue, P103: language or languages a person has learned from early childhood / is subproperty of languages spoken, written or signed / language or languages a person has learned from birth / language or languages a person has learned from birth
6. language regulatory body (wd:P1018 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via language authority), also known as language authority, regulatory body, P1018: regulatory body of a language
7. language of work or name (wd:P407 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via used language), also known as audio language, available in, broadcasting language, language, language of name, etc.: language associated with this creative work (such as books, ... (P103) and "languages spoken, written or signed" (P1412)) / language associated with this creative work (such as books, ... (P103) and "languages spoken, written or signed" (P1412)) / language associated with this work or name (for persons use P103 and P1412)
8. languages spoken, written or signed (wd:P1412 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via used language), also known as language, language of expression, language read, language signed, languages of expression, etc.: language(s) that a person or a people speaks, writes or signs, including the native language(s) / language(s) that a person speaks or writes, including the native language(s) / language(s) that a person speaks or writes, including the native language(s)
9. programmed in (wd:P277 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via language), also known as language, programming language, written in, P277: the programming language(s) in which the software is developed
10. Ethnologue language status (wd:P3823 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via language status), also known as EGIDS, language status, P3823: language status identifier by Ethnologue.com using EGIDS scale / language status identifier by Ethnologue.com using EGIDS scale

[Assistant]
Now I'll look up the Wikidata item for the Swedish language (search "Swedish") to get its Q-id for use in the query.

Question: Swedish

Top 10 entity alternatives:
1. Swedish (wd:Q9027), also known as sv, Svenska, swe, swed1254, Swedish language: North Germanic language spoken in Sweden and Finland / North Germanic language spoken in Sweden / is subclass of East Scandinavian / is instance of modern language / is instance of language
2. Swedes (wd:Q165192, matched via Swedish), also known as Swedish, Swedish people: is subclass of Western Europeans / ethnic group in Northern Europe / is subclass of European people / is subclass of Scandinavians / is instance of ethnic group
3. name of Sweden (wd:Q6961537, matched via Swedish), also known as Swedish: etymology of the country's name / etymology of the country name / is instance of etymology
4. iTunes U > Languages > Swedish (wd:Q110594184, matched via Swedish), also known as iTunes U - Languages - Swedish, Swedish: is instance of iTunes U genre / iTunes U genre
5. Swedes (wd:Q113018337, matched via Swedish), also known as Swedish, Swedish citizens, Swedish people: people from or citizens of Sweden / is instance of human population / is subclass of Scandinavians / is instance of Population / is instance of population / is subclass of inhabitant / is instance of nation
6. Swedish (wd:Q37472356): is instance of family name / is instance of surname / family name / family name / surname
7. Swedish (wd:Q57477725): is instance of scholarly article / is instance of academic article / scholarly article
8. Sweden (wd:Q34, matched via Swedish Kingdom), also known as Kingdom of Sweden, se, SWE, Swedish Kingdom: is instance of sovereign state / country in Northern Europe / country in Northern Europe / country in Northern Europe / is instance of country
9. Swedish Wikipedia (wd:Q169514), also known as sv.wiki, svwiki, Svwiki, sv.wikipedia, svwikipedia, etc.: is instance of Wikipedia language edition / Swedish-language edition of Wikipedia
10. Swedish krona (wd:Q122922), also known as SEK: is instance of currency / is instance of crown / currency of Sweden

[Assistant]
I'll search for an appropriate general class for places such as "territorial entity" / "administrative territorial entity" to restrict results to geographic places rather than organizations.

Question: administrative territorial entity

Top 10 entity alternatives:
1. administrative territorial entity (wd:Q56061), also known as administrative divisions, administrative region, administrative unit, constituent unit: territorial entity for administration purposes, with or without its own local government / territorial entity for administration purposes, with or without its own local government / territorial entity for administration purposes, with or without its own local government / is subclass of human-geographic territorial entity / is subclass of political entity
2. autonomous administrative territorial entity (wd:Q788176), also known as autonomous administrative division, autonomous area, autonomous province, autonomous region, autonomous republic, etc.: is instance of administrative territorial entity type / region with some freedom from its central government / is subclass of administrative territorial entity / is subclass of political territorial entity
3. police administrative territorial entity (wd:Q114839325): is subclass of human-geographic territorial entity / law enforcement administrative territorial entity / is subclass of administrative territorial entity
4. non-political administrative territorial entity (wd:Q15642566): country subdivision that does not have its own government and exists only for administrative purposes / is subclass of administrative territorial entity
5. administrative territorial entity type (wd:Q15617994), also known as type of administrative territorial entity: type of administrative divisions, usually used in several countries / is subclass of territorial entity type / is subclass of type of institution / is instance of second-order class / is subclass of legal form / is subclass of class / is subclass of name
6. religious administrative territorial entity (wd:Q20926517), also known as ecclesiastical subdivision, religious territorial entity: is subclass of human-geographic territorial entity / is subclass of administrative territorial entity / religious administration over a geographic area / is subclass of religious administrative entity
7. former administrative territorial entity (wd:Q19953632), also known as extinct administrative division, former administrative division, former country subdivision, former state: is subclass of historical administrative division / administrative division which is no longer in use / is subclass of administrative territorial entity / is subclass of historical geographic location / is subclass of former geographical object
8. historical administrative division (wd:Q19832712, matched via historical administrative territorial entity), also known as historical administrative territorial entity: administrative division which existed in the past, that may ... (Use subclass Q19953632 for divisions which no longer exist). / is subclass of administrative territorial entity / is subclass of historical region
9. administrative territorial entity identifier (wd:Q36205316), also known as ATE ID: identifier system for geographic or territorial entities of any level / is subclass of geocode
10. fictional administrative territorial entity (wd:Q64034456): administrative territorial entity which only exists in a work of fiction / is subclass of fictional artificial entity / is subclass of fictional location

[Assistant]
I'll run a SPARQL query that:
- finds items with wdt:P37 = wd:Q9027 (Swedish language),
- restricts to items that are instances (P31) of (or whose P31 is subclass of) administrative territorial entity (wd:Q56061) to focus on geographic places,
- returns each place IRI and its English label,
- collects distinct instance IRIs and their English labels (from P31),
- collects distinct "part of" IRIs and their English labels (from P131),
- groups results per place and orders by place label alphabetically.

Now I'll execute that query to get the actual results.

execute

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?place ?placeLabel
       (GROUP_CONCAT(DISTINCT STR(?instance); separator="|") AS ?instanceIRIs)
       (GROUP_CONCAT(DISTINCT ?instanceLabel; separator="|") AS ?instanceLabels)
       (GROUP_CONCAT(DISTINCT STR(?part); separator="|") AS ?partIRIs)
       (GROUP_CONCAT(DISTINCT ?partLabel; separator="|") AS ?partLabels)
WHERE {
  # Swedish language
  ?place wdt:P37 wd:Q9027 .
  # restrict to geographic/administrative territorial entities (places)
  ?place wdt:P31/wdt:P279* wd:Q56061 .

  OPTIONAL {
    ?place wdt:P31 ?instance .
    ?instance rdfs:label ?instanceLabel .
    FILTER(LANG(?instanceLabel) = "en")
  }
  OPTIONAL {
    ?place wdt:P131 ?part .
    ?part rdfs:label ?partLabel .
    FILTER(LANG(?partLabel) = "en")
  }

  ?place rdfs:label ?placeLabel .
  FILTER(LANG(?placeLabel) = "en")
}
GROUP BY ?place ?placeLabel
ORDER BY ?placeLabel

Got 147 rows and 6 columns, showing the first 5 and last 5 rows below:
| place                                | placeLabel                        | instanceIRIs                                                                  | instanceLabels                                | partIRIs                               | partLabels                    |
| ------------------------------------ | --------------------------------- | ----------------------------------------------------------------------------- | --------------------------------------------- | -------------------------------------- | ----------------------------- |
| Åland (wd:Q5689)                     | Åland (lang:en)                   | http://www.wikidata.org/entity/Q782614|http://www.wikidata.org/entity/Q193512 | autonomous region|region of Finland (lang:en) | http://www.wikidata.org/entity/Q33     | Finland (lang:en)             |
| Älvdalen Municipality (wd:Q123855)   | Älvdalen Municipality (lang:en)   | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q103732 | Dalarna County (lang:en)      |
| Älvkarleby Municipality (wd:Q59858)  | Älvkarleby Municipality (lang:en) | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q104926 | Uppsala County (lang:en)      |
| Åre Municipality (wd:Q271153)        | Åre Municipality (lang:en)        | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q103679 | Jämtland County (lang:en)     |
| Arjeplog Municipality (wd:Q493855)   | Arjeplog Municipality (lang:en)   | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q103686 | Norrbotten County (lang:en)   |
| ...                                  | ...                               | ...                                                                           | ...                                           | ...                                    | ...                           |
| Vantaa (wd:Q127623)                  | Vantaa (lang:en)                  | http://www.wikidata.org/entity/Q856076|http://www.wikidata.org/entity/Q515    | municipality of Finland|city (lang:en)        | http://www.wikidata.org/entity/Q5711   | Uusimaa (lang:en)             |
| Vårdö (wd:Q179749)                   | Vårdö (lang:en)                   | http://www.wikidata.org/entity/Q856076                                        | municipality of Finland (lang:en)             | http://www.wikidata.org/entity/Q5689   | Åland (lang:en)               |
| Västerås Municipality (wd:Q34550)    | Västerås Municipality (lang:en)   | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q105075 | Västmanland County (lang:en)  |
| Vilhelmina Municipality (wd:Q515861) | Vilhelmina Municipality (lang:en) | http://www.wikidata.org/entity/Q127448                                        | municipality of Sweden (lang:en)              | http://www.wikidata.org/entity/Q104877 | Västerbotten County (lang:en) |
| Vörå (wd:Q2156306)                   | Vörå (lang:en)                    | http://www.wikidata.org/entity/Q856076                                        | municipality of Finland (lang:en)             | http://www.wikidata.org/entity/Q5702   | Ostrobothnia (lang:en)        |

[Assistant]
I will finalize by returning the SPARQL query I executed and a brief summary of the results (number of rows and columns returned, and what each column contains).

answer

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?place ?placeLabel
       (GROUP_CONCAT(DISTINCT STR(?instance); separator="|") AS ?instanceIRIs)
       (GROUP_CONCAT(DISTINCT ?instanceLabel; separator="|") AS ?instanceLabels)
       (GROUP_CONCAT(DISTINCT STR(?part); separator="|") AS ?partIRIs)
       (GROUP_CONCAT(DISTINCT ?partLabel; separator="|") AS ?partLabels)
WHERE {
  ?place wdt:P37 wd:Q9027 .
  ?place wdt:P31/wdt:P279* wd:Q56061 .

  OPTIONAL {
    ?place wdt:P31 ?instance .
    ?instance rdfs:label ?instanceLabel .
    FILTER(LANG(?instanceLabel) = "en")
  }
  OPTIONAL {
    ?place wdt:P131 ?part .
    ?part rdfs:label ?partLabel .
    FILTER(LANG(?partLabel) = "en")
  }

  ?place rdfs:label ?placeLabel .
  FILTER(LANG(?placeLabel) = "en")
}
GROUP BY ?place ?placeLabel
ORDER BY ?placeLabel

Answer:
I executed the query and found 147 places matching the criterion (items that are administrative/territorial entities and have Swedish as an official language).

Returned columns:
- place: the place IRI (Wikidata entity)
- placeLabel: the English label of the place
- instanceIRIs: pipe-separated list of distinct P31 IRIs (instance-of values) for that place
- instanceLabels: pipe-separated list of the corresponding English labels for those instances
- partIRIs: pipe-separated list of distinct P131 IRIs (entities the place is part of)
- partLabels: pipe-separated list of the corresponding English labels for those part-of entities

The results are ordered alphabetically by placeLabel. Example rows (from the results):
- Åland (wd:Q5689): instanceLabels = "autonomous region|region of Finland"; partLabels = "Finland"
- Vantaa (wd:Q127623): instanceLabels = "municipality of Finland|city"; partLabels = "Uusimaa"
- Vörå (wd:Q2156306): instanceLabels = "municipality of Finland"; partLabels = "Ostrobothnia"

If you want, I can (a) return the full result table here, (b) expand instanceIRIs/partIRIs into separate rows so each instance/part-of appears on its own row, or (c) relax/strengthen the place filter (for example include non-administrative places or organizations). Which would you prefer?


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 ?propEntity ?propLabel ( COUNT( ?stmt ) AS ?usageCount ) WHERE {
  ?item wdt:P31 wd:Q40231 .
  ?item ?p ?stmt .
  FILTER ( STRSTARTS( STR( ?p ) , "http://www.wikidata.org/prop/" ) ) .
  FILTER ( ! STRSTARTS( STR( ?p ) , "http://www.wikidata.org/prop/direct/" ) ) .
  BIND( IRI( CONCAT ( "http://www.wikidata.org/entity/" , REPLACE( STR( ?p ) , ".*/(P[0-9]+)$" , "$1" ) ) ) AS ?propEntity ) OPTIONAL {
    ?propEntity rdfs:label ?propLabel .
    FILTER ( LANG( ?propLabel ) = "en" )
  }
}
GROUP BY ?propEntity ?propLabel
ORDER BY DESC ( ?usageCount )
LIMIT 200

Using entities:
- public election (wd:Q40231), also known as election, elections: is subclass of voting / is subclass of competition / process by which a population chooses the holder of a public office

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

Got 158 rows and 3 columns, showing the first 5 and last 5 rows below:
| propEntity | propLabel                                        | usageCount      |
| ---------- | ------------------------------------------------ | --------------- |
| wd:P31     | instance of (lang:en)                            | 24894 (xsd:int) |
| wd:P17     | country (lang:en)                                | 20036 (xsd:int) |
| wd:P2671   | Google Knowledge Graph ID (lang:en)              | 14532 (xsd:int) |
| wd:P585    | point in time (lang:en)                          | 13247 (xsd:int) |
| wd:P726    | candidate (lang:en)                              | 10919 (xsd:int) |
| ...        | ...                                              | ...             |
| wd:P2966   | National Library of Wales Authority ID (lang:en) | 1 (xsd:int)     |
| wd:P2894   | day of week (lang:en)                            | 1 (xsd:int)     |
| wd:P27     | country of citizenship (lang:en)                 | 1 (xsd:int)     |
| wd:P2541   | operating area (lang:en)                         | 1 (xsd:int)     |
| wd:P2257   | event interval (lang:en)                         | 1 (xsd:int)     |

Answer:
I ran a query that: (1) selects Wikidata items whose instance-of (wdt:P31) is public election (wd:Q40231), (2) inspects statement predicates (the p: properties) used on those items, maps those predicates to property entities (e.g., wd:P31), and (3) counts how many statement nodes use each property.

Results summary:
- Number of distinct properties used in statements about items that are instances of public election: 158.
- Top 10 properties by number of p-statement occurrences (property IRI — label — count):
  1. wd:P31 — instance of — 24,894
  2. wd:P17 — country — 20,036
  3. wd:P2671 — Google Knowledge Graph ID — 14,532
  4. wd:P585 — point in time — 13,247
  5. wd:P726 — candidate — 10,919
  6. wd:P1001 — applies to jurisdiction — 10,322
  7. wd:P155 — follows — 10,166
  8. wd:P541 — office contested — 7,610
  9. wd:P156 — followed by — 7,187
 10. wd:P361 — part of — 5,987

The full SPARQL query I executed is included above in the 'sparql' field. If you want the complete list of all 158 properties (not just the top 10), I can return the full table or export it in CSV/JSON.

I ran a query that: (1) selects Wikidata items whose instance-of (wdt:P31) is public election (wd:Q40231), (2) inspects statement predicates (the p: properties) used on those items, maps those predicates to property entities (e.g., wd:P31), and (3) counts how many statement nodes use each property.

Results summary:
- Number of distinct properties used in statements about items that are instances of public election: 158.
- Top 10 properties by number of p-statement occurrences (property IRI — label — count):
  1. wd:P31 — instance of — 24,894
  2. wd:P17 — country — 20,036
  3. wd:P2671 — Google Knowledge Graph ID — 14,532
  4. wd:P585 — point in time — 13,247
  5. wd:P726 — candidate — 10,919
  6. wd:P1001 — applies to jurisdiction — 10,322
  7. wd:P155 — follows — 10,166
  8. wd:P541 — office contested — 7,610
  9. wd:P156 — followed by — 7,187
 10. wd:P361 — part of — 5,987

The full SPARQL query I executed is included above in the 'sparql' field. If you want the complete list of all 158 properties (not just the top 10), I can return the full table or export it in CSV/JSON.

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 ?propEntity ?propLabel ( COUNT( ?stmt ) AS ?usageCount ) WHERE {
  ?item wdt:P31 wd:Q40231 .
  ?item ?p ?stmt .
  FILTER ( STRSTARTS( STR( ?p ) , "http://www.wikidata.org/prop/" ) ) .
  FILTER ( ! STRSTARTS( STR( ?p ) , "http://www.wikidata.org/prop/direct/" ) ) .
  BIND( IRI( CONCAT ( "http://www.wikidata.org/entity/" , REPLACE( STR( ?p ) , ".*/(P[0-9]+)$" , "$1" ) ) ) AS ?propEntity ) OPTIONAL {
    ?propEntity rdfs:label ?propLabel .
    FILTER ( LANG( ?propLabel ) = "en" )
  }
}
GROUP BY ?propEntity ?propLabel
ORDER BY DESC ( ?usageCount )
LIMIT 200

Using entities:
- public election (wd:Q40231), also known as election, elections: is subclass of voting / is subclass of competition / process by which a population chooses the holder of a public office

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

Execution result:
Got 158 rows and 3 columns, showing the first 5 and last 5 rows below:
| propEntity | propLabel                                        | usageCount      |
| ---------- | ------------------------------------------------ | --------------- |
| wd:P31     | instance of (lang:en)                            | 24894 (xsd:int) |
| wd:P17     | country (lang:en)                                | 20036 (xsd:int) |
| wd:P2671   | Google Knowledge Graph ID (lang:en)              | 14532 (xsd:int) |
| wd:P585    | point in time (lang:en)                          | 13247 (xsd:int) |
| wd:P726    | candidate (lang:en)                              | 10919 (xsd:int) |
| ...        | ...                                              | ...             |
| wd:P2966   | National Library of Wales Authority ID (lang:en) | 1 (xsd:int)     |
| wd:P2894   | day of week (lang:en)                            | 1 (xsd:int)     |
| wd:P27     | country of citizenship (lang:en)                 | 1 (xsd:int)     |
| wd:P2541   | operating area (lang:en)                         | 1 (xsd:int)     |
| wd:P2257   | event interval (lang:en)                         | 1 (xsd:int)     |

[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 properties are used in claims related to items that are public elections? Include a count of the number of times it was used.

[Assistant]
Plan:
1. Search for the Wikidata item for "public election" (or similar) to identify the correct Q-id(s).
2. Inspect that item to confirm its IRI and instance-of relationships.
3. Build a SPARQL query that finds all statements (p:... nodes) on items that are instance of "public election" (wdt:P31 wd:Q...) and collects the properties used in those statements, counting occurrences.
4. Execute and refine as needed.

I'll start by searching for the item for "public election".

Question: public election

Top 10 entity alternatives:
1. public election (wd:Q40231), also known as election, elections: process by which a population chooses the holder of a public office / is subclass of competition / is subclass of voting
2. Public election committee (wd:Q127273596)
3. Public Offices Election Act (wd:Q11392186): is instance of law of Japan / is instance of election act / is instance of legislation / is instance of statute
4. Public Official Election Act (wd:Q12592014): is instance of Act of South Korea / is instance of legislation / is instance of statute / South Korean law
5. Election publication praised (wd:Q95492900): is instance of scholarly article / is instance of academic article
6. 2009 New York City Public Advocate election (wd:Q7013284, matched via 2009 NYC Public Advocate election), also known as 2009 NYC Public Advocate election, New York City Public Advocate election, 2009: is instance of public election / is instance of Election / is instance of election
7. Department of Public Elections (wd:Q124322778): government department of Tamil Nadu state, India / is instance of government department / is instance of government agency
8. 2021 New York City Public Advocate election (wd:Q106651975, matched via 2021 NYC Public Advocate election), also known as 2021 NYC Public Advocate election: is instance of public election / is instance of election / is instance of Election
9. 2017 New York City Public Advocate election (wd:Q43078961, matched via 2017 NYC Public Advocate election), also known as 2017 NYC Public Advocate election, New York City Public Advocate election, 2017: is instance of public election / is instance of Election / is instance of election
10. 2013 New York City Public Advocate election (wd:Q17091644, matched via 2013 NYC Public Advocate election), also known as 2013 NYC Public Advocate election, New York City Public Advocate election, 2013: is instance of public election / is instance of Election / is instance of election

[Assistant]
I'll run a SPARQL query that:
- selects items that are instance of "public election" (wd:Q40231),
- finds statement predicates used on those items (the p: predicates),
- maps those predicate IRIs to property entities (e.g., http://www.wikidata.org/entity/P106),
- returns the property entity, its English label, and the count of p-statement occurrences across all public election items,
- ordered by descending count.

Now I'll execute the query to get the actual counts.

execute

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?propEntity ?propLabel (COUNT(?stmt) AS ?usageCount) WHERE {
  ?item wdt:P31 wd:Q40231 .
  ?item ?p ?stmt .
  # only consider p: statement predicates (exclude direct/normalised props)
  FILTER(STRSTARTS(STR(?p), "http://www.wikidata.org/prop/")) .
  FILTER(!STRSTARTS(STR(?p), "http://www.wikidata.org/prop/direct/")) .

  # derive the property entity IRI like http://www.wikidata.org/entity/P106 from the predicate IRI
  BIND(IRI(CONCAT("http://www.wikidata.org/entity/", REPLACE(STR(?p), ".*/(P[0-9]+)$", "$1"))) AS ?propEntity)
  OPTIONAL { ?propEntity rdfs:label ?propLabel . FILTER(LANG(?propLabel) = "en") }
}
GROUP BY ?propEntity ?propLabel
ORDER BY DESC(?usageCount)
LIMIT 200

Got 158 rows and 3 columns, showing the first 5 and last 5 rows below:
| propEntity | propLabel                                        | usageCount      |
| ---------- | ------------------------------------------------ | --------------- |
| wd:P31     | instance of (lang:en)                            | 24894 (xsd:int) |
| wd:P17     | country (lang:en)                                | 20036 (xsd:int) |
| wd:P2671   | Google Knowledge Graph ID (lang:en)              | 14532 (xsd:int) |
| wd:P585    | point in time (lang:en)                          | 13247 (xsd:int) |
| wd:P726    | candidate (lang:en)                              | 10919 (xsd:int) |
| ...        | ...                                              | ...             |
| wd:P2966   | National Library of Wales Authority ID (lang:en) | 1 (xsd:int)     |
| wd:P2894   | day of week (lang:en)                            | 1 (xsd:int)     |
| wd:P27     | country of citizenship (lang:en)                 | 1 (xsd:int)     |
| wd:P2541   | operating area (lang:en)                         | 1 (xsd:int)     |
| wd:P2257   | event interval (lang:en)                         | 1 (xsd:int)     |

[Assistant]
I'll run a second query to fetch the top 10 properties by usage count so I can report them explicitly.

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?propEntity ?propLabel (COUNT(?stmt) AS ?usageCount) WHERE {
  ?item wdt:P31 wd:Q40231 .
  ?item ?p ?stmt .
  FILTER(STRSTARTS(STR(?p), "http://www.wikidata.org/prop/")) .
  FILTER(!STRSTARTS(STR(?p), "http://www.wikidata.org/prop/direct/")) .
  BIND(IRI(CONCAT("http://www.wikidata.org/entity/", REPLACE(STR(?p), ".*/(P[0-9]+)$", "$1"))) AS ?propEntity)
  OPTIONAL { ?propEntity rdfs:label ?propLabel . FILTER(LANG(?propLabel) = "en") }
}
GROUP BY ?propEntity ?propLabel
ORDER BY DESC(?usageCount)
LIMIT 10

Got 10 rows and 3 columns:
| propEntity | propLabel                           | usageCount      |
| ---------- | ----------------------------------- | --------------- |
| wd:P31     | instance of (lang:en)               | 24894 (xsd:int) |
| wd:P17     | country (lang:en)                   | 20036 (xsd:int) |
| wd:P2671   | Google Knowledge Graph ID (lang:en) | 14532 (xsd:int) |
| wd:P585    | point in time (lang:en)             | 13247 (xsd:int) |
| wd:P726    | candidate (lang:en)                 | 10919 (xsd:int) |
| wd:P1001   | applies to jurisdiction (lang:en)   | 10322 (xsd:int) |
| wd:P155    | follows (lang:en)                   | 10166 (xsd:int) |
| wd:P541    | office contested (lang:en)          | 7610 (xsd:int)  |
| wd:P156    | followed by (lang:en)               | 7187 (xsd:int)  |
| wd:P361    | part of (lang:en)                   | 5987 (xsd:int)  |

[Assistant]
answer

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?propEntity ?propLabel (COUNT(?stmt) AS ?usageCount) WHERE {
  ?item wdt:P31 wd:Q40231 .
  ?item ?p ?stmt .
  FILTER(STRSTARTS(STR(?p), "http://www.wikidata.org/prop/")) .
  FILTER(!STRSTARTS(STR(?p), "http://www.wikidata.org/prop/direct/")) .
  BIND(IRI(CONCAT("http://www.wikidata.org/entity/", REPLACE(STR(?p), ".*/(P[0-9]+)$", "$1"))) AS ?propEntity)
  OPTIONAL { ?propEntity rdfs:label ?propLabel . FILTER(LANG(?propLabel) = "en") }
}
GROUP BY ?propEntity ?propLabel
ORDER BY DESC(?usageCount)
LIMIT 200

Answer:
I ran a query that: (1) selects Wikidata items whose instance-of (wdt:P31) is public election (wd:Q40231), (2) inspects statement predicates (the p: properties) used on those items, maps those predicates to property entities (e.g., wd:P31), and (3) counts how many statement nodes use each property.

Results summary:
- Number of distinct properties used in statements about items that are instances of public election: 158.
- Top 10 properties by number of p-statement occurrences (property IRI — label — count):
  1. wd:P31 — instance of — 24,894
  2. wd:P17 — country — 20,036
  3. wd:P2671 — Google Knowledge Graph ID — 14,532
  4. wd:P585 — point in time — 13,247
  5. wd:P726 — candidate — 10,919
  6. wd:P1001 — applies to jurisdiction — 10,322
  7. wd:P155 — follows — 10,166
  8. wd:P541 — office contested — 7,610
  9. wd:P156 — followed by — 7,187
 10. wd:P361 — part of — 5,987

The full SPARQL query I executed is included above in the 'sparql' field. If you want the complete list of all 158 properties (not just the top 10), I can return the full table or export it in CSV/JSON.