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 ?goat ?label ?image ?start ?end ( COALESCE ( ?end , NOW () ) AS ?endOrNow ) WHERE {
  ?goat wdt:P2868 wd:Q151345 .
  OPTIONAL {
    ?goat rdfs:label ?labelEn FILTER ( LANG( ?labelEn ) = "en" )
  }
  OPTIONAL {
    ?goat rdfs:label ?labelDe FILTER ( LANG( ?labelDe ) = "de" )
  }
  OPTIONAL {
    ?goat rdfs:label ?labelNoLang FILTER ( LANG( ?labelNoLang ) = "" )
  }
  BIND( COALESCE ( ?labelEn , ?labelDe , ?labelNoLang , STRAFTER( STR( ?goat ) , "entity/" ) ) AS ?label ) OPTIONAL {
    ?goat wdt:P18 ?image
  }
  OPTIONAL {
    ?goat p:P2868 ?stmt .
    ?stmt ps:P2868 wd:Q151345 .
    OPTIONAL {
      ?stmt pq:P580 ?start
    }
    OPTIONAL {
      ?stmt pq:P582 ?end
    }
  }
}
ORDER BY ?start ?label

Using entities:
- Billygoat Hennes (wd:Q151345), also known as Hennes: is instance of mascot character / mascot of 1. FC Cologne

Using properties:
- image (wd:P18 as wdt), also known as camera picture, Commons image, drawing, File:, graph, etc.: image of relevant illustration of the subject; if available, ... map, flag image, signature image, logo image, collage image) / image of relevant illustration of the subject; if available, ... map, flag image, signature image, logo image, collage image) / image of relevant illustration of the subject; if available, ... only images which exist on Wikimedia Commons are acceptable / image of relevant illustration of the subject; if available, ... only images which exist on Wikimedia Commons are acceptable
- subject has role (wd:P2868 as p/ps/wdt), also known as has role, role, subject had role, subject of qualified statement has role, subject of statement has role, etc.: role/generic identity of the item ("subject") in the context ... roles, use P453 ("character role"). For persons, use P39. / role or generic identity of subject in a certain context. For ... object/value of statements, use P3831 ("object has role").
- 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 queried Wikidata for items that have the role "Billygoat Hennes" (Q151345) and returned their item IRIs, labels (English if available, otherwise German or a no-language label), image (P18) where present, the role start time (pq:P580) and end time (pq:P582). For items lacking an end time the query substituted the current timestamp (NOW()). The query returned these individual goats (with their QIDs, labels, image URLs if available, start and end/end-as-of):

- wd:Q117303903 — Hennes I. (label language: de)
  - image: (none on Wikidata)
  - start: 1950-02-13T00:00:00Z
  - end: 1966-11-04T00:00:00Z

- wd:Q117303933 — Hennes II. (label language: de)
  - image: (none on Wikidata)
  - start: 1966-11-26T00:00:00Z
  - end: 1970-08-01T00:00:00Z

- wd:Q117303888 — Hennes III. (label language: de)
  - image: (none on Wikidata)
  - start: 1970-08-22T00:00:00Z
  - end: 1975-07-01T00:00:00Z

- wd:Q117303880 — Hennes IV. (label language: de)
  - image: (none on Wikidata)
  - start: 1975-08-01T00:00:00Z
  - end: 1982-11-13T00:00:00Z

- wd:Q117303876 — Hennes V. (label language: de)
  - image: (none on Wikidata)
  - start: 1982-11-20T00:00:00Z
  - end: 1989-07-01T00:00:00Z

- wd:Q117303856 — Hennes VI. (label language: de)
  - image: (none on Wikidata)
  - start: 1989-08-01T00:00:00Z
  - end: 1996-03-13T00:00:00Z

- wd:Q117303807 — Hennes VII. (label language: de)
  - image: http://commons.wikimedia.org/wiki/Special:FilePath/Fc%20hennes.jpg
  - start: 1996-03-15T00:00:00Z
  - end: 2008-07-23T00:00:00Z

- wd:Q117303721 — Hennes VIII. (label language: de)
  - image: http://commons.wikimedia.org/wiki/Special:FilePath/Einweihung%20Carola-Williams-Park%2035.jpg
  - start: 2008-08-24T00:00:00Z
  - end: 2019-08-04T00:00:00Z

- wd:Q117303631 — Hennes IX. (label language: de)
  - image: http://commons.wikimedia.org/wiki/Special:FilePath/Gei%C3%9Fbock%20Hennes%20IX.%20im%20K%C3%B6lner%20Zoo-4124.jpg
  - start: 2019-08-04T00:00:00Z
  - end: (no end qualifier on Wikidata) — substituted with query time: 2025-10-14T15:34:05.364+02:00 (this is the NOW() value from the query execution)

