/** * What a Wikidata entity says about a competition's classification. * * LEA-7 linked our leagues to Wikidata entities without letting our own * `gender`, `squad`, `scope` or `confederation` gate the match — precisely so * that the entity could then be used as an INDEPENDENT second opinion on them. * This module is that second opinion, and nothing here reads what we hold. * * Every function returns `undefined` rather than a default when the entity is * silent. Silence is not evidence: `P2094` (competition class) is set on 256 of * the 732 leagues with a cached entity and `P664` (organiser) on 585, so most rows will have * an answer on some axes and none on others. A fabricated "men" for an entity * that says nothing would be indistinguishable from one it actually asserts — * the same mistake the retired `category` made by having no way to say * "unknown". * * Inputs are the ENGLISH LABELS of the claim values, not QIDs — the resolved * strings the fetch step already writes ("women's association football", * "Union of European Football Associations"). Matching on labels rather than * ids keeps this readable and testable, and Wikidata's football-competition * classes are stable enough in English for it; the cost is that a relabelled * class stops matching, which fails closed to `undefined`. */ import { Gender, Squad, GENDERS, SQUADS } from "@weekendgoals/weekendgoals-types/dist/classification"; export { Gender, Squad, GENDERS, SQUADS }; /** How a competition's entrants are drawn. Mirrors `League.scope`. */ export type Scope = "domestic" | "club_international" | "national_team"; export declare const SCOPES: Scope[]; /** Mirrors `League.confederation`. */ export type Confederation = "UEFA" | "CONMEBOL" | "CONCACAF" | "CAF" | "AFC" | "OFC" | "GLOBAL"; /** * The claim values this module reads, already resolved to English labels. * A claim absent from the entity is an absent field, never an empty array — * the two mean different things and the callers below rely on it. */ export interface EntityClaims { /** P31 instance of. */ instanceOf?: string[]; /** P279 subclass of. */ subclassOf?: string[]; /** P2094 competition class — "women's association football", "under-17 sport". */ competitionClass?: string[]; /** P641 sport. */ sport?: string[]; /** P664 organiser. */ organizer?: string[]; /** P17 country. */ country?: string[]; /** The entity's English label and the article title, for name-shaped markers. */ label?: string; article?: string; } /** * Gender, from the competition class first and the entity's own naming second. * * `P641` (sport) is deliberately NOT consulted, and the team pipeline's handoff * records why: `Q606060` is "women's association football", so a competition * that merely *lists* it — as a multi-sport or multi-division body does — reads * as women's when it is not. `P2094` is the property that means what we need. */ export declare function genderFromEntity(claims: EntityClaims): Gender | undefined; /** An explicit age restriction, as a number, from anywhere the entity states it. */ export declare function ageFromEntity(claims: EntityClaims): number | undefined; /** * Squad. Only `youth` and `reserve` are ever asserted. * * There is no positive Wikidata marker for "senior" — a senior competition is * simply one that says nothing about age — so returning `senior` here would be * inferring from silence across every competition Wikidata describes tersely. * The caller decides whether an entity that is silent on age, on a row we hold * as youth, is disagreement or merely absence. */ export declare function squadFromEntity(claims: EntityClaims): Squad | undefined; /** * The confederation, from the organiser only. * * A NATIONAL association is not an answer: the Royal Spanish Football * Federation organises the Copa del Rey, and which confederation that sits in * is a fact about Spain, not about the organiser's name. Those return * `undefined` and the caller fills them from the country, which it already * holds. Only an organiser that IS a confederation answers here. */ export declare function confederationFromEntity(claims: EntityClaims): Confederation | undefined; /** * Scope, from the entity's class. * * Wikidata distinguishes these in the class itself — "international association * football national teams competition", "international association football * clubs cup", "national association football cup" — and that phrasing is the * only reliable statement of it. The `national`/`international` distinction is * read before the `clubs`/`national teams` one, because "national association * football cup" contains the word "national" and means the opposite. */ export declare function scopeFromEntity(claims: EntityClaims): Scope | undefined; /** * Everything the entity has to say, in one call, with the evidence that * produced each answer so a reviewer can check it without opening Wikidata. */ export declare function classifyFromEntity(claims: EntityClaims): { gender?: Gender; squad?: Squad; age?: number; scope?: Scope; confederation?: Confederation; evidence: string; }; //# sourceMappingURL=entity-classification.d.ts.map