# presentation/views/ontology.view.ts

> 54 lines of code and 5 definitions.

Tree: Site tree
Language: typescript
Layer: product
Canonical: https://banes-lab.com/anatomy/tree#file-presentation-views-ontology-view-ts
Source text: https://banes-lab.com/assets/sources/source.c5fd2c7fa977e215d3d02b9141b70d9bfad007e14452f6039e8161827c0caab8.generated.txt

## Definitions

- `renderOntology` (lexical_declaration, line 40)
- `JSON_FORMAT` (lexical_declaration, line 14)
- `ONTOLOGY_ENTITY` (lexical_declaration, line 16)
- `DEFINITION` (lexical_declaration, line 32)
- `PAGE` (lexical_declaration, line 46, exported)

## Uses

- [presentation/widgets/tab.widget.ts](https://banes-lab.com/source/tree/presentation/widgets/tab.widget.ts.md)

## Source

```typescript
import { CREATIVE_COMMONS, SITE_URL, faceIndexPath, pagePath } from "#assets/link.assets";
import { CREATIVE_COMMONS_LICENSE, ONTOLOGY_DESCRIPTION, ONTOLOGY_TITLE } from "#configuration/strings/page.strings";
import { mountTabSwitching, renderTabbedPage } from "#presentation/widgets/tab.widget";
import { METHODOLOGY_AUTHOR } from "#configuration/strings/methodology.strings";
import { ONTOLOGY_FACES } from "@govlab/constants";
import { ONTOLOGY_META } from "#configuration/strings/ontology.strings";
import { ONTOLOGY_PAGE } from "#core/ids/page.ids";
import { ONTOLOGY_TABS } from "#configuration/strings/ontology.fragment.strings";
import { ONTOLOGY_TONE } from "#configuration/constants/tab.constants";
import type { PageDefinition } from "#types/page.types";
import type { SchemaEntity } from "#types/schema.types";
import type { TabbedPage } from "#types/tab.types";

const JSON_FORMAT = "application/json";

const ONTOLOGY_ENTITY: SchemaEntity = {
    "@type": "Dataset",
    author: { "@type": "Person", name: METHODOLOGY_AUTHOR },
    description: ONTOLOGY_DESCRIPTION,
    distribution: [...ONTOLOGY_FACES].map((face) => ({
        "@type": "DataDownload",
        contentUrl: SITE_URL + faceIndexPath(face),
        encodingFormat: JSON_FORMAT,
        name: face,
    })),
    license: CREATIVE_COMMONS,
    name: ONTOLOGY_META.title,
    url: SITE_URL + pagePath(ONTOLOGY_PAGE),
    version: ONTOLOGY_META.version,
};

const DEFINITION: TabbedPage = {
    layout: "grid",
    meta: ONTOLOGY_META,
    page: ONTOLOGY_PAGE,
    tabs: ONTOLOGY_TABS,
    tone: ONTOLOGY_TONE,
};

const renderOntology = function renderOntology(): Element {
    return renderTabbedPage(DEFINITION);
};

void mountTabSwitching(DEFINITION);

export const PAGE: PageDefinition = {
    content: {
        kind: "tabbed",
        layout: DEFINITION.layout,
        meta: ONTOLOGY_META,
        tabs: ONTOLOGY_TABS,
        tone: DEFINITION.tone,
    },
    description: ONTOLOGY_DESCRIPTION,
    entities: [ONTOLOGY_ENTITY],
    id: ONTOLOGY_PAGE,
    license: CREATIVE_COMMONS_LICENSE,
    render: renderOntology,
    title: ONTOLOGY_TITLE,
};
```