Notes and provenance:
- The SPARQL query uses property P2868 (subject has role) on the animal items to identify those that served as the role Billygoat Hennes (Q151345). Individual service periods are qualifiers on those P2868 statements (pq:P580 start time, pq:P582 end time).
- Image URLs come from P18 when present and point to the Wikimedia Commons file paths.
- The end time for Hennes IX was missing in Wikidata, so the query returned the current timestamp (NOW()) as the substitute; the exact timestamp above is the time the query ran.

If you want, I can:
- also fetch German and English labels explicitly in separate columns,
- include each goat's date of birth / place of birth / breed, or
- export these results as CSV/JSON.

I queried Wikidata for items that have the role "Billygoat Hennes" (Q151345) and returned their item IRIs, labels (English if available, otherwise German or a no-language label), image (P18) where present, the role start time (pq:P580) and end time (pq:P582). For items lacking an end time the query substituted the current timestamp (NOW()). The query returned these individual goats (with their QIDs, labels, image URLs if available, start and end/end-as-of):

- wd:Q117303903 — Hennes I. (label language: de)
  - image: (none on Wikidata)
  - start: 1950-02-13T00:00:00Z
  - end: 1966-11-04T00:00:00Z

- wd:Q117303933 — Hennes II. (label language: de)
  - image: (none on Wikidata)
  - start: 1966-11-26T00:00:00Z
  - end: 1970-08-01T00:00:00Z

- wd:Q117303888 — Hennes III. (label language: de)
  - image: (none on Wikidata)
  - start: 1970-08-22T00:00:00Z
  - end: 1975-07-01T00:00:00Z

- wd:Q117303880 — Hennes IV. (label language: de)
  - image: (none on Wikidata)
  - start: 1975-08-01T00:00:00Z
  - end: 1982-11-13T00:00:00Z

- wd:Q117303876 — Hennes V. (label language: de)
  - image: (none on Wikidata)
  - start: 1982-11-20T00:00:00Z
  - end: 1989-07-01T00:00:00Z

- wd:Q117303856 — Hennes VI. (label language: de)
  - image: (none on Wikidata)
  - start: 1989-08-01T00:00:00Z
  - end: 1996-03-13T00:00:00Z

- wd:Q117303807 — Hennes VII. (label language: de)
  - image: http://commons.wikimedia.org/wiki/Special:FilePath/Fc%20hennes.jpg
  - start: 1996-03-15T00:00:00Z
  - end: 2008-07-23T00:00:00Z

- wd:Q117303721 — Hennes VIII. (label language: de)
  - image: http://commons.wikimedia.org/wiki/Special:FilePath/Einweihung%20Carola-Williams-Park%2035.jpg
  - start: 2008-08-24T00:00:00Z
  - end: 2019-08-04T00:00:00Z

- wd:Q117303631 — Hennes IX. (label language: de)
  - image: http://commons.wikimedia.org/wiki/Special:FilePath/Gei%C3%9Fbock%20Hennes%20IX.%20im%20K%C3%B6lner%20Zoo-4124.jpg
  - start: 2019-08-04T00:00:00Z
  - end: (no end qualifier on Wikidata) — substituted with query time: 2025-10-14T15:34:05.364+02:00 (this is the NOW() value from the query execution)

Notes and provenance:
- The SPARQL query uses property P2868 (subject has role) on the animal items to identify those that served as the role Billygoat Hennes (Q151345). Individual service periods are qualifiers on those P2868 statements (pq:P580 start time, pq:P582 end time).
- Image URLs come from P18 when present and point to the Wikimedia Commons file paths.
- The end time for Hennes IX was missing in Wikidata, so the query returned the current timestamp (NOW()) as the substitute; the exact timestamp above is the time the query ran.

