PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
SELECT DISTINCT ?item ?itemLabel ?owner ?ownerLabel ?start ?end WHERE {
  wd:Q24027085 wdt:P127 ?owner .
  ?item wdt:P127 ?owner .
  FILTER ( ?item != wd:Q24027085 ) OPTIONAL {
    ?item rdfs:label ?itemLabel .
    FILTER ( LANG( ?itemLabel ) = "en" )
  }
  OPTIONAL {
    ?owner rdfs:label ?ownerLabel .
    FILTER ( LANG( ?ownerLabel ) = "en" )
  }
  OPTIONAL {
    ?item p:P127 ?stmt .
    ?stmt ps:P127 ?owner .
    OPTIONAL {
      ?stmt pq:P580 ?start
    }
    OPTIONAL {
      ?stmt pq:P582 ?end
    }
  }
}
ORDER BY ?itemLabel

Using entities:
- Edward John (wd:Q24027085): is instance of schooner / is instance of merchant vessel / merchant ship

Using properties:
- owned by (wd:P127 as p/ps/wdt), also known as belonged to, belongs to, is owned by, owner, owners, etc.: owner of the subject / owner of the subject / owner of the subject
- start time (wd:P580 as pq), also known as began, beginning, building date, effective, effectivity, etc.: is subproperty of point in time / indicates the time an item begins to exist or a statement starts being valid / indicates the time an item begins to exist or a statement starts being valid / time an entity begins to exist or a statement starts being valid
- end time (wd:P582 as pq), also known as abolished, cease date, cease operation, cease time, closed, etc.: is subproperty of point in time / indicates the time an item ceases to exist or a statement stops being valid / indicates the time an item ceases to exist or a statement stops being valid / moment when an entity ceases to exist and a statement stops being entirely valid or no longer be true

Answer:
I ran the above query. Results summary:

- Owner of the merchant ship Edward John (wd:Q24027085): Thomas Jones (wd:Q56598227).
- The query returned 22 other items owned by Thomas Jones. For each result the query returns the item IRI, its English label (if any), the owner IRI and label, and any ownership start (pq:P580) and end (pq:P582) qualifiers when present.

If you want the full row-by-row results (all 22 rows) in a pasted table, or exported as CSV/JSON, tell me which format you prefer and I will provide it.

I ran the above query. Results summary:

- Owner of the merchant ship Edward John (wd:Q24027085): Thomas Jones (wd:Q56598227).
- The query returned 22 other items owned by Thomas Jones. For each result the query returns the item IRI, its English label (if any), the owner IRI and label, and any ownership start (pq:P580) and end (pq:P582) qualifiers when present.

If you want the full row-by-row results (all 22 rows) in a pasted table, or exported as CSV/JSON, tell me which format you prefer and I will provide it.

SPARQL query over wikidata:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
SELECT DISTINCT ?item ?itemLabel ?owner ?ownerLabel ?start ?end WHERE {
  wd:Q24027085 wdt:P127 ?owner .
  ?item wdt:P127 ?owner .
  FILTER ( ?item != wd:Q24027085 ) OPTIONAL {
    ?item rdfs:label ?itemLabel .
    FILTER ( LANG( ?itemLabel ) = "en" )
  }
  OPTIONAL {
    ?owner rdfs:label ?ownerLabel .
    FILTER ( LANG( ?ownerLabel ) = "en" )
  }
  OPTIONAL {
    ?item p:P127 ?stmt .
    ?stmt ps:P127 ?owner .
    OPTIONAL {
      ?stmt pq:P580 ?start
    }
    OPTIONAL {
      ?stmt pq:P582 ?end
    }
  }
}
ORDER BY ?itemLabel

Using entities:
- Edward John (wd:Q24027085): is instance of schooner / is instance of merchant vessel / merchant ship

Using properties:
- owned by (wd:P127 as p/ps/wdt), also known as belonged to, belongs to, is owned by, owner, owners, etc.: owner of the subject / owner of the subject / owner of the subject
- start time (wd:P580 as pq), also known as began, beginning, building date, effective, effectivity, etc.: is subproperty of point in time / indicates the time an item begins to exist or a statement starts being valid / indicates the time an item begins to exist or a statement starts being valid / time an entity begins to exist or a statement starts being valid
- end time (wd:P582 as pq), also known as abolished, cease date, cease operation, cease time, closed, etc.: is subproperty of point in time / indicates the time an item ceases to exist or a statement stops being valid / indicates the time an item ceases to exist or a statement stops being valid / moment when an entity ceases to exist and a statement stops being entirely valid or no longer be true

