>_TheQuery
← Glossary

Ontology

Knowledge Graphs

A formal specification of concepts, categories, and relationships within a domain that defines what types of entities exist and how they can relate to each other.

An ontology is a formal, explicit specification of the concepts and relationships that can exist within a particular domain of knowledge. It defines the vocabulary of entity types (Person, Company, Product), relationship types (WORKS_FOR, OWNS, PRODUCES), and constraints (a Person can WORKS_FOR a Company, but not vice versa) that structure a knowledge graph.

Ontologies serve as the schema or blueprint for knowledge graphs, similar to how a database schema defines tables and foreign keys in relational databases. However, ontologies are typically richer and more expressive, supporting inheritance hierarchies (Employee is a subtype of Person), cardinality constraints (a Person can work for multiple Companies), and domain-range restrictions (the MANAGES relationship connects Person to Person).

In the semantic web ecosystem, ontologies are expressed using standards like OWL (Web Ontology Language) and queried with SPARQL. In property graph databases like Neo4j, ontologies are more informal but equally important for maintaining data quality. A well-designed ontology ensures that knowledge graph construction produces consistent, queryable, and maintainable graphs.

Last updated: February 22, 2026