If you want, I can:
- also fetch German and English labels explicitly in separate columns,
- include each goat's date of birth / place of birth / breed, or
- export these results as CSV/JSON.

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 ?goat ?label ?image ?start ?end ( COALESCE ( ?end , NOW () ) AS ?endOrNow ) WHERE {
  ?goat wdt:P2868 wd:Q151345 .
  OPTIONAL {
    ?goat rdfs:label ?labelEn FILTER ( LANG( ?labelEn ) = "en" )
  }
  OPTIONAL {
    ?goat rdfs:label ?labelDe FILTER ( LANG( ?labelDe ) = "de" )
  }
  OPTIONAL {
    ?goat rdfs:label ?labelNoLang FILTER ( LANG( ?labelNoLang ) = "" )
  }
  BIND( COALESCE ( ?labelEn , ?labelDe , ?labelNoLang , STRAFTER( STR( ?goat ) , "entity/" ) ) AS ?label ) OPTIONAL {
    ?goat wdt:P18 ?image
  }
  OPTIONAL {
    ?goat p:P2868 ?stmt .
    ?stmt ps:P2868 wd:Q151345 .
    OPTIONAL {
      ?stmt pq:P580 ?start
    }
    OPTIONAL {
      ?stmt pq:P582 ?end
    }
  }
}
ORDER BY ?start ?label

Using entities:
- Billygoat Hennes (wd:Q151345), also known as Hennes: is instance of mascot character / mascot of 1. FC Cologne

Using properties:
- image (wd:P18 as wdt), also known as camera picture, Commons image, drawing, File:, graph, etc.: image of relevant illustration of the subject; if available, ... map, flag image, signature image, logo image, collage image) / image of relevant illustration of the subject; if available, ... map, flag image, signature image, logo image, collage image) / image of relevant illustration of the subject; if available, ... only images which exist on Wikimedia Commons are acceptable / image of relevant illustration of the subject; if available, ... only images which exist on Wikimedia Commons are acceptable
- subject has role (wd:P2868 as p/ps/wdt), also known as has role, role, subject had role, subject of qualified statement has role, subject of statement has role, etc.: role/generic identity of the item ("subject") in the context ... roles, use P453 ("character role"). For persons, use P39. / role or generic identity of subject in a certain context. For ... object/value of statements, use P3831 ("object has role").
- 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 9 rows and 6 columns:
| goat          | label                  | image                                                                                | start                               | end                                 | endOrNow                                     |
| ------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | ----------------------------------- | -------------------------------------------- |
| wd:Q117303903 | Hennes I. (lang:de)    |                                                                                | 1950-02-13T00:00:00Z (xsd:dateTime) | 1966-11-04T00:00:00Z (xsd:dateTime) | 1966-11-04T00:00:00Z (xsd:dateTime)          |
| wd:Q117303933 | Hennes II. (lang:de)   |                                                                                | 1966-11-26T00:00:00Z (xsd:dateTime) | 1970-08-01T00:00:00Z (xsd:dateTime) | 1970-08-01T00:00:00Z (xsd:dateTime)          |
| wd:Q117303888 | Hennes III. (lang:de)  |                                                                                | 1970-08-22T00:00:00Z (xsd:dateTime) | 1975-07-01T00:00:00Z (xsd:dateTime) | 1975-07-01T00:00:00Z (xsd:dateTime)          |
| wd:Q117303880 | Hennes IV. (lang:de)   |                                                                                | 1975-08-01T00:00:00Z (xsd:dateTime) | 1982-11-13T00:00:00Z (xsd:dateTime) | 1982-11-13T00:00:00Z (xsd:dateTime)          |
| wd:Q117303876 | Hennes V. (lang:de)    |                                                                                | 1982-11-20T00:00:00Z (xsd:dateTime) | 1989-07-01T00:00:00Z (xsd:dateTime) | 1989-07-01T00:00:00Z (xsd:dateTime)          |
| wd:Q117303856 | Hennes VI. (lang:de)   |                                                                                | 1989-08-01T00:00:00Z (xsd:dateTime) | 1996-03-13T00:00:00Z (xsd:dateTime) | 1996-03-13T00:00:00Z (xsd:dateTime)          |
| wd:Q117303807 | Hennes VII. (lang:de)  | <http://commons.wikimedia.org/wiki/Special:FilePath/Fc%20hennes.jpg>                                                | 1996-03-15T00:00:00Z (xsd:dateTime) | 2008-07-23T00:00:00Z (xsd:dateTime) | 2008-07-23T00:00:00Z (xsd:dateTime)          |
| wd:Q117303721 | Hennes VIII. (lang:de) | <http://commons.wikimedia.org/wiki/Special:FilePath/Einweihung%20Carola-Williams-Park%2035.jpg>                     | 2008-08-24T00:00:00Z (xsd:dateTime) | 2019-08-04T00:00:00Z (xsd:dateTime) | 2019-08-04T00:00:00Z (xsd:dateTime)          |
| wd:Q117303631 | Hennes IX. (lang:de)   | <http://commons.wikimedia.org/wiki/Special:FilePath/Gei%C3%9Fbock%20Hennes%20IX.%20im%20K%C3%B6lner%20Zoo-4124.jpg> | 2019-08-04T00:00:00Z (xsd:dateTime) |                                     | 2025-10-14T15:35:02.583+02:00 (xsd:dateTime) |

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

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

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

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

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

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

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

