Business ontology examples
Concrete Turtle snippets showing how different domains model their metrics, dimensions, and relationships using Magnowlia's four-layer ontology framework. Each example is annotated so you can understand the patterns and apply them to your own data.
E-commerce ontology
Based on the Acme Shop sample. Models customers, orders, products, and line items with metrics like Total Revenue and Average Order Value.
Business classes and properties
b:Customer a owl:Class ;
rdfs:label "Customer" ;
rdfs:comment "A person or organization that places orders" ;
skos:altLabel "Buyer" , "Client" ;
m:mapsToTable t:public.customers .
b:Order a owl:Class ;
rdfs:label "Order" ;
rdfs:comment "A customer purchase transaction" ;
m:mapsToTable t:public.orders .
b:placedBy a owl:ObjectProperty ;
rdfs:label "placed by" ;
rdfs:domain b:Order ;
rdfs:range b:Customer ;
m:realizedBy "orders.customer_id = customers.id" .Each class maps to a physical table. The placedBy relationship between Order and Customer is declared with a SQL join condition, so queries that cross these two tables always use the correct join logic.
Metrics
b:TotalRevenue a bv:Metric ;
rdfs:label "Total Revenue" ;
bv:metricExpression "SUM(total_amount)" ;
bv:timeDimension b:OrderDate ;
bv:metricTable t:public.orders ;
bv:metricPreFilter "status = 'completed'" ;
bv:metricCategory "Revenue" .
b:AverageOrderValue a bv:Metric ;
rdfs:label "Average Order Value" ;
skos:altLabel "AOV" ;
bv:metricExpression "AVG(total_amount)" ;
bv:timeDimension b:OrderDate ;
bv:metricTable t:public.orders ;
bv:metricPreFilter "status = 'completed'" ;
bv:metricCategory "Revenue" .Metrics are first-class objects with SQL expressions, time dimensions, pre-filters, and categories. Theskos:altLabel "AOV" on Average Order Value means queries using the abbreviation resolve to the same metric. View the full Acme Shop ontology →
SaaS metrics ontology
A conceptual example showing how subscription-based businesses model MRR, churn, and ARR. The same four-layer approach applies: business classes at the top, physical tables at the bottom.
b:Subscription a owl:Class ;
rdfs:label "Subscription" ;
rdfs:comment "A recurring billing arrangement with a customer" ;
m:mapsToTable t:public.subscriptions .
b:MRR a bv:Metric ;
rdfs:label "Monthly Recurring Revenue" ;
skos:altLabel "MRR" ;
rdfs:comment "Sum of active subscription amounts normalized to monthly" ;
bv:metricExpression "SUM(monthly_amount)" ;
bv:timeDimension b:BillingDate ;
bv:metricTable t:public.subscriptions ;
bv:metricPreFilter "status = 'active'" ;
bv:metricCategory "Revenue" .
b:ChurnRate a bv:Metric ;
rdfs:label "Churn Rate" ;
skos:altLabel "Monthly Churn" , "Customer Churn" ;
rdfs:comment "Percentage of subscriptions cancelled in the period" ;
bv:metricSql """
SELECT DATE_TRUNC('month', cancelled_at) AS period,
COUNT(*) * 1.0 / (SELECT COUNT(*) FROM subscriptions
WHERE status = 'active') AS churn_rate
FROM subscriptions WHERE cancelled_at IS NOT NULL
GROUP BY 1""" ;
bv:metricCategory "Retention" .
b:ARR a bv:Metric ;
rdfs:label "Annual Recurring Revenue" ;
skos:altLabel "ARR" ;
rdfs:comment "MRR multiplied by 12" ;
bv:metricSql "SELECT SUM(monthly_amount) * 12 AS arr FROM subscriptions WHERE status = 'active'" ;
bv:dependsOnConstant b:AnnualizationFactor ;
bv:metricCategory "Revenue" .
b:AnnualizationFactor a bv:BusinessConstant ;
rdfs:label "Annualization Factor" ;
bv:constantValue 12 .Notice how bv:metricSql is used for complex metrics that need a full SQL template instead of a simple expression. The Churn Rate metric uses a subquery, and ARR declares a dependency on a business constant (the annualization factor of 12).
Marketing analytics ontology
A conceptual example for marketing teams: campaigns, conversions, and attribution modeled as business concepts with metrics for spend efficiency and conversion rate.
b:Campaign a owl:Class ;
rdfs:label "Campaign" ;
rdfs:comment "A marketing campaign across one or more channels" ;
skos:altLabel "Ad Campaign" , "Marketing Initiative" ;
m:mapsToTable t:public.campaigns .
b:Conversion a owl:Class ;
rdfs:label "Conversion" ;
rdfs:comment "A tracked conversion event attributed to a campaign" ;
m:mapsToTable t:public.conversions .
b:attributedTo a owl:ObjectProperty ;
rdfs:label "attributed to" ;
rdfs:domain b:Conversion ;
rdfs:range b:Campaign ;
m:realizedBy "conversions.campaign_id = campaigns.id" .
b:ConversionRate a bv:Metric ;
rdfs:label "Conversion Rate" ;
skos:altLabel "CVR" ;
rdfs:comment "Percentage of impressions that result in a conversion" ;
bv:metricExpression "COUNT(DISTINCT conversion_id) * 1.0 / NULLIF(SUM(impressions), 0)" ;
bv:timeDimension b:ConversionDate ;
bv:metricTable t:public.conversions ;
bv:metricCategory "Performance" .
b:CostPerAcquisition a bv:Metric ;
rdfs:label "Cost per Acquisition" ;
skos:altLabel "CPA" , "Cost per Conversion" ;
rdfs:comment "Total spend divided by number of conversions" ;
bv:metricExpression "SUM(spend) / NULLIF(COUNT(DISTINCT conversion_id), 0)" ;
bv:timeDimension b:ConversionDate ;
bv:metricTable t:public.conversions ;
bv:metricCategory "Efficiency" .The marketing ontology follows the same patterns: business classes map to tables, relationships declare join logic, and metrics carry their SQL expressions and time dimensions. A user asking “what is our CPA by channel?” resolves automatically through the synonym and the ontology graph.
Explore more
Acme Shop full ontology
Browse the complete four-layer e-commerce ontology with source code.
View ontology →Mapping vocabulary
Classes and properties for mapping concepts to database tables.
View vocabulary →Business vocabulary
Framework types for metrics, time dimensions, and constants.
View vocabulary →What is a business ontology?
Definitions, comparisons, and how to get started.
Learn more →Build your own ontology
Connect your data warehouse, define your business concepts and metrics, and start asking questions in plain English. No credit card required.
Get Started Free