Execution result:
Got 22 rows and 6 columns, showing the first 5 and last 5 rows below:
| item                              | itemLabel                    | owner                       | ownerLabel             | start                               | end                                 |
| --------------------------------- | ---------------------------- | --------------------------- | ---------------------- | ----------------------------------- | ----------------------------------- |
| Acorn (wd:Q24027335)              | Acorn (lang:en)              | Thomas Jones (wd:Q56598227) | Thomas Jones (lang:en) |                                     |                                     |
| Anne Jenkins (wd:Q24027244)       | Anne Jenkins (lang:en)       | Thomas Jones (wd:Q56598227) | Thomas Jones (lang:en) | 1862-01-01T00:00:00Z (xsd:dateTime) | 1868-01-01T00:00:00Z (xsd:dateTime) |
| Clarissa (wd:Q24026938)           | Clarissa (lang:en)           | Thomas Jones (wd:Q56598227) | Thomas Jones (lang:en) | 1864-01-01T00:00:00Z (xsd:dateTime) | 1872-01-01T00:00:00Z (xsd:dateTime) |
| Credo (wd:Q24027243)              | Credo (lang:en)              | Thomas Jones (wd:Q56598227) | Thomas Jones (lang:en) | 1863-01-01T00:00:00Z (xsd:dateTime) | 1866-01-01T00:00:00Z (xsd:dateTime) |
| Crusader (wd:Q24027356)           | Crusader (lang:en)           | Thomas Jones (wd:Q56598227) | Thomas Jones (lang:en) | 1870-01-01T00:00:00Z (xsd:dateTime) | 1881-01-01T00:00:00Z (xsd:dateTime) |
| ...                               | ...                          | ...                         | ...                    | ...                                 | ...                                 |
| Rowland Evans (wd:Q24027354)      | Rowland Evans (lang:en)      | Thomas Jones (wd:Q56598227) | Thomas Jones (lang:en) |                                     |                                     |
| Sir Robert McClure (wd:Q24027367) | Sir Robert McClure (lang:en) | Thomas Jones (wd:Q56598227) | Thomas Jones (lang:en) | 1872-01-01T00:00:00Z (xsd:dateTime) | 1873-01-01T00:00:00Z (xsd:dateTime) |
| Spread Eagle (wd:Q24027151)       | Spread Eagle (lang:en)       | Thomas Jones (wd:Q56598227) | Thomas Jones (lang:en) | 1870-01-01T00:00:00Z (xsd:dateTime) | 1875-01-01T00:00:00Z (xsd:dateTime) |
| Tirsah (wd:Q24027220)             | Tirsah (lang:en)             | Thomas Jones (wd:Q56598227) | Thomas Jones (lang:en) | 1871-01-01T00:00:00Z (xsd:dateTime) | 1874-01-01T00:00:00Z (xsd:dateTime) |
| Truant (wd:Q24027131)             | Truant (lang:en)             | Thomas Jones (wd:Q56598227) | Thomas Jones (lang:en) | 1863-01-01T00:00:00Z (xsd:dateTime) | 1866-01-01T00:00:00Z (xsd:dateTime) |

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

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

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

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

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

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

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

[User] What other items are owned by the owner of the merchant ship Edward John? For each item, please also include its owner, the start (if available) and end times (if available) of ownership .

[Assistant]
Step 1 — I will search Wikidata for the entity corresponding to the merchant ship "Edward John" to get its QID and verify it's a ship. I'll use a constrained search query ("Edward John merchant ship") to prioritize ship items.

Question: Edward John merchant ship

Top 10 entity alternatives:
1. John Johnston (wd:Q85771593, matched via John Johnston (merchant)), also known as John Johnston (merchant): Scottish-American bookkeeper and merchant who was a co-founder of New York University / is instance of human
2. John Shipley, Baron Shipley (wd:Q211806): British politician (born 1946) / has occupation politician / is instance of human / British politician / British politician
3. Edward Shippen [shippedwar026656] (wd:Q103886366): is instance of encyclopaedic article / is instance of encyclopedia article / article in Electronic Enlightenment
4. Collins, Edward Knight (1802-1878), merchant and shipping operator (wd:Q103851377): is instance of encyclopaedic article / is instance of encyclopedia article / encyclopedia article
5. merchant vessel (wd:Q848944, matched via merchant ship), also known as commercial vessel, merchant ship, trading ship, trading vessel: civilian boat or ship that transports cargo or carries passengers for hire / is instance of watercraft type / is subclass of watercraft / is subclass of Watercraft
6. John Merchant (wd:Q12349920): has occupation Esperantist / has occupation merchant / is instance of human
7. Ship John Shoal Light (wd:Q7497932), also known as Ship John Shoal Lighthouse: lighthouse in New Jersey, United States / is instance of lighthouse
8. USS Situla (wd:Q7874184, matched via Liberty ship John Whiteaker), also known as Liberty ship John Whiteaker, Situla (Crater class cargo ship : AK-140), Situla (ship), SS John Whiteaker, USS John Whiteaker: 1943 Crater-class cargo ship / is instance of liberty ship / is instance of Liberty ship
9. Philadelphia Merchant Ship (wd:Q1948908): is instance of association football club / is instance of soccer club
10. John T. Essberger (ship) (wd:Q1701876): is instance of sea rescue cruiser

[Assistant]
Search for the item by the exact name "Edward John" (less constrained) to see possible matches.

Question: Edward John

Top 10 entity alternatives:
1. John Edward (wd:Q3181410): American television personality and professional psychic medium / has occupation psychic / has occupation writer / is instance of human
2. Edward John (wd:Q5343768): has occupation lawyer / is instance of human / Canadian politician / Canadian politician / Canadian politician
3. Jock Edward (wd:Q6207326, matched via John Edward), also known as John Edward: has occupation association football player / has occupation soccer player / association football player / is instance of human
4. John Edward (wd:Q61788598): Scottish civil servant and campaigner (born 1968) / is instance of human
5. John Edward (wd:Q50276612): is instance of double given name / is instance of male given name / male compound given name / male given name / male given name
6. Edward John (wd:Q104715442): is instance of double given name / is instance of male given name / male given name / male given name / male given name
7. John Edward (wd:Q115713577): shipwreck, 10.50 km from Church Bay / is instance of shipwreck
8. Edward John (wd:Q24027085): is instance of merchant vessel / is instance of schooner / merchant ship
9. John Edward (wd:Q52083624): has occupation politician / is instance of human / of Sandwich, Kent
10. Edward John (wd:Q76281764): Peerage person ID=660110 / is instance of human

[Assistant]
Now I'll search for properties of the Edward John item to find the ownership property (likely P127 "owned by") and confirm the owner value. I'll constrain the search to the entity found (wd:Q24027085).

Question: owner