[User] Who are the individual goats that have served as the mascot "Billygoat Hennes" for 1. FC Cologne, including their labels, images (if available), start times, and end times (if available, otherwise use the current date)?

[Assistant]
I'll first search Wikidata for items related to the mascot name "Hennes" and the club "1. FC Köln" to find the goat individuals and the property that links them as mascots. I'll start by searching for the mascot name "Hennes".

Question: Hennes mascot

Top 10 entity alternatives:
1. Tux (wd:Q131200, matched via Linux mascot), also known as Linux mascot, mascot of Linux, Tux the penguin: is instance of anthropomorphic penguin / is instance of video game character / official mascot of the Linux kernel / is instance of mascot character / mascot of the Linux kernel / has occupation fisher / is instance of mascot
2. mascot (wd:Q18670161): object that is supposed to bring good luck or that is used for symbolize an organization and particular event / is subclass of lucky symbol / is instance of occupation / is subclass of character
3. Ilyushin Il-28 (wd:Q652911, matched via Mascot), also known as Beagle, Beagle aircraft, Beagle bomber, IL28, Ilyushin Il-28 Beagle, etc.: is subclass of land-based bomber monoplane / bomber aircraft family by Ilyushin / bomber aircraft family by Ilyushin / bomber aircraft family by Ilyushin / is instance of aircraft type / is instance of aeroplane / is instance of airplane
4. Olympic mascot (wd:Q987057): mascot character representing the Olympic Games / is subclass of mascot character
5. Hennes Weisweiler (wd:Q151105): German association football player and manager (1919–1983) / German association football player and manager / German association football player and manager / has occupation association football manager / has occupation association football player / has occupation non-fiction writer / German soccer player and manager / has occupation soccer player / has occupation soccer coach / is instance of human
6. Luce (wd:Q130720143, matched via Luce (mascot)), also known as Luce (mascot): is instance of mascot character / is instance of fictional human / mascot of the 2025 Jubilee / mascot of the 2025 Jubilee / has occupation pilgrim
7. Konqi (wd:Q252309, matched via KDE mascot), also known as KDE dragon, KDE Konqi, KDE mascot, Konqi Konqueror, Konqui: is instance of anthropomorphic dragon / is instance of fictional dragon / is instance of mascot character / mascot of the KDE community / mascot of the KDE Community / mascot of the KDE Community
8. Mascot (wd:Q1849207), also known as Mascot, Tennessee, Mascot, TN: census-designated place in Knox County, Tennessee, United States of America / is instance of census-designated place in the United States / is instance of census-designated place
9. Hennes Junkermann (wd:Q65890), also known as Hans Junkermann: German racing cyclist (1934–2022) / has occupation sport cyclist / German racing cyclist / German racing cyclist / is instance of human
10. costumed performer (wd:Q2421635, matched via mascot performer), also known as mascot performer, suit performer: meetable or cartoon costumed performers / is subclass of costumed character / is subclass of performing artist / is instance of occupation

[Assistant]
I'll search for the club "1. FC Köln" to get its Wikidata QID and then search for items linked to it that are mascots or goats named Hennes.

Question: 1. FC Köln

Top 10 entity alternatives:
1. 1. FC Köln (wd:Q104770), also known as 1. FC Cologne, 1. Fußball-Club Köln 01/07 e. V., F.C. Koln, FC Koln, FCKoln, etc.: German football club based in Cologne, in North Rhine-Westphalia / is instance of association football club / is instance of soccer club
2. 1. FC Köln (wd:Q97905877): is instance of men's association football team / first men's team of 1. FC Köln
3. 1. FC Köln (women) (wd:Q162289), also known as 1. FC Köln Frauen, 1. FC Köln Women, FC Koln Women, FC Köln Women, Koln Women, etc.: is instance of women's association football club / is instance of women's association football team / is instance of women's soccer club / is instance of women's soccer team / FC Köln's women's football section
4. 1. FC Köln II (wd:Q15972883), also known as 1. FC Cologne II, 1. FC Köln U23, 1. Fußball-Club Köln 01/07 e. V. II, FC Köln II: Reserve team of the German football club 1. FC Köln / Reserve team of the German football club 1. FC Köln / is instance of men's association football team / is instance of association football club / is instance of soccer club
5. 2022–23 1. FC Köln season (wd:Q112702157): is instance of association football team season / season of football team
6. 2021–22 1. FC Köln season (wd:Q107210856): is instance of association football team season / season of football team
7. 2023–24 1. FC Köln season (wd:Q121047840): is instance of association football team season / season of football team
8. 2018–19 1. FC Köln season (wd:Q60851980): is instance of association football team season / season of football team
9. 2024–25 1. FC Köln season (wd:Q126947484): is instance of association football team season / season of football team
10. 2009–10 1. FC Köln season (wd:Q105320796): is instance of association football team season / season of football team

