> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pnbr.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Ontology

> Read the active ontology as a document with pb.ontology.

`pb.ontology` reads the active ontology: the types, shapes, and relationships your
graph is governed by. You author this structure in the Shapes Workbench; here you
read it at run time.

## pb.ontology

Read the active ontology as a document.

```ts theme={null}
const ontology = await pb.ontology({ format: "markdown" });
console.log(ontology.markdown || ontology.content);
```

<ParamField path="format" type="string" default="markdown">
  Output format, for example `markdown`.
</ParamField>

<ParamField path="projectId" type="string">
  Required when your key spans more than one project.
</ParamField>

## Related

<Columns cols={2}>
  <Card title="Types" icon="shapes" href="/sdk/types">
    Read and manage entity types with `pb.types`.
  </Card>

  <Card title="Shapes" icon="diagram-project" href="/sdk/shapes">
    Read shapes and their derived artifacts with `pb.shapes`.
  </Card>
</Columns>
