Semogram Docs
OntologyDefine the model

Classes, properties and relationships

Model business meaning independently of record storage

A definition is a versioned set of model files. It gives a project a vocabulary shared by source mappings, read bindings, assertions and queries. It describes types; it does not populate instances.

The model's building blocks

Building blockMeaningExample
ClassA category of entityOrder or Customer
Datatype propertyA value on an entityAn Order's decimal total
Object property / relationshipA directed link to another entityOrder placedBy Customer
DomainThe class the property describestotal belongs to Order
RangeThe value datatype or target classtotal is decimal; placedBy targets Customer
ShapeA constraint on recordsEvery Order must have one order ID

The domain/range describe semantics. Cardinality and required-value constraints belong in shapes and validation. A model label such as “Order total” is display text; its IRI is the stable identifier used by compiled terms.

A complete small model

Create project Ontology → Definitions → New definition, name operations-demo, namespace https://example.com/operations#, model entrypoint model.ttl, no shape entrypoints and no imports. Use a project where this namespace is available. You need a Semogram account with workspace/project access and definition authoring permissions.

Use the authoring assistant or supported file/model editor. Put the Turtle below in model.ttl. Review the manifest and validation, then save and inspect the active definition and project graph.

Define Order and Customer with the exact namespace and Turtle on this page. Explain the domain and range of each property. Show model validation and the proposed manifest before saving. Do not create records, endpoints or bindings.
@prefix ex: <https://example.com/operations#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:Order a owl:Class ; rdfs:label "Order" .
ex:Customer a owl:Class ; rdfs:label "Customer" .
ex:orderId a owl:DatatypeProperty ; rdfs:domain ex:Order ; rdfs:range xsd:string .
ex:status a owl:DatatypeProperty ; rdfs:domain ex:Order ; rdfs:range xsd:string .
ex:total a owl:DatatypeProperty ; rdfs:domain ex:Order ; rdfs:range xsd:decimal .
ex:delivered a owl:DatatypeProperty ; rdfs:domain ex:Order ; rdfs:range xsd:boolean .
ex:isOpen a owl:DatatypeProperty ; rdfs:domain ex:Order ; rdfs:range xsd:boolean .
ex:customerName a owl:DatatypeProperty ; rdfs:domain ex:Customer ; rdfs:range xsd:string .
ex:placedBy a owl:ObjectProperty ; rdfs:domain ex:Order ; rdfs:range ex:Customer .

Download the model or complete definition create body. HTTP creation uses POST /api/v1/projects/<PROJECT_UUID>/ontology/definitions (ontologies:write, Idempotency-Key) with manifest/files. MCP ontology_create accepts the same manifest/files plus idempotencyKey; the authenticated project supplies scope. Your first model shows exact requests.

Distinguish three names

status is a source column. https://example.com/operations#status is a model property. status in a query output is a field chosen for consumers. A binding or mapping connects the first two; the query maps the model property to its output field. These names can differ without changing the model's meaning.

An Order instance uses an entity ID such as https://example.com/orders/1. That is different from the Order class IRI. Use stable IDs across live reads, materializations and assertions if they are meant to describe the same entity.

Inspect the result

The definition's model/schema and graph should show two classes, the declared datatype properties and the directed placedBy relationship. Inspect the compiled term identifiers and version. Zero returned orders is expected until you configure data access or store facts. No automatic matching of similarly named columns is implied by saving this definition.