# Where to Find Ossie Semantic Models Examples in the Apache OSSIE Repository

> Discover Ossie semantic models examples in the Apache OSSIE repository examples directory. Explore TPC-DS and flights datasets to understand OSSIE Core Metadata Specification.

- Repository: [The Apache Software Foundation/ossie](https://github.com/apache/ossie)
- Tags: getting-started
- Published: 2026-07-24

---

**The Apache OSSIE repository provides ready-to-use semantic model examples in the `examples/` directory, featuring a comprehensive TPC-DS retail model and a minimal flights dataset that demonstrate the full OSSIE Core Metadata Specification.**

Apache OSSIE (Open Source Semantic Information Exchange) ships with complete, validated semantic model examples to help developers understand the specification structure. These examples live at the root of the repository under `examples/` and serve as reference implementations for building your own OSSIE-compliant metadata models.

## Locating the Official Example Directory

All Ossie semantic models examples are contained within the **`examples/`** directory at the repository root. According to the Apache OSSIE source code, this directory contains two primary reference models that illustrate different complexity levels and use cases.

The repository maintains these examples alongside the core specification documents, ensuring they remain synchronized with the latest schema definitions in [`core-spec/osi-schema.json`](https://github.com/apache/ossie/blob/main/core-spec/osi-schema.json).

## TPC-DS Retail Semantic Model

The **[`examples/tpcds_semantic_model.yaml`](https://github.com/apache/ossie/blob/main/examples/tpcds_semantic_model.yaml)** file provides a comprehensive, production-grade example based on the TPC-DS benchmark. This model demonstrates advanced OSSIE concepts including fact tables, dimension tables, complex relationships, and multi-dataset metrics.

Key constructs implemented in this example include:

- **Datasets with dialect-specific expressions** – Fields contain `expression` objects supporting multiple SQL dialects (e.g., `ANSI_SQL`)
- **Relationships** – The `relationships` section declares foreign-key linkages enabling graph navigation across datasets
- **Multi-dataset metrics** – Business KPIs defined at the model level with SQL expressions spanning multiple tables
- **Custom vendor extensions** – Includes `custom_extensions` for Salesforce and DBT, demonstrating how to embed vendor-specific metadata while maintaining spec compliance

This file validates against the OSSIE JSON schema and follows the top-level container structure requiring a `version` field and `semantic_model` list.

## Flights Semantic Model

For quick experiments and minimal implementations, the **[`examples/flights.yaml`](https://github.com/apache/ossie/blob/main/examples/flights.yaml)** file offers a lightweight alternative. This example focuses on a single dataset with simple relationships and basic metric definitions.

The flights model serves as an entry point for understanding:
- Basic dataset definition syntax
- Simple relationship declarations
- Fundamental metric definitions without cross-dataset complexity

Use this example when prototyping new tools or testing validation pipelines against a smaller surface area.

## Validating Semantic Models

The repository includes **[`validation/validate.py`](https://github.com/apache/ossie/blob/main/validation/validate.py)**, a CLI tool that validates YAML models against the JSON schema and performs semantic checks. You can validate the examples using either Python code or command-line invocation.

Using the Python validation wrapper:

```python
import yaml
from ossie.validation import validate_semantic_model  # wrapper around validation.validate.py

# Load the TPC-DS example

with open("examples/tpcds_semantic_model.yaml", "r") as f:
    model_yaml = yaml.safe_load(f)

# Validate against the schema

errors = validate_semantic_model(model_yaml)
if errors:
    print("Validation errors:", errors)
else:
    print("Semantic model is valid!")

```

Using the command-line validator:

```bash
python validation/validate.py examples/tpcds_semantic_model.yaml

```

Both approaches invoke the same internal validation logic, confirming compliance with the OSSIE JSON schema and versioning rules defined in [`core-spec/spec.md`](https://github.com/apache/ossie/blob/main/core-spec/spec.md).

## Core Specification Reference

To understand the formal structure demonstrated in the examples, reference these key files:

- **[`core-spec/spec.md`](https://github.com/apache/ossie/blob/main/core-spec/spec.md)** – The human-readable OSSIE Core Specification defining the YAML structure, dataset properties, and relationship semantics
- **[`core-spec/osi-schema.json`](https://github.com/apache/ossie/blob/main/core-spec/osi-schema.json)** – The JSON Schema used for automated validation of semantic models
- **[`validation/validate.py`](https://github.com/apache/ossie/blob/main/validation/validate.py)** – The CLI validation tool implementing semantic checks beyond schema validation

These files work together to define the contract that all Ossie semantic models examples must satisfy.

## Summary

- Ossie semantic models examples are located in the `examples/` directory of the Apache OSSIE repository
- **[`examples/tpcds_semantic_model.yaml`](https://github.com/apache/ossie/blob/main/examples/tpcds_semantic_model.yaml)** provides a comprehensive reference with fact tables, dimensions, and vendor extensions
- **[`examples/flights.yaml`](https://github.com/apache/ossie/blob/main/examples/flights.yaml)** offers a minimal dataset for quick prototyping and testing
- Use **[`validation/validate.py`](https://github.com/apache/ossie/blob/main/validation/validate.py)** or the Python `validate_semantic_model` function to check model compliance
- All examples conform to the structure defined in **[`core-spec/spec.md`](https://github.com/apache/ossie/blob/main/core-spec/spec.md)** and validate against **[`core-spec/osi-schema.json`](https://github.com/apache/ossie/blob/main/core-spec/osi-schema.json)**

## Frequently Asked Questions

### Where are Ossie semantic model examples located?

The examples reside in the `examples/` directory at the root of the Apache OSSIE repository. The primary files are [`examples/tpcds_semantic_model.yaml`](https://github.com/apache/ossie/blob/main/examples/tpcds_semantic_model.yaml) for comprehensive reference and [`examples/flights.yaml`](https://github.com/apache/ossie/blob/main/examples/flights.yaml) for minimal testing scenarios.

### How do I validate an Ossie semantic model?

You can validate models using the [`validation/validate.py`](https://github.com/apache/ossie/blob/main/validation/validate.py) CLI tool by running `python validation/validate.py <model-file.yaml>`, or programmatically using the `ossie.validation.validate_semantic_model()` Python function. Both methods check compliance against [`core-spec/osi-schema.json`](https://github.com/apache/ossie/blob/main/core-spec/osi-schema.json).

### What is the difference between the TPC-DS and Flights examples?

The TPC-DS example ([`tpcds_semantic_model.yaml`](https://github.com/apache/ossie/blob/main/tpcds_semantic_model.yaml)) is a comprehensive model demonstrating fact tables, dimension relationships, multi-dataset metrics, and vendor extensions. The Flights example ([`flights.yaml`](https://github.com/apache/ossie/blob/main/flights.yaml)) is a minimal single-dataset model designed for quick experiments and basic validation testing.

### How do custom extensions work in Ossie models?

Custom extensions allow embedding vendor-specific metadata while maintaining spec compliance. As shown in [`examples/tpcds_semantic_model.yaml`](https://github.com/apache/ossie/blob/main/examples/tpcds_semantic_model.yaml), you can include `custom_extensions` fields for platforms like Salesforce and DBT. These extensions are validated against the base schema while preserving platform-specific configuration data.