import type { LatLon } from "@mailwoman/spatial/position"; import type { PathBuilderLike } from "path-ts"; import type { WikidataClient } from "#tools/fetch/wikidata/subvenue"; import { type FetchVitalEntitiesResult, type VitalEntityRecord } from "#tools/fetch/wikidata/vital-places/entities"; import { type ProgressReporter } from "#tools/fetch/wikidata/vital-places/progress"; import type { QRankRow } from "#tools/fetch/wikidata/vital-places/qrank"; /** * The ids one query asks for. * * The query is a GET, and 200 ids keep its URL well under the service's limit. */ export declare const QUERY_ENTITY_BATCH = 200; /** * The queries in flight at once. * * The query service admits five parallel queries from one client. */ export declare const QUERY_ENTITY_CONCURRENCY = 3; /** * The query for one batch: one row per field value, tagged with the field it belongs to. */ export declare function buildEntityFieldsQuery(qids: readonly string[], languages: readonly string[]): string; /** * An Earth coordinate from a `wdt:P625` literal. * * Another body's coordinate writes its globe's IRI before the point. */ export declare function readPointLiteral(literal: string): LatLon | null; /** * The records of one batch, built from the query's field rows. * An id with no row is recorded as missing. */ export declare function recordsFromFieldRows(batch: readonly QRankRow[], bindings: ReadonlyArray>): VitalEntityRecord[]; export interface FetchVitalEntitiesFromQueriesOptions { entitiesPath: PathBuilderLike; languages?: readonly string[]; batchSize?: number; concurrency?: number; reportEvery?: number; report?: ProgressReporter; } /** * Append a record for every ranked id the entities file lacks, one query per batch, * with a few queries in flight. * * An id already on disk isn't asked for again, and a failed query is reported and left for a rerun. */ export declare function fetchVitalEntitiesFromQueries(client: Pick, rows: readonly QRankRow[], options: FetchVitalEntitiesFromQueriesOptions): Promise; //# sourceMappingURL=query-entities.d.ts.map