Top 10 property alternatives:
1. owned by (wd:P127 as p/wdt, matched via owner), also known as belonged to, belongs to, is owned by, owner, owners, etc.: owner of the subject / owner of the subject / owner of the subject
2. inception (wd:P571 as p/wdt, matched via foundation), also known as broke ground, built, commenced on date, commencement date, completed, etc.: time when an entity begins to exist; for date of official opening use P1619 / time when an entity begins to exist; for date of official opening use P1619 / date or point in time when the organisation / object was founded / created / is subproperty of start time
3. location of creation (wd:P1071 as p/wdt, matched via place made), also known as assembly location, built at, built in, composed at, created at, etc.: place where the item was conceived or made; where applicable, location of final assembly / is subproperty of significant place
4. instance of (wd:P31 as p/wdt, matched via is a), also known as example of, has type, is a, is an, is of type, etc.: type to which this subject corresponds/belongs. Different ... and the volcano is a type (instance) of volcanic landform / that class of which this subject is a particular example and ... a subclass of mountain (and an instance of volcanic landform)
5. described by source (wd:P1343 as p/wdt, matched via found in), also known as defined in, described by biography, described by encyclopedia, described by obituary, described by reference work, etc.: dictionary, encyclopaedia, etc. where this item is described / work where this item is described / is subproperty of attested in
6. significant event (wd:P793 as p/wdt, matched via outcome), also known as big event, event, fate, important event, key event, etc.: significant or notable events associated with the subject / significant or notable events associated with the subject / significant or notable events associated with the subject
7. catalog code (wd:P528 as p/wdt, matched via register), also known as astronomical catalog, cat#, catalog number, catalogue code, catalogue number, etc.: catalogue name of an object, use with qualifier P972 / catalog name of an object, use with qualifier P972
8. volume as quantity (wd:P2234 as p/wdt, matched via vaq), also known as fluid capacity, liquid capacity, quantity as volume, spatial volume, tonnage, etc.: quantity of three-dimensional space / quantity of three-dimensional space

No other items found

[Assistant]
I'll run a simple query to retrieve the owner(s) of the ship wd:Q24027085 (Edward John) using property P127 ("owned by") and fetch English labels for readability.

SELECT ?owner ?ownerLabel WHERE {
  wd:Q24027085 wdt:P127 ?owner .
  OPTIONAL { ?owner rdfs:label ?ownerLabel . FILTER(LANG(?ownerLabel) = "en") }
}

[Assistant]
I'll run a SPARQL query that:
- finds the owner(s) of wd:Q24027085 (Edward John),
- finds all items that have that owner (via wdt:P127),
- excludes the Edward John ship itself,
- and for each item's ownership statement tries to extract the ownership start (pq:P580) and end (pq:P582) qualifiers if present.

I will fetch English labels for human readability. Then I'll execute the query to get the actual results.