[Assistant]
I'll search for properties related to "mascot" to find the correct property that links mascot individuals to an organization.

Question: mascot

Top 10 property alternatives:
1. mascot (wd:P822 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn), also known as P822: mascot of an organization, e.g. a sports team or university / mascot of an organization, e.g. a sports team or university
2. mount (wd:P3091 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via horse), also known as horse, steed, P3091: creature ridden by the subject, for instance a horse / creature ridden by the subject, for instance a horse
3. taxon especially protected in area (wd:P6569 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via protected animal), also known as animal protected, plant protected, protected animal, protected plant, protected species, etc.: species and other taxa especially protected in a area, ... entities: use red lists properties instead.
4. head of state (wd:P35 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via monarch), also known as chief of state, emperor, governor, king, leader, etc.: official with the highest formal authority in a country/state / official with the highest formal authority in a country / official with the highest formal authority in a country / is subproperty of director / manager / is subproperty of director/manager / is subproperty of manager/director / is subproperty of chairperson
5. winner (wd:P1346 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via top dog), also known as 1st place medalist, awardee, champ, champion, has winner, etc.: winner of a competition or similar event, not to be used for ... qualified with "for work" (P1686)) or for wars or battles / winner of an event - do not use for awards (use P166 instead), nor for wars or battles / is subproperty of participating team / is subproperty of participant
6. official symbol (wd:P2238 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via emblem), also known as emblem, floral emblem, official emblem, official tartan, state tartan, etc.: official symbol of an organisation
7. seal image (wd:P158 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via emblem), also known as emblem, emblem image, seal, P158: image of subject's seal (emblem) / image of subject's seal (emblem) / is subproperty of image
8. catalog (wd:P972 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via cat.), also known as cat., catalogue, exhibition catalogue, registry, P972: catalogue for the item, or, as a qualifier of P528 – catalogue for which the 'catalogue code' is valid / catalog for the item, or, as a qualifier of P528 – catalog for which the 'catalog code' is valid / is subproperty of part of
9. has pet (wd:P1429 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via pet), also known as keeps pet, owns pet, pet, P1429: pet that a person owns
10. animal breed (wd:P4743 as pr/psn/wdtn/ps/prn/p/pq/pqv/wdt/prv/psv/pqn, matched via breed), also known as breed, cat breed, cattle breed, chicken breed, dog breed, etc.: subject item belongs to a specific group of domestic animals, generally given by association

[Assistant]
I'll search for the Wikidata item for "goat" to allow filtering by instance of (P31) goat if helpful.

Question: goat

Top 10 entity alternatives:
1. goat (wd:Q2934), also known as C. aegagrus hircus, C. a. hircus, Capra aegagrus hircus, Capra hircus, C. hircus, etc.: domesticated mammal raised for its meat and milk / is subclass of domesticated mammal / is subclass of productive animal / is instance of taxon
2. Goat (wd:Q867696): is instance of animal from the Chinese zodiac / eighth sign in the Chinese zodiac
3. The Goat (wd:Q246324, matched via Goat), also known as Goat: is instance of short film / 1921 film
4. Goat (wd:Q19878467): 2016 film by Andrew Neel / is instance of film
5. Goat (wd:Q20899450), also known as Koza: 2015 film by Ivan Ostrochovský / is instance of film
6. The Goat (wd:Q13460277, matched via Goat), also known as Goat: 1918 film by Donald Crisp / is instance of film
7. G.O.A.T. (wd:Q3291203, matched via GOAT), also known as GOAT: 2000 album by LL Cool J / is instance of album / album by LL Cool J / album by LL Cool J
8. Capra (wd:Q1031610, matched via goat), also known as goat, koza: traditional Slavic, Moldavian and Romanian rite with a song / is instance of Slavic bypass rite / is instance of ritual
9. goat (wd:Q198755), also known as buck: is subclass of heraldic animal / heraldic animal
10. Goat (wd:Q3109568): is instance of album / Jesus Lizard album

