Ontology Templates
Ontology templates provide pre-built sets of object types, properties, and relationships for common industry verticals. Templates accelerate ontology development by providing a starting point that can be customized for each tenant's specific needs.
Source: data-plane/ontology-service/src/templates/
Template Architecture
| Component | Module | Purpose |
|---|---|---|
| Template Registry | registry.py | Template catalog and versioning |
| Template Deployer | deployer.py | Deploy templates to tenant ontology |
| Template Models | models.py | Template data structures |
Available Templates
| Template | Object Types | Description |
|---|---|---|
| E-Commerce | Customer, Order, Product, Category, Review | Retail and e-commerce domain |
| Financial Services | Account, Transaction, Customer, Portfolio | Banking and financial data |
| Healthcare | Patient, Encounter, Diagnosis, Medication | Clinical data domain |
| Manufacturing | Product, WorkOrder, Machine, Inventory | Manufacturing operations |
| SaaS | User, Subscription, Invoice, Feature | Software-as-a-service metrics |
| Supply Chain | Supplier, PurchaseOrder, Shipment, Warehouse | Logistics and supply chain |
| Marketing | Campaign, Lead, Contact, Conversion | Marketing analytics |
| IoT | Device, Sensor, Reading, Alert | Internet of Things telemetry |
| HR | Employee, Department, Position, Performance | Human resources |
| Education | Student, Course, Enrollment, Grade | Educational institutions |
Template Structure
{
"name": "e-commerce",
"version": "1.0.0",
"description": "E-commerce domain ontology",
"objectTypes": [
{
"name": "Customer",
"layer": "semantic",
"properties": [
{"name": "customer_id", "dataType": "string", "required": true},
{"name": "email", "dataType": "string", "required": true},
{"name": "name", "dataType": "string", "required": true},
{"name": "segment", "dataType": "string", "required": false}
],
"relationships": [
{"name": "orders", "targetType": "Order", "cardinality": "ONE_TO_MANY"}
],
"governance": {
"classification": "CONFIDENTIAL",
"pii_fields": ["email", "name"]
}
}
]
}Deploying a Template
POST /v1/ontology/templates/deploy
Request:
{
"templateName": "e-commerce",
"version": "1.0.0",
"customizations": {
"excludeObjectTypes": ["Review"],
"additionalProperties": {
"Customer": [
{"name": "loyalty_tier", "dataType": "string"}
]
}
}
}
Response:
{
"deploymentId": "deploy-abc-123",
"objectTypesCreated": 4,
"relationshipsCreated": 6,
"status": "completed"
}Template Management API
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/ontology/templates | List available templates |
| GET | /v1/ontology/templates/:name | Get template details |
| POST | /v1/ontology/templates/deploy | Deploy a template |
| POST | /v1/ontology/templates | Create a custom template |
| PUT | /v1/ontology/templates/:name | Update a template |
Customization Options
| Option | Description |
|---|---|
excludeObjectTypes | Skip specific object types from the template |
additionalProperties | Add extra properties to object types |
overrideGovernance | Override governance settings for the deployment |
namingPrefix | Add a prefix to all object type names |
Related Pages
- Object Types -- Object type model
- Datasource Mapping -- Map templates to data sources
- Pipeline Templates -- Pipeline-level templates