@lde/resolver
v0.8.0
Published
Resolve external references with a durable fact store, adaptive per-host limits, timeouts, retry, failure isolation and an optional fetch window
Readme
@lde/resolver
Everything around fetching a fact from outside the graph: a durable store, bounded outbound work, retry of only what a retry can fix, failure isolation and an optional cap on how long a single run may fetch. You write the fetch and what to do with the answer.
Installation
npm install @lde/resolverimport { createResolver, sqliteFactStore } from '@lde/resolver';
// One store per process; one resolver per run.
const store = sqliteFactStore({ path: '/data/places.sqlite' });
const resolver = createResolver({
key: (iri: string) => iri,
host: 'termennetwerk-api.netwerkdigitaalerfgoed.nl',
fetch: async (iris, { signal }) =>
(await lookup(iris, { signal })).map((term) => [
term.uri,
coordinatesOf(term),
]),
store,
limits: { batchSize: 25 },
});
const resolved = await resolver.resolveAll(placeIris);Documentation
See the full documentation.
