Queries
How the ontology is used to make AI-generated queries
This page explains the structure of ontology queries and how ontology queries are generated by AI.
This page is a work in progress
Structure of an Ontology Query:
An ontology query has five main parts: A core fact object, metrics, dimensions, filters and orders.
An ontology query is structured to ensure comprehensive data retrieval, allowing users to specify precisely what information they seek. Each part of the query plays a crucial role in defining the scope, granularity, and specifics of the data request. The five main parts of an ontology query are:
Core Fact Object
Definition: The core fact object is the central noun or entity around which the query is structured. It represents the primary focus of the analysis. Purpose: This object determines the main table or dataset from which the data will be fetched. It serves as the anchor for linking related metrics, dimensions, and filters. Example: In a query aiming to analyze sales performance, the core fact object could be the Sale noun, focusing the query on the sales data.
Metrics
Definition: Metrics are quantifiable measures that are used to assess, compare, and track performance or condition. In the context of an ontology query, metrics are derived from the core fact object and related entities. Purpose: They provide the numerical basis for analysis, such as sums, averages, counts, or custom calculations. Example: Metrics in a sales analysis might include total sales, average sale value, or number of transactions.
Dimensions
Definition: Dimensions are attributes or categories that provide context for metrics. They are used to segment, categorize, and detail the data. Purpose: Dimensions allow for the breakdown of metrics across different categories, such as time periods, geographical locations, or product types, facilitating deeper insights. Example: In a sales query, dimensions could include sale date (time dimension), customer region (geographical dimension), or product category.
Filters
Definition: Filters are criteria used to include or exclude data from the query results. They refine the query by focusing on specific segments of the data. Purpose: Filters ensure that the analysis is relevant to the user’s specific needs, by narrowing down the data set to relevant subsets. Example: A filter in a sales analysis might limit the query to a specific time frame, such as sales in the last quarter, or to sales exceeding a certain amount.
Orders
Definition: Orders specify the sorting of the query results, based on certain dimensions or metrics. Purpose: They help organize the output, making it easier to understand trends, identify top or bottom performers, and analyze data sequences. Example: Ordering a sales report by descending total sales value to see the top-performing products or regions first.