[Assistant]
Planned SPARQL: find items (?mascot) with wdt:P822 (mascot of) = wd:Q104770 (1. FC Köln); retrieve English label, image (P18), the mascot statement p:P822 qualifiers pq:P580 (start time) and pq:P582 (end time); for missing end time use NOW() via COALESCE; restrict results to items that are instance of goat (wd:Q2934) or whose English label contains "hennes". I'll run this query to get the candidate goat mascots.

execute

SELECT DISTINCT ?mascot ?mascotLabel ?image ?start ?end (COALESCE(?end, NOW()) AS ?endOrNow) ?type ?typeLabel WHERE {
  # mascots whose wdt:P822 (mascot of) is 1. FC Köln
  ?mascot wdt:P822 wd:Q104770 .

  # labels and image
  OPTIONAL { ?mascot rdfs:label ?mascotLabel . FILTER(LANG(?mascotLabel) = "en") }
  OPTIONAL { ?mascot wdt:P18 ?image }

  # statement node to get qualifiers start/end
  OPTIONAL {
    ?mascot p:P822 ?stmt .
    ?stmt ps:P822 wd:Q104770 .
    OPTIONAL { ?stmt pq:P580 ?start }
    OPTIONAL { ?stmt pq:P582 ?end }
  }

  # instance of / type
  OPTIONAL { ?mascot wdt:P31 ?type . OPTIONAL { ?type rdfs:label ?typeLabel FILTER(LANG(?typeLabel) = "en") } }

  # filter to goats (taxon Q2934) or items whose English label contains "hennes"
  FILTER(
    ?type = wd:Q2934 || (BOUND(?mascotLabel) && CONTAINS(LCASE(?mascotLabel), "hennes"))
  )
}
ORDER BY ?start ?mascotLabel

[Assistant]
I'll inspect how P822 (mascot) is used by listing some triples that use that property to see which direction is common and example items.

list

Got 1,079 rows and 3 columns, showing the first 10 rows below:
| subject                                               | property          | object                             |
| ----------------------------------------------------- | ----------------- | ---------------------------------- |
| Wikipedia (wd:Q52)                                    | mascot (wdt:P822) | Wikipede (wd:Q43374491)            |
| Kazi Nazrul University (wd:Q6381094)                  | mascot (wdt:P822) | Sun (wd:Q525)                      |
| The Last Bacon (wd:Q115913890)                        | mascot (wdt:P822) | house cat (wd:Q146)                |
| Leones de Ponce (wd:Q1052616)                         | mascot (wdt:P822) | lion (wd:Q140)                     |
| Sala d'Armes Montjuïc (wd:Q23499546)                  | mascot (wdt:P822) | chicken (wd:Q780)                  |
| Movement for the Liberation of Peoples (wd:Q56274971) | mascot (wdt:P822) | volcano (wd:Q8072)                 |
| wd:Q46466299                                          | mascot (wdt:P822) | tiger (wd:Q19939)                  |
| Conalep Ing. Bernardo Quintana Arrioja (wd:Q77871564) | mascot (wdt:P822) | Canis lupus (wd:Q18498)            |
| elephant (wd:Q7378)                                   | mascot (wdt:P822) | Republican Elephant (wd:Q64494870) |
| Linux (wd:Q388)                                       | mascot (wdt:P822) | Tux (wd:Q131200)                   |
| ...                                                   | ...               | ...                                |

[Assistant]
I will query wd:Q104770 (1. FC Köln) for its wdt:P822 values (mascots), then retrieve their labels, images, instance-of, and any start/end qualifiers on the P822 statements.

execute

SELECT DISTINCT ?mascot ?mascotLabel ?image ?type ?typeLabel ?start ?end (COALESCE(?end, NOW()) AS ?endOrNow) WHERE {
  wd:Q104770 wdt:P822 ?mascot .

  OPTIONAL { ?mascot rdfs:label ?mascotLabel . FILTER(LANG(?mascotLabel) = "en") }
  OPTIONAL { ?mascot wdt:P18 ?image }
  OPTIONAL { ?mascot wdt:P31 ?type . OPTIONAL { ?type rdfs:label ?typeLabel FILTER(LANG(?typeLabel) = "en") } }

  # statement qualifiers on the organization's P822 statement
  OPTIONAL {
    wd:Q104770 p:P822 ?orgStmt .
    ?orgStmt ps:P822 ?mascot .
    OPTIONAL { ?orgStmt pq:P580 ?start }
    OPTIONAL { ?orgStmt pq:P582 ?end }
  }
}
ORDER BY ?start ?mascotLabel

[Assistant] I'll look for items whose instance-of (P31) is the Billygoat Hennes item (Q151345), which would represent individual goats.

