The Problem
Modern applications often need to work with data from multiple sources: production databases, data warehouses, external APIs. The traditional approach is to copy all this data into a new system, creating data silos and synchronization headaches.
What if you could build a unified semantic layer over your existing data without moving it?
Enter the Ontology System
SINAS's ontology system lets you define concepts, properties, and relationships that map to your existing data sources. You choose how the data is accessed:
1. External Query Mode
Query your data where it lives. Perfect for real-time data that changes frequently:
POST /api/v1/ontology/queries
{
"concept_id": "customer_uuid",
"data_source_id": "production_db",
"sql_text": "SELECT id, name, email FROM customers WHERE active = true",
"sync_enabled": false
}
Data stays in your production database. SINAS executes the query when you need it.
2. Synced Mode
Periodically sync data to a local table for faster queries:
POST /api/v1/ontology/queries
{
"concept_id": "customer_uuid",
"data_source_id": "snowflake",
"sql_text": "SELECT * FROM analytics.customers",
"sync_enabled": true,
"sync_schedule": "0 */6 * * *" // Every 6 hours
}
SINAS maintains a local copy, updating it on schedule. Get the performance of local data with the convenience of automatic syncing.
3. Self-Managed Mode
Let SINAS fully manage the data with auto-generated CRUD APIs:
POST /api/v1/ontology/concepts
{
"namespace": "crm",
"name": "customer",
"is_self_managed": true
}
SINAS creates the table, generates REST endpoints, and handles all data operations.
Building a Semantic Layer
Once you've connected your data sources, you can build a unified API layer:
Define Concepts
// Customer concept
POST /api/v1/ontology/concepts
{
"namespace": "crm",
"name": "customer",
"display_name": "Customer"
}
Add Properties
POST /api/v1/ontology/properties
{
"concept_id": "customer_uuid",
"name": "email",
"data_type": "string",
"is_required": true
}
Create Relationships
POST /api/v1/ontology/relationships
{
"name": "customer_orders",
"from_concept_id": "customer_uuid",
"to_concept_id": "order_uuid",
"cardinality": "one_to_many"
}
Build Query Endpoints
POST /api/v1/ontology/endpoints
{
"name": "active_customers",
"route": "crm/customers/active",
"subject_concept_id": "customer_uuid",
"filters": [
{
"property_id": "status_property",
"op": "eq",
"param_name": "status",
"default_value": "active"
}
]
}
Querying Your Data
Once configured, query your unified data layer:
POST /api/v1/ontology/execute/crm/customers/active
{
"filters": {
"tier": "gold",
"signup_date_gte": "2024-01-01"
},
"limit": 50
}
SINAS generates the appropriate SQL, applies filters, handles joins, and returns results—regardless of whether the data comes from PostgreSQL, Snowflake, or local tables.
Use Cases
Data Unification
Build a single API layer over your production database, data warehouse, and SaaS tools.
AI Context
Give AI assistants access to structured business data through the ontology system. They can query customer information, product catalogs, or order history using generated endpoints.
Migration Path
Start with external query mode to keep data in place, then gradually migrate to synced or self-managed as your needs evolve.
Security and Permissions
The ontology system integrates with SINAS's permission model:
sinas.ontology.concepts.crm.customer.read:group
sinas.ontology.data.crm.customer.create:own
sinas.ontology.execute.crm.customer.read:group
Fine-grained permissions control who can define concepts, query data, or execute specific endpoints.
Coming Soon
- GraphQL support for complex relationship traversals
- Real-time sync with change data capture (CDC)
- Support for MongoDB and other NoSQL databases
- Auto-discovery of concepts from existing databases
Get Started
The ontology system is available now in all SINAS deployments. Check out our documentation for detailed guides and examples.