Guides

Exports

Ontology Workbench can export your model to eleven target formats. All exports are available from the workbench toolbar (Export button) or via the REST API.

Formats

Prisma Schema

Generates a schema.prisma file with models, fields, and relations. Enums are exported as Prisma enum blocks. Required fields are non-nullable. Abstract types are skipped with a comment — their properties are inherited by concrete subtypes.

model Product {
  id          String   @id @default(cuid())
  createdAt   DateTime @default(now())
  updatedAt   DateTime @updatedAt
  name        String
  price       Float?
 
  category    Category @relation("BelongsTo", fields: [categoryId], references: [id])
  categoryId  String
}

Drizzle ORM (TypeScript)

Generates a TypeScript file with Drizzle pgTable definitions and relations() blocks. Enum columns are emitted as pgEnum. Abstract entity types are skipped with a comment.

import { pgTable, text, real, timestamp } from "drizzle-orm/pg-core";
import { relations } from "drizzle-orm";
 
export const product = pgTable("product", {
  id:        text("id").primaryKey().notNull(),
  createdAt: timestamp("created_at").defaultNow().notNull(),
  updatedAt: timestamp("updated_at").defaultNow().notNull(),
 
  name:  text("name").notNull(),
  price: real("price"),
 
  categoryId: text("category_id").references(() => category.id),
});
 
export const productRelations = relations(product, ({ one }) => ({
  category: one(category, { fields: [product.categoryId], references: [category.id] }),
}));

SQLAlchemy (Python)

Generates modern SQLAlchemy 2.0 models using Mapped / mapped_column syntax. Python enum.Enum classes are emitted for enum properties. Abstract entity types become mixin classes.

from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, relationship
 
class Base(DeclarativeBase):
    pass
 
class Product(Base):
    __tablename__ = "product"
 
    id:         Mapped[str]            = mapped_column(String, primary_key=True)
    created_at: Mapped[datetime]       = mapped_column(DateTime, default=datetime.utcnow)
    name:       Mapped[str]            = mapped_column(String)
    price:      Mapped[Optional[float]] = mapped_column(Float, nullable=True)
 
    category_id: Mapped[Optional[str]] = mapped_column(String, ForeignKey("category.id"))
    category:    Mapped[Optional["Category"]] = relationship("Category", back_populates="products")

GraphQL SDL

Generates a GraphQL schema definition. Abstract entity types become interface definitions; concrete types become type with implements if they have a parent. Required fields are non-nullable (!).

type Product {
  id: ID!
  name: String!
  price: Float
  category: Category
}

JSON Schema (Draft 7)

Exports a JSON Schema document with $defs for each entity type. Inheritance is expressed with allOf + $ref. Useful for data validation pipelines and form builders.

Neo4j / Cypher

Generates Cypher CREATE CONSTRAINT and index statements plus MERGE patterns for nodes and relationships. Relationship properties are modeled as edge properties.

Amazon Neptune / Gremlin

Generates Gremlin traversal scripts for AWS Neptune. Entity types become vertex labels; relationships become edge labels with their properties.

ArangoDB

Generates a JSON collection schema and edge collection definitions compatible with ArangoDB.

DGraph DQL

Generates a DQL schema string for Dgraph's type system.

OWL / RDF

Exports an OWL ontology XML document. Entity types map to owl:Class, relationships to owl:ObjectProperty, and data properties to owl:DatatypeProperty. Compatible with Protégé, Apache Jena, and other RDF toolchains.

HTML Docs

Generates a standalone HTML reference document with every entity type, its properties, and its relationships. Useful for sharing schema documentation with non-technical stakeholders.

Exporting via API

GET /api/v1/models/{modelId}/export/{format}

Valid format values: prisma, drizzle, sqlalchemy, graphql, json-schema, neo4j, neptune, arangodb, dgraph, owl, docs.

See Endpoints for authentication, response headers, and full parameter details.