SELECT DISTINCT ?item ?itemLabel ?owner ?ownerLabel ?start ?end WHERE {
  # get owner of the ship
  wd:Q24027085 wdt:P127 ?owner .

  # items owned by that owner (including possibly the ship)
  ?item wdt:P127 ?owner .
  FILTER (?item != wd:Q24027085)

  OPTIONAL { ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en") }
  OPTIONAL { ?owner rdfs:label ?ownerLabel . FILTER(LANG(?ownerLabel) = "en") }

  # try to get qualifiers (start/end times) from the ownership statement
  OPTIONAL {
    ?item p:P127 ?stmt .
    ?stmt ps:P127 ?owner .
    OPTIONAL { ?stmt pq:P580 ?start }
    OPTIONAL { ?stmt pq:P582 ?end }
  }
} ORDER BY ?itemLabel

[Assistant]
I'll re-run the same SPARQL query to retrieve the full result set (all rows) so I can list every item owned by Thomas Jones with start/end qualifiers.

SELECT DISTINCT ?item ?itemLabel ?owner ?ownerLabel ?start ?end WHERE {
  wd:Q24027085 wdt:P127 ?owner .
  ?item wdt:P127 ?owner .
  FILTER (?item != wd:Q24027085)
  OPTIONAL { ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en") }
  OPTIONAL { ?owner rdfs:label ?ownerLabel . FILTER(LANG(?ownerLabel) = "en") }
  OPTIONAL {
    ?item p:P127 ?stmt .
    ?stmt ps:P127 ?owner .
    OPTIONAL { ?stmt pq:P580 ?start }
    OPTIONAL { ?stmt pq:P582 ?end }
  }
} ORDER BY ?itemLabel

[Assistant]
I'll run a single-row query that concatenates all result rows into one string (with a clear separator) so I can reliably extract and list every owned item, its owner, and any start/end qualifiers.

SELECT (GROUP_CONCAT(CONCAT(STR(?item),"||", COALESCE(?itemLabel,"") ,"||", COALESCE(STR(?start),""),"||", COALESCE(STR(?end),"")); separator="@@") AS ?all) WHERE {
  wd:Q24027085 wdt:P127 ?owner .
  ?item wdt:P127 ?owner .
  FILTER (?item != wd:Q24027085)
  OPTIONAL { ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en") }
  OPTIONAL {
    ?item p:P127 ?stmt .
    ?stmt ps:P127 ?owner .
    OPTIONAL { ?stmt pq:P580 ?start }
    OPTIONAL { ?stmt pq:P582 ?end }
  }
}

[Assistant]
Now I'll finalize by returning the SPARQL query I executed and a summary of the results. I can provide the full row-by-row table or export (CSV/JSON) if you'd like—please tell me which format you prefer.

answer

SELECT DISTINCT ?item ?itemLabel ?owner ?ownerLabel ?start ?end WHERE {
  wd:Q24027085 wdt:P127 ?owner .
  ?item wdt:P127 ?owner .
  FILTER (?item != wd:Q24027085)
  OPTIONAL { ?item rdfs:label ?itemLabel . FILTER(LANG(?itemLabel) = "en") }
  OPTIONAL { ?owner rdfs:label ?ownerLabel . FILTER(LANG(?ownerLabel) = "en") }
  OPTIONAL {
    ?item p:P127 ?stmt .
    ?stmt ps:P127 ?owner .
    OPTIONAL { ?stmt pq:P580 ?start }
    OPTIONAL { ?stmt pq:P582 ?end }
  }
} ORDER BY ?itemLabel

Answer:
I ran the above query. Results summary:

- Owner of the merchant ship Edward John (wd:Q24027085): Thomas Jones (wd:Q56598227).
- The query returned 22 other items owned by Thomas Jones. For each result the query returns the item IRI, its English label (if any), the owner IRI and label, and any ownership start (pq:P580) and end (pq:P582) qualifiers when present.

If you want the full row-by-row results (all 22 rows) in a pasted table, or exported as CSV/JSON, tell me which format you prefer and I will provide it.


PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?class ?classLabel ?operator ?operatorLabel WHERE {
  ?ship wdt:P31 wd:Q174736 ; wdt:P289 ?class ; wdt:P137 ?operator .
  ?class wdt:P31 wd:Q559026 .
  FILTER NOT EXISTS {
    ?class wdt:P137 ?operator .
  }
  OPTIONAL {
    ?class rdfs:label ?classLabel FILTER ( LANG( ?classLabel ) = "en" )
  }
  OPTIONAL {
    ?operator rdfs:label ?operatorLabel FILTER ( LANG( ?operatorLabel ) = "en" )
  }
}
ORDER BY ?class ?operator

Using entities:
- destroyer (wd:Q174736), also known as DD, TBD, torpedo boat destroyer: is instance of ship type / is subclass of warship / is subclass of Warship / warship type designed for escort duties against smaller vessels
- ship class (wd:Q559026): is instance of second-order class / is subclass of watercraft class / group of ships of a similar design / group of ships of a similar design

Using properties:
- operator (wd:P137 as wdt), also known as administrator, controlled by, facility operator, in use by, item operator, etc.: is subproperty of used by / organization that operates the service, facility, ship, aircraft, missile / person, profession, organization or entity that operates the equipment, facility, or service / person, profession, or organization that operates the equipment, facility, or service; use country for diplomatic missions
- vessel class (wd:P289 as wdt), also known as class of vessel, ship class, spacecraft class, submarine class, watercraft class, etc.: is subproperty of instance of / series of vessels or other watercraft built to the same design of which this vessel is a member
- 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 39 rows and 4 columns, showing the first 5 and last 5 rows below:
| class                                      | classLabel                              | operator                           | operatorLabel                  |
| ------------------------------------------ | --------------------------------------- | ---------------------------------- | ------------------------------ |
| M-class destroyer (wd:Q11880097)           | M-class destroyer (lang:en)             | Polish Navy (wd:Q267167)           | Polish Navy (lang:en)          |
| M-class destroyer (wd:Q11880097)           | M-class destroyer (lang:en)             | Turkish Naval Forces (wd:Q3293295) | Turkish Naval Forces (lang:en) |
| F-class escort ship (wd:Q1232987)          | F-class escort ship (lang:en)           | Imperial German Navy (wd:Q156649)  | Imperial German Navy (lang:en) |
| Fletcher-class destroyer (wd:Q1428155)     | Fletcher-class destroyer (lang:en)      | Hellenic Navy (wd:Q1129369)        | Hellenic Navy (lang:en)        |
| Fletcher-class destroyer (wd:Q1428155)     | Fletcher-class destroyer (lang:en)      | Brazilian Navy (wd:Q1750688)       | Brazilian Navy (lang:en)       |
| ...                                        | ...                                     | ...                                | ...                            |
| G and H-class destroyer (wd:Q581627)       | G and H-class destroyer (lang:en)       | Kriegsmarine (wd:Q151701)          | Kriegsmarine (lang:en)         |
| Project 30bis-class destroyer (wd:Q583164) | Project 30bis-class destroyer (lang:en) | Egyptian Navy (wd:Q382551)         | Egyptian Navy (lang:en)        |
| Hai Long-class destroyer (wd:Q63407282)    | Hai Long-class destroyer (lang:en)      | Royal Navy (wd:Q172771)            | Royal Navy (lang:en)           |
| Tátra-class destroyer (wd:Q656992)         | Tátra-class destroyer (lang:en)         | Imperial German Navy (wd:Q156649)  | Imperial German Navy (lang:en) |
| C-class destroyer (wd:Q941069)             | C-class destroyer (lang:en)             | Royal Norwegian Navy (wd:Q2083573) | Royal Norwegian Navy (lang:en) |

Answer:
I ran the query above. It returns 39 distinct (vessel class, operator) pairs where at least one destroyer (an individual ship instance) has an operator (P137) that is not listed on the associated vessel class (P289 -> class)'s list of operators. Example rows from the results include:

- M-class destroyer (wd:Q11880097) — Polish Navy (wd:Q267167)
- M-class destroyer (wd:Q11880097) — Turkish Naval Forces (wd:Q3293295)
- F-class escort ship (wd:Q1232987) — Imperial German Navy (wd:Q156649)
- Fletcher-class destroyer (wd:Q1428155) — Hellenic Navy (wd:Q1129369)
- Fletcher-class destroyer (wd:Q1428155) — Brazilian Navy (wd:Q1750688)
- G and H-class destroyer (wd:Q581627) — Kriegsmarine (wd:Q151701)
- Project 30bis-class destroyer (wd:Q583164) — Egyptian Navy (wd:Q382551)
- Hai Long-class destroyer (wd:Q63407282) — Royal Navy (wd:Q172771)
- Tátra-class destroyer (wd:Q656992) — Imperial German Navy (wd:Q156649)
- C-class destroyer (wd:Q941069) — Royal Norwegian Navy (wd:Q2083573)

(There are 39 total distinct class/operator pairs in the full result set.)

If you want, I can return the full list of all 39 class/operator rows with labels, or export them as CSV.

I ran the query above. It returns 39 distinct (vessel class, operator) pairs where at least one destroyer (an individual ship instance) has an operator (P137) that is not listed on the associated vessel class (P289 -> class)'s list of operators. Example rows from the results include:

- M-class destroyer (wd:Q11880097) — Polish Navy (wd:Q267167)
- M-class destroyer (wd:Q11880097) — Turkish Naval Forces (wd:Q3293295)
- F-class escort ship (wd:Q1232987) — Imperial German Navy (wd:Q156649)
- Fletcher-class destroyer (wd:Q1428155) — Hellenic Navy (wd:Q1129369)
- Fletcher-class destroyer (wd:Q1428155) — Brazilian Navy (wd:Q1750688)
- G and H-class destroyer (wd:Q581627) — Kriegsmarine (wd:Q151701)
- Project 30bis-class destroyer (wd:Q583164) — Egyptian Navy (wd:Q382551)
- Hai Long-class destroyer (wd:Q63407282) — Royal Navy (wd:Q172771)
- Tátra-class destroyer (wd:Q656992) — Imperial German Navy (wd:Q156649)
- C-class destroyer (wd:Q941069) — Royal Norwegian Navy (wd:Q2083573)

(There are 39 total distinct class/operator pairs in the full result set.)

If you want, I can return the full list of all 39 class/operator rows with labels, or export them as CSV.

SPARQL query over wikidata:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?class ?classLabel ?operator ?operatorLabel WHERE {
  ?ship wdt:P31 wd:Q174736 ; wdt:P289 ?class ; wdt:P137 ?operator .
  ?class wdt:P31 wd:Q559026 .
  FILTER NOT EXISTS {
    ?class wdt:P137 ?operator .
  }
  OPTIONAL {
    ?class rdfs:label ?classLabel FILTER ( LANG( ?classLabel ) = "en" )
  }
  OPTIONAL {
    ?operator rdfs:label ?operatorLabel FILTER ( LANG( ?operatorLabel ) = "en" )
  }
}
ORDER BY ?class ?operator

Using entities:
- destroyer (wd:Q174736), also known as DD, TBD, torpedo boat destroyer: is instance of ship type / is subclass of warship / is subclass of Warship / warship type designed for escort duties against smaller vessels
- ship class (wd:Q559026): is instance of second-order class / is subclass of watercraft class / group of ships of a similar design / group of ships of a similar design

Using properties:
- operator (wd:P137 as wdt), also known as administrator, controlled by, facility operator, in use by, item operator, etc.: is subproperty of used by / organization that operates the service, facility, ship, aircraft, missile / person, profession, organization or entity that operates the equipment, facility, or service / person, profession, or organization that operates the equipment, facility, or service; use country for diplomatic missions
- vessel class (wd:P289 as wdt), also known as class of vessel, ship class, spacecraft class, submarine class, watercraft class, etc.: is subproperty of instance of / series of vessels or other watercraft built to the same design of which this vessel is a member
- 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 39 rows and 4 columns, showing the first 5 and last 5 rows below:
| class                                      | classLabel                              | operator                           | operatorLabel                  |
| ------------------------------------------ | --------------------------------------- | ---------------------------------- | ------------------------------ |
| M-class destroyer (wd:Q11880097)           | M-class destroyer (lang:en)             | Polish Navy (wd:Q267167)           | Polish Navy (lang:en)          |
| M-class destroyer (wd:Q11880097)           | M-class destroyer (lang:en)             | Turkish Naval Forces (wd:Q3293295) | Turkish Naval Forces (lang:en) |
| F-class escort ship (wd:Q1232987)          | F-class escort ship (lang:en)           | Imperial German Navy (wd:Q156649)  | Imperial German Navy (lang:en) |
| Fletcher-class destroyer (wd:Q1428155)     | Fletcher-class destroyer (lang:en)      | Hellenic Navy (wd:Q1129369)        | Hellenic Navy (lang:en)        |
| Fletcher-class destroyer (wd:Q1428155)     | Fletcher-class destroyer (lang:en)      | Brazilian Navy (wd:Q1750688)       | Brazilian Navy (lang:en)       |
| ...                                        | ...                                     | ...                                | ...                            |
| G and H-class destroyer (wd:Q581627)       | G and H-class destroyer (lang:en)       | Kriegsmarine (wd:Q151701)          | Kriegsmarine (lang:en)         |
| Project 30bis-class destroyer (wd:Q583164) | Project 30bis-class destroyer (lang:en) | Egyptian Navy (wd:Q382551)         | Egyptian Navy (lang:en)        |
| Hai Long-class destroyer (wd:Q63407282)    | Hai Long-class destroyer (lang:en)      | Royal Navy (wd:Q172771)            | Royal Navy (lang:en)           |
| Tátra-class destroyer (wd:Q656992)         | Tátra-class destroyer (lang:en)         | Imperial German Navy (wd:Q156649)  | Imperial German Navy (lang:en) |
| C-class destroyer (wd:Q941069)             | C-class destroyer (lang:en)             | Royal Norwegian Navy (wd:Q2083573) | Royal Norwegian Navy (lang:en) |

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

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

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

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

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

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

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

[User] Which distinct destroyers have an operator not listed in the vessel class's list of operators? For each row, include the vessel class and operator.

[Assistant]
Step 1 — plan: find property for "operator" and items for "destroyer" (the vessel type), then find individual destroyer ships (or ship instances) whose operator (wdt:P137?) is not among the vessel class' operators. I'll search for the "operator" property and for the entity for "destroyer" to confirm identifiers before building the query. I'll start by searching for the property "operator".

Question: operator

Top 10 property alternatives:
1. operator (wd:P137 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as administrator, controlled by, facility operator, in use by, item operator, etc.: person, profession, or organization that operates the equipment, facility, or service; use country for diplomatic missions / person, profession, organization or entity that operates the equipment, facility, or service / organization that operates the service, facility, ship, aircraft, missile / is subproperty of used by
2. item operated (wd:P121 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via operator of), also known as acop, aircraft carried, aircraft in fleet, aircraft operated, controls, etc.: equipment, installation or service operated by the subject / equipment, installation or service operated by the subject / equipment, installation or service operated by the subject / is subproperty of uses
3. opus number (wd:P10855 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via op.), also known as op., P10855: number that is assigned to a musical composition, or to a set ... indicate the chronological order of the composer's production
4. test method (wd:P4988 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via method), also known as estimation method, method, methodology, P4988: method in science, engineering or medicine, which determines ... qualitative property or any other measurable attribute
5. determination method or standard (wd:P459 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via method), also known as determined by, justification, measured by, method, method of determination, etc.: how a value is determined, or the standard by which it is declared / how a value is determined, or the standard by which it is declared / qualifier stating how a value has been determined / qualifier stating how a value has been determined
6. y-offset (wd:P8685 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via ordinate), also known as ordinate, y-axis, P8685: offset on the y-axis or secondary axis
7. has command line option (wd:P4837 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via option), also known as command line option, option, P4837: an option which is accepted by the software from the command line
8. located in/on physical feature (wd:P706 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via on), also known as geographical region, is in, is on, landform, located on island, etc.: located on the specified landform or body of water. Should ... (provinces, states, countries, etc.). / located on the specified (geo)physical feature. Should not be ... political/administrative (P131) or a mountain range (P4552). / is subproperty of location / is subproperty of part of
9. point in time (wd:P585 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via on), also known as as of, at time, by date, date, during, etc.: date something took place, existed or a statement was true; for providing time use the "refine date" property (P4241) / time and date something took place, existed or a statement was true / time and date something took place, existed or a statement was true / time and date something took place, existed or a statement was true
10. series ordinal (wd:P1545 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via ordinal), also known as index, num., number, ordinal, ordinal number, etc.: position of an item in its parent series (most frequently a ... "ranking" defined as a property for evaluating a quality). / position of an item in its parent series (most frequently a ... "ranking" defined as a property for evaluating a quality) / position of an item in its parent series, generally to be used as a qualifier. Different from "rank"

[Assistant]
I'll search for the entity "destroyer" to find the correct Q-id (e.g., destroyer type or destroyer ship class). I want the item that represents the ship type "destroyer" (likely wd:Q49211 or similar). I'll search for "destroyer".

Question: destroyer

Top 10 entity alternatives:
1. destroyer (wd:Q174736), also known as DD, TBD, torpedo boat destroyer: warship type designed for escort duties against smaller vessels / is instance of ship type / is subclass of warship / is subclass of Warship
2. Destroyer (wd:Q833616): 1976 studio album by Kiss / is instance of album / album by Kiss / album by Kiss
3. Andy Ruiz Jr. (wd:Q4761262, matched via Destroyer), also known as Andrés Ponce Ruiz, Andy Ruiz, Andy Ruiz Jr, Destroyer: Mexican-American boxer / has occupation boxer / is instance of human
4. Douglas B-66 Destroyer (wd:Q372864, matched via Destroyer), also known as B66, B-66 Destroyer, Destroyer, EB-66: is subclass of Douglas A-3 Skywarrior / is instance of aircraft family / bomber aircraft family / is subclass of bomber
5. Destroyer (wd:Q48672823): 2018 film directed by Karyn Kusama / is instance of film
6. BTD Destroyer (wd:Q1252040, matched via "Destroyer"), also known as BTD, "Destroyer", Destroyer, Douglas Bomber Torpedo Design 1, Douglas BTD Destroyer, etc.: is subclass of carrier-capable torpedo bomber / is subclass of torpedo bomber with 1 engine / 1943 dive/torpedo bomber model by Douglas / 1943 dive/torpedo bomber model by Douglas / 1943 dive/torpedo bomber model by Douglas / is subclass of torpedo-armed monoplane / is subclass of bomber-torpedo plane / is instance of aircraft family / is subclass of dive bomber
7. Destroyer (wd:Q1754949), also known as Destroyer, or About How to Philosophize with the Hammer: 1898 studio album by Gorgoroth / is instance of album
8. Destroyer (wd:Q2473486): fictional object that appears in comic books published by Marvel Comics / is instance of comics character
9. Destroyer (wd:Q608248): is instance of musical group / is instance of supergroup / Canadian indie rock band
10. Destroyer (wd:Q5265358): 1943 war film directed by William A. Seiter / is instance of film

[Assistant]
I'll search for a property corresponding to "vessel class" or "ship class" to identify how classes are represented on ship items.

Question: vessel class

Top 10 property alternatives:
1. vessel class (wd:P289 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as class of vessel, ship class, spacecraft class, submarine class, watercraft class, etc.: series of vessels or other watercraft built to the same design of which this vessel is a member / is subproperty of instance of
2. vessel (wd:P1876 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as boat, craft, orbiter, ship, spacecraft, etc.: vessel involved in this mission, navigation or event / vessel involved in this mission, voyage or event
3. volume as quantity (wd:P2234 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via tonnage), also known as fluid capacity, liquid capacity, quantity as volume, spatial volume, tonnage, etc.: quantity of three-dimensional space / quantity of three-dimensional space
4. pennant number (wd:P879 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via hull number), also known as hull classification symbol, hull number, pendant number, P879: the number or designation associated with individual ships, often painted on the hull
5. yard number (wd:P617 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via hull number), also known as hull number, P617: identifier of a ship assigned by its builder (shipyard)
6. category for ship name (wd:P7782 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as Commons category for ship name, P7782: Commons category for a name of a ship / Commons category for a name of a ship
7. member of the crew of (wd:P5096 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via crew of), also known as crewmember of, crew of, member of crew, served aboard, ship appointments, etc.: person who has been a member of a crew associated with the ... crew member (P1029), backup or reserve team or crew (P3015) / person who has been a member of a crew associated with the ... crew member (P1029), backup or reserve team or crew (P3015) / is subproperty of member of
8. Admiralty number (wd:P3562 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as P3562: identifier of lighthouses by United Kingdom Hydrographic Office
9. MMSI (wd:P587 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as MarineTraffic ID, MarineTraffic Ship ID, Maritime Mobile Service Identity, MMSI number, MMSI Number, etc.: Maritime Mobile Service Identity of a ship station. Format 8 or 9 digits / Maritime Mobile Service Identity of a ship station
10. DSM-5 classification (wd:P1930 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via DSMV), also known as DSM 5, DSM5, DSM V, DSMV, P1930: identifier for a mental disorder in the 5th edition of Diagnostic and Statistical Manual of Mental Disorders

[Assistant]
I'll search for the entity representing "ship class" or "vessel class" to detect how classes are typed in Wikidata items (e.g., Q211005). This will help identify which vessel class items are destroyer classes.

Question: ship class

Top 10 entity alternatives:
1. ship class (wd:Q559026): group of ships of a similar design / group of ships of a similar design / is instance of second-order class / is subclass of watercraft class
2. Polar-class icebreaker (wd:Q7209067, matched via Polar class ship), also known as Polar class ship: is subclass of icebreaker / is instance of ship type / classification of ship / is subclass of ship
3. ship type (wd:Q2235308, matched via ship functional class), also known as ship functional class, ship functional type, type of ship: group of ships of a similar purpose and function / group of ships of a similar purpose and function / is instance of second-order class / is subclass of watercraft type
4. cruise ship class (wd:Q15720785): is subclass of ship class
5. Project 101 (wd:Q63437652, matched via Kuban class ship), also known as Kuban class ship: is subclass of passenger vessel / Soviet passenger ship class / is instance of ship class / is subclass of ship
6. Mærsk E-class container ship (wd:Q5274902, matched via Emma Mærsk class ship), also known as Emma Mærsk class ship: class of eight container ships built from 2006 to 2008 / is subclass of Container ship / is subclass of container ship / is instance of ship class
7. Planet (wd:Q2098127, matched via Planet class research ship), also known as Planet class research ship, Type 751: is instance of defense research ship / German naval defense research ship
8. F-class escort ship (wd:Q1232987, matched via F class escort ship), also known as F class escort ship, German F-class escort ship: 1936 escort ship class of the German Navy / is subclass of escort ship / is instance of ship class
9. No.101-class landing ship (wd:Q7042804, matched via No.101 class landing ship), also known as No.101 class landing ship, No.103 class landing ship, No.103-class landing ship: is subclass of Landing Ship, Tank / is subclass of tank landing ship / is instance of ship class
10. SR-28 class degaussing ship (wd:Q3679246)

[Assistant]
I'll run a SPARQL query that:
- finds items that are destroyers (wd:Q174736),
- finds their vessel class via P289,
- gets the ship's operator via P137,
- requires the class to be an instance of "ship class" (wd:Q559026),
- filters out operators that appear on the class itself (so we only get operators present on individual ships but not listed on the class).

The query will return distinct pairs (vessel class IRI, operator IRI) plus optional English labels. I'll execute it now.

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 DISTINCT ?class ?classLabel ?operator ?operatorLabel WHERE {
  ?ship wdt:P31 wd:Q174736;    # ship is a destroyer
        wdt:P289 ?class;       # ship has vessel class
        wdt:P137 ?operator.    # operator of the individual ship
  ?class wdt:P31 wd:Q559026.  # ensure the class is a ship class

  # exclude operators that are listed on the class itself
  FILTER NOT EXISTS { ?class wdt:P137 ?operator. }

  OPTIONAL { ?class rdfs:label ?classLabel FILTER(LANG(?classLabel) = "en") }
  OPTIONAL { ?operator rdfs:label ?operatorLabel FILTER(LANG(?operatorLabel) = "en") }
}
ORDER BY ?class ?operator

Got 39 rows and 4 columns, showing the first 5 and last 5 rows below:
| class                                      | classLabel                              | operator                           | operatorLabel                  |
| ------------------------------------------ | --------------------------------------- | ---------------------------------- | ------------------------------ |
| M-class destroyer (wd:Q11880097)           | M-class destroyer (lang:en)             | Polish Navy (wd:Q267167)           | Polish Navy (lang:en)          |
| M-class destroyer (wd:Q11880097)           | M-class destroyer (lang:en)             | Turkish Naval Forces (wd:Q3293295) | Turkish Naval Forces (lang:en) |
| F-class escort ship (wd:Q1232987)          | F-class escort ship (lang:en)           | Imperial German Navy (wd:Q156649)  | Imperial German Navy (lang:en) |
| Fletcher-class destroyer (wd:Q1428155)     | Fletcher-class destroyer (lang:en)      | Hellenic Navy (wd:Q1129369)        | Hellenic Navy (lang:en)        |
| Fletcher-class destroyer (wd:Q1428155)     | Fletcher-class destroyer (lang:en)      | Brazilian Navy (wd:Q1750688)       | Brazilian Navy (lang:en)       |
| ...                                        | ...                                     | ...                                | ...                            |
| G and H-class destroyer (wd:Q581627)       | G and H-class destroyer (lang:en)       | Kriegsmarine (wd:Q151701)          | Kriegsmarine (lang:en)         |
| Project 30bis-class destroyer (wd:Q583164) | Project 30bis-class destroyer (lang:en) | Egyptian Navy (wd:Q382551)         | Egyptian Navy (lang:en)        |
| Hai Long-class destroyer (wd:Q63407282)    | Hai Long-class destroyer (lang:en)      | Royal Navy (wd:Q172771)            | Royal Navy (lang:en)           |
| Tátra-class destroyer (wd:Q656992)         | Tátra-class destroyer (lang:en)         | Imperial German Navy (wd:Q156649)  | Imperial German Navy (lang:en) |
| C-class destroyer (wd:Q941069)             | C-class destroyer (lang:en)             | Royal Norwegian Navy (wd:Q2083573) | Royal Norwegian Navy (lang:en) |

[Assistant]
I'll re-run the same query to fetch the full set of results so I can list every vessel class — operator pair found.

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 DISTINCT ?class ?classLabel ?operator ?operatorLabel WHERE {
  ?ship wdt:P31 wd:Q174736;    # ship is a destroyer
        wdt:P289 ?class;       # ship has vessel class
        wdt:P137 ?operator.    # operator of the individual ship
  ?class wdt:P31 wd:Q559026.  # ensure the class is a ship class

  # exclude operators that are listed on the class itself
  FILTER NOT EXISTS { ?class wdt:P137 ?operator. }

  OPTIONAL { ?class rdfs:label ?classLabel FILTER(LANG(?classLabel) = "en") }
  OPTIONAL { ?operator rdfs:label ?operatorLabel FILTER(LANG(?operatorLabel) = "en") }
}
ORDER BY ?class ?operator

Got 39 rows and 4 columns, showing the first 5 and last 5 rows below:
| class                                      | classLabel                              | operator                           | operatorLabel                  |
| ------------------------------------------ | --------------------------------------- | ---------------------------------- | ------------------------------ |
| M-class destroyer (wd:Q11880097)           | M-class destroyer (lang:en)             | Polish Navy (wd:Q267167)           | Polish Navy (lang:en)          |
| M-class destroyer (wd:Q11880097)           | M-class destroyer (lang:en)             | Turkish Naval Forces (wd:Q3293295) | Turkish Naval Forces (lang:en) |
| F-class escort ship (wd:Q1232987)          | F-class escort ship (lang:en)           | Imperial German Navy (wd:Q156649)  | Imperial German Navy (lang:en) |
| Fletcher-class destroyer (wd:Q1428155)     | Fletcher-class destroyer (lang:en)      | Hellenic Navy (wd:Q1129369)        | Hellenic Navy (lang:en)        |
| Fletcher-class destroyer (wd:Q1428155)     | Fletcher-class destroyer (lang:en)      | Brazilian Navy (wd:Q1750688)       | Brazilian Navy (lang:en)       |
| ...                                        | ...                                     | ...                                | ...                            |
| G and H-class destroyer (wd:Q581627)       | G and H-class destroyer (lang:en)       | Kriegsmarine (wd:Q151701)          | Kriegsmarine (lang:en)         |
| Project 30bis-class destroyer (wd:Q583164) | Project 30bis-class destroyer (lang:en) | Egyptian Navy (wd:Q382551)         | Egyptian Navy (lang:en)        |
| Hai Long-class destroyer (wd:Q63407282)    | Hai Long-class destroyer (lang:en)      | Royal Navy (wd:Q172771)            | Royal Navy (lang:en)           |
| Tátra-class destroyer (wd:Q656992)         | Tátra-class destroyer (lang:en)         | Imperial German Navy (wd:Q156649)  | Imperial German Navy (lang:en) |
| C-class destroyer (wd:Q941069)             | C-class destroyer (lang:en)             | Royal Norwegian Navy (wd:Q2083573) | Royal Norwegian Navy (lang:en) |

[Assistant]
I will now provide the final SPARQL query and a concise answer summarizing the results (39 distinct class/operator pairs); I'll include a few example rows and note that the query returns the full set.

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 DISTINCT ?class ?classLabel ?operator ?operatorLabel WHERE {
  ?ship wdt:P31 wd:Q174736;    # ship is a destroyer
        wdt:P289 ?class;       # ship has vessel class
        wdt:P137 ?operator.    # operator of the individual ship
  ?class wdt:P31 wd:Q559026.  # ensure the class is a ship class

  # exclude operators that are listed on the class itself
  FILTER NOT EXISTS { ?class wdt:P137 ?operator. }

  OPTIONAL { ?class rdfs:label ?classLabel FILTER(LANG(?classLabel) = "en") }
  OPTIONAL { ?operator rdfs:label ?operatorLabel FILTER(LANG(?operatorLabel) = "en") }
}
ORDER BY ?class ?operator

Answer:
I ran the query above. It returns 39 distinct (vessel class, operator) pairs where at least one destroyer (an individual ship instance) has an operator (P137) that is not listed on the associated vessel class (P289 -> class)'s list of operators. Example rows from the results include:

- M-class destroyer (wd:Q11880097) — Polish Navy (wd:Q267167)
- M-class destroyer (wd:Q11880097) — Turkish Naval Forces (wd:Q3293295)
- F-class escort ship (wd:Q1232987) — Imperial German Navy (wd:Q156649)
- Fletcher-class destroyer (wd:Q1428155) — Hellenic Navy (wd:Q1129369)
- Fletcher-class destroyer (wd:Q1428155) — Brazilian Navy (wd:Q1750688)
- G and H-class destroyer (wd:Q581627) — Kriegsmarine (wd:Q151701)
- Project 30bis-class destroyer (wd:Q583164) — Egyptian Navy (wd:Q382551)
- Hai Long-class destroyer (wd:Q63407282) — Royal Navy (wd:Q172771)
- Tátra-class destroyer (wd:Q656992) — Imperial German Navy (wd:Q156649)
- C-class destroyer (wd:Q941069) — Royal Norwegian Navy (wd:Q2083573)

(There are 39 total distinct class/operator pairs in the full result set.)

If you want, I can return the full list of all 39 class/operator rows with labels, or export them as CSV.