[Assistant]
I'll inspect all triples for the Billygoat Hennes item to see how individual goats might be represented (e.g., via 'has part', 'replaces', or dedicated statements). This may be a lot of triples, but I'll fetch them to examine patterns.

list

wd:Q151345

Got 74 rows and 3 columns, showing the first 10 rows below:
| subject                       | property                               | object                                                                                |
| ----------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Billygoat Hennes (wd:Q151345) | instance of (wdt:P31)                  | mascot character (wd:Q386208)                                                                                |
| Billygoat Hennes (wd:Q151345) | country (wdt:P17)                      | Germany (wd:Q183)                                                                                |
| Billygoat Hennes (wd:Q151345) | Google Knowledge Graph ID (wdtn:P2671) | <http://g.co/kg/g/122q9f_x>                                                                                |
| Billygoat Hennes (wd:Q151345) | Commons category (wdt:P373)            | Hennes (mascot)                                                                                |
| Billygoat Hennes (wd:Q151345) | image (wdt:P18)                        | <http://commons.wikimedia.org/wiki/Special:FilePath/Gei%C3%9Fbock%20Hennes%20IX.%20im%20K%C3%B6lner%20Zoo-4116.jpg> |
| Billygoat Hennes (wd:Q151345) | inception (wdt:P571)                   | 1950-02-13T00:00:00Z (xsd:dateTime)                                                                                |
| Billygoat Hennes (wd:Q151345) | sport (wdt:P641)                       | association football (wd:Q2736)                                                                                |
| Billygoat Hennes (wd:Q151345) | cast member (wdt:P161)                 | wd:Q117303631                                                                                |
| Billygoat Hennes (wd:Q151345) | named after (wdt:P138)                 | Hennes Weisweiler (wd:Q151105)                                                                                |
| Billygoat Hennes (wd:Q151345) | wdt:P31279                             | mascot (wd:Q18670161)                                                                                |
| ...                           | ...                                    | ...                                                                                |

[Assistant]
I'll inspect the item wd:Q117303631 which is linked as a 'cast member' of the Billygoat Hennes item; this may represent one of the individual goat mascots.

wd:Q117303631

[Assistant]
I'll check the statement nodes for Q117303631 on property P2868 to see if there are qualifiers like start/end time.

wd:Q117303631

[Assistant] Now I'll list triples for the statement node so I can read its qualifiers (e.g., start/end time).

[Assistant]
Now I'll query all items that have property P2868 (subject has role) pointing to the Billygoat Hennes item (Q151345). For each such item I'll get the English label, image (P18), and the P2868 statement qualifiers pq:P580 (start time) and pq:P582 (end time), using COALESCE to set end to NOW() when missing. I'll order results by start time.

execute

SELECT DISTINCT ?goat ?goatLabel ?image ?start ?end (COALESCE(?end, NOW()) AS ?endOrNow) WHERE {
  # individuals who have the role Billygoat Hennes
  ?goat wdt:P2868 wd:Q151345 .

  OPTIONAL { ?goat rdfs:label ?goatLabel FILTER(LANG(?goatLabel) = "en") }
  OPTIONAL { ?goat wdt:P18 ?image }

  OPTIONAL {
    ?goat p:P2868 ?stmt .
    ?stmt ps:P2868 wd:Q151345 .
    OPTIONAL { ?stmt pq:P580 ?start }
    OPTIONAL { ?stmt pq:P582 ?end }
  }
}
ORDER BY ?start ?goatLabel

[Assistant]
I'll run a refined query that returns a fallback label (English if available, otherwise German or a no-language label), image, start, end, and endOrNow using COALESCE(NOW()). I'll then present the results.

SELECT DISTINCT ?goat ?label ?image ?start ?end (COALESCE(?end, NOW()) AS ?endOrNow) WHERE {
  ?goat wdt:P2868 wd:Q151345 .

  OPTIONAL { ?goat rdfs:label ?labelEn FILTER(LANG(?labelEn) = "en") }
  OPTIONAL { ?goat rdfs:label ?labelDe FILTER(LANG(?labelDe) = "de") }
  OPTIONAL { ?goat rdfs:label ?labelNoLang FILTER(LANG(?labelNoLang) = "") }
  BIND(COALESCE(?labelEn, ?labelDe, ?labelNoLang, STRAFTER(STR(?goat), "entity/")) AS ?label)

  OPTIONAL { ?goat wdt:P18 ?image }

  OPTIONAL {
    ?goat p:P2868 ?stmt .
    ?stmt ps:P2868 wd:Q151345 .
    OPTIONAL { ?stmt pq:P580 ?start }
    OPTIONAL { ?stmt pq:P582 ?end }
  }
}
ORDER BY ?start ?label

