agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
36 lines • 1.99 kB
TypeScript
/**
* ontology/toSkos — the reverse walk: our map written as a SKOS concept
* scheme in JSON-LD, with what SKOS cannot say in a `footprint:` namespace
* declared in the `@context`, so nothing of ours is lost.
*
* Pattern: one pure function over an `OntologySpec`; the twin of
* `fromSkos.ts · readSkos`, pinned as a round trip
* (`readSkos(toSkos(spec))` ≡ the spec's terms and edges).
* Role: Map. A term becomes a `skos:Concept` (prefLabel = id, definition
* = meaning, altLabel = aliases, `footprint:unit`); `is-a` becomes
* `skos:broader`, `related` becomes `skos:related`, every other
* relation — and any edge carrying a `meaning` — becomes a
* `footprint:edge`; a source becomes a `footprint:Source` node and
* a holding a `footprint:heldBy` entry (source, via, coverage).
* The scheme node carries the version as `owl:versionInfo`.
* Emits: N/A.
*
* NOT serving: the model is still served `serve.ts · ontologyPiece`; this
* is an export for a host that keeps its taxonomy in SKOS (the owner's
* ruling: serving in SKOS vocabulary waits for the bench).
*/
import type { OntologySpec } from './types.js';
/** The base every IRI `toSkos` mints hangs off: `<base><id>` for the scheme, `<base><id>#<term>` for a concept. */
export declare const SKOS_IRI_BASE = "https://footprintjs.dev/ontology/";
export interface ToSkosOptions {
/** The `@language` every label and definition is tagged with (default `'en'`). */
readonly language?: string;
}
/** A JSON-LD document: `@context` + `@graph`. */
export interface SkosDocument {
readonly '@context': Readonly<Record<string, string>>;
readonly '@graph': readonly Readonly<Record<string, unknown>>[];
}
/** Write the map as a SKOS concept scheme in JSON-LD. Pure: same spec, same document. */
export declare function toSkos(spec: OntologySpec, options?: ToSkosOptions): SkosDocument;
//# sourceMappingURL=toSkos.d.ts.map