ViewTermtypeno test imports ittype ViewTerm = {
readonly curie: string;
readonly label: string;
readonly definition?: string;
readonly domain?: string;
readonly range?: string;
};What the page shows of a class or a property.
An HTML view of an ontology for people who read it in a browser and not in TypeScript (commons 0019-mizan-integrations FR-010, 0012-ontology): its classes, properties and code lists with their definitions, and the basis of each term, so that the ontology can be read outside TypeScript without a tool. One self-contained page, written deterministically from the data it is given, with its CSS embedded, readable in a light and a dark scheme and at a phone's width.
Every text is escaped. The page says it is generated and from what, and carries the ontology's IRI and version IRI where it has them.
import { exportHtmlView } from "./export-html.ts";
exportHtmlView({ title: "Mizan", iri: "https://x/o", classes: [], properties: [], codeLists: [], terms: [] }, "generated by a tool").startsWith("<!doctype html>"); // trueViewTermtypeno test imports ittype ViewTerm = {
readonly curie: string;
readonly label: string;
readonly definition?: string;
readonly domain?: string;
readonly range?: string;
};What the page shows of a class or a property.
ViewCodeListtypeno test imports ittype ViewCodeList = {
readonly name: string;
readonly members: readonly { readonly code: string; readonly label: string; readonly definition?: string }[];
};What the page shows of a code list: its name and its members.
ViewBasistypeno test imports ittype ViewBasis = {
readonly curie: string;
readonly basis: string;
readonly standardTerm?: string;
readonly relation?: string;
readonly justification?: string;
};What the page shows of the basis of a term.
OntologyViewtypeno test imports ittype OntologyView = {
readonly title: string;
readonly iri: string;
readonly versionIri?: string;
readonly classes: readonly ViewTerm[];
readonly properties: readonly ViewTerm[];
readonly codeLists: readonly ViewCodeList[];
readonly terms: readonly ViewBasis[];
};Everything the page is made from.
exportHtmlViewfunctionfunction exportHtmlView(v: OntologyView, generated: string): stringThe ontology as one HTML page; generated says what generated it, as the page's own note.