[Assistant]
answer

SELECT DISTINCT ?goat ?label ?image ?start ?end (COALESCE(?end, NOW()) AS ?endOrNow) WHERE {
  ?goat wdt:P2868 wd:Q151345 .

  OPTIONAL { ?goat rdfs:label ?labelEn FILTER(LANG(?labelEn) = "en") }
  OPTIONAL { ?goat rdfs:label ?labelDe FILTER(LANG(?labelDe) = "de") }
  OPTIONAL { ?goat rdfs:label ?labelNoLang FILTER(LANG(?labelNoLang) = "") }
  BIND(COALESCE(?labelEn, ?labelDe, ?labelNoLang, STRAFTER(STR(?goat), "entity/")) AS ?label)

  OPTIONAL { ?goat wdt:P18 ?image }

  OPTIONAL {
    ?goat p:P2868 ?stmt .
    ?stmt ps:P2868 wd:Q151345 .
    OPTIONAL { ?stmt pq:P580 ?start }
    OPTIONAL { ?stmt pq:P582 ?end }
  }
}
ORDER BY ?start ?label

Answer:
I queried Wikidata for items that have the role "Billygoat Hennes" (Q151345) and returned their item IRIs, labels (English if available, otherwise German or a no-language label), image (P18) where present, the role start time (pq:P580) and end time (pq:P582). For items lacking an end time the query substituted the current timestamp (NOW()). The query returned these individual goats (with their QIDs, labels, image URLs if available, start and end/end-as-of):

- wd:Q117303903 — Hennes I. (label language: de)
  - image: (none on Wikidata)
  - start: 1950-02-13T00:00:00Z
  - end: 1966-11-04T00:00:00Z

- wd:Q117303933 — Hennes II. (label language: de)
  - image: (none on Wikidata)
  - start: 1966-11-26T00:00:00Z
  - end: 1970-08-01T00:00:00Z

- wd:Q117303888 — Hennes III. (label language: de)
  - image: (none on Wikidata)
  - start: 1970-08-22T00:00:00Z
  - end: 1975-07-01T00:00:00Z

- wd:Q117303880 — Hennes IV. (label language: de)
  - image: (none on Wikidata)
  - start: 1975-08-01T00:00:00Z
  - end: 1982-11-13T00:00:00Z

- wd:Q117303876 — Hennes V. (label language: de)
  - image: (none on Wikidata)
  - start: 1982-11-20T00:00:00Z
  - end: 1989-07-01T00:00:00Z

- wd:Q117303856 — Hennes VI. (label language: de)
  - image: (none on Wikidata)
  - start: 1989-08-01T00:00:00Z
  - end: 1996-03-13T00:00:00Z

- wd:Q117303807 — Hennes VII. (label language: de)
  - image: http://commons.wikimedia.org/wiki/Special:FilePath/Fc%20hennes.jpg
  - start: 1996-03-15T00:00:00Z
  - end: 2008-07-23T00:00:00Z

- wd:Q117303721 — Hennes VIII. (label language: de)
  - image: http://commons.wikimedia.org/wiki/Special:FilePath/Einweihung%20Carola-Williams-Park%2035.jpg
  - start: 2008-08-24T00:00:00Z
  - end: 2019-08-04T00:00:00Z

- wd:Q117303631 — Hennes IX. (label language: de)
  - image: http://commons.wikimedia.org/wiki/Special:FilePath/Gei%C3%9Fbock%20Hennes%20IX.%20im%20K%C3%B6lner%20Zoo-4124.jpg
  - start: 2019-08-04T00:00:00Z
  - end: (no end qualifier on Wikidata) — substituted with query time: 2025-10-14T15:34:05.364+02:00 (this is the NOW() value from the query execution)

Notes and provenance:
- The SPARQL query uses property P2868 (subject has role) on the animal items to identify those that served as the role Billygoat Hennes (Q151345). Individual service periods are qualifiers on those P2868 statements (pq:P580 start time, pq:P582 end time).
- Image URLs come from P18 when present and point to the Wikimedia Commons file paths.
- The end time for Hennes IX was missing in Wikidata, so the query returned the current timestamp (NOW()) as the substitute; the exact timestamp above is the time the query ran.

If you want, I can:
- also fetch German and English labels explicitly in separate columns,
- include each goat's date of birth / place of birth / breed, or
- export these results as CSV/JSON.