A logical schema is an abstract, implementation-independent blueprint for a graph database that defines the entity types (nodes/vertices), relationship types (edges), their attributes (properties), and the constraints governing their connections. It focuses on the conceptual structure and semantic meaning of the data, independent of storage details, query languages, or physical performance considerations. This layer is analogous to an Entity-Relationship (ER) diagram in relational modeling, serving as the authoritative contract between data architects and engineers.
Glossary
Logical Schema

What is Logical Schema?
A logical schema is an abstract, implementation-independent representation of a graph data model that defines the entity types, relationship types, attributes, and constraints, focusing on the structure and meaning of the data.
In practice, a logical schema for a property graph specifies vertex labels, edge labels, property keys with data types, and constraints like uniqueness or cardinality. For an RDF-based knowledge graph, it is defined using ontologies in languages like RDF Schema (RDFS) or OWL. This schema acts as the foundation for data integration, ensuring consistency, enabling semantic reasoning, and guiding the creation of the underlying physical schema in a specific database system like Neo4j or a triplestore.
Core Components of a Logical Schema
A logical schema is an abstract, implementation-independent data model. It defines the core structural and semantic components that govern how information is organized and related within a graph.
Entity Types (Classes)
Entity types, often called classes or vertex types, define the categories of real-world objects or concepts represented in the graph. They are the fundamental building blocks, analogous to tables in a relational model.
- Examples:
Person,Product,Organization,Event. - In RDF/OWL, classes are defined using
rdfs:Classorowl:Class. - In a property graph, they are typically implemented as vertex labels.
- A well-defined set of entity types establishes the core vocabulary of the domain.
Relationship Types (Properties/Edges)
Relationship types define the permissible connections between entity types. They capture the semantics of how entities are associated.
- In RDF, these are properties (predicates) like
foaf:knowsorschema:worksFor. - In a property graph, these are edge types or relationship labels like
PURCHASEDorREPORTS_TO. - They have a domain (source entity type) and a range (target entity type).
- Defining relationship types explicitly encodes the business logic and knowledge of the domain into the graph's structure.
Attributes & Data Types
Attributes are the descriptive properties assigned to entities or relationships. The logical schema defines the allowed attributes and their data types for each entity or relationship type.
- Examples: A
Personentity type may have attributesname(string),birthDate(date), andemployeeId(integer). - In a property graph, these are property keys.
- In RDF, literals (strings, numbers, dates) are attached to subjects via properties.
- Specifying data types (e.g.,
xsd:string,xsd:dateTime) ensures data quality and enables correct query operations.
Hierarchies & Inheritance
Logical schemas often define taxonomies through inheritance hierarchies, allowing for the organization and specialization of types.
- Subclassing (
rdfs:subClassOf,owl:SubClassOf): AnEmployeeis a subclass ofPerson. This implies that all constraints and properties ofPersonapply toEmployee. - Sub-properties (
rdfs:subPropertyOf):hasCEOcan be a sub-property ofhasEmployee, meaning every CEO connection is also an employee connection. - These hierarchies enable powerful inheritance-based reasoning and more concise, organized schema definitions.
Integrity Constraints
Constraints are rules that enforce data quality and business logic at the model level, ensuring the graph remains consistent and meaningful.
- Cardinality Constraints: Restrict the number of relationships. (e.g., a
Personcan have exactly onebiologicalMother). - Uniqueness Constraints: Ensure a property value is unique for all instances of a type (e.g.,
employeeId). - Domain/Range Constraints: Enforce that a relationship only connects specific entity types.
- Value Type & Pattern Constraints: Ensure a property value matches a regex pattern or is within a specific range.
- Tools like SHACL (Shapes Constraint Language) are explicitly designed for defining such constraints in RDF graphs.
Formal Axioms & Rules
In expressive logical schemas (ontologies), formal axioms define logical rules that enable automated inference of new facts.
- Inverse Properties: Declaring that
hasParentis the inverse ofhasChild. IfA hasParent Bis known, the system can inferB hasChild A. - Transitive Properties: Declaring
ancestorOfas transitive. IfA ancestorOf BandB ancestorOf C, the system infersA ancestorOf C. - Property Chains: Defining that
hasUncleis equivalent tohasParent ◦ hasBrother. - Disjointness: Declaring that
MaleandFemaleare disjoint classes (an individual cannot be both). - These axioms, defined using languages like OWL, transform a passive data structure into an active knowledge base.
How a Logical Schema Works in Practice
A logical schema translates abstract data modeling concepts into actionable rules for structuring and validating a knowledge graph.
In practice, a logical schema is implemented using a formal graph schema language or ontology. For property graphs, this involves defining vertex and edge types (labels), their allowed property keys with data types, and constraints like uniqueness or cardinality. In RDF-based systems, it is expressed using RDF Schema (RDFS) or the Web Ontology Language (OWL) to define classes, properties, and hierarchies. This implementation-independent blueprint ensures all data conforms to a consistent structure, enabling reliable querying and integration.
The schema is enforced during data operations. Schema validation tools, such as SHACL for RDF, check incoming data for compliance. During querying, the schema informs query optimizers and provides semantic context for semantic reasoning engines. Crucially, a logical schema supports schema evolution, allowing new types and properties to be added systematically without corrupting existing data, thereby maintaining the graph's integrity as business needs change.
Logical Schema vs. Physical Schema
This table compares the abstract, business-focused data model with its concrete, system-specific implementation in a graph database.
| Feature | Logical Schema | Physical Schema |
|---|---|---|
Primary Purpose | Defines the conceptual data model and business semantics. | Defines the storage, indexing, and access mechanisms for performance. |
Abstraction Level | High-level, implementation-independent. | Low-level, system-specific. |
Focus | What the data means and its structure (entities, relationships, constraints). | How the data is stored and retrieved (data structures, file formats, indexes). |
Audience | Data architects, domain experts, application developers. | Database administrators, system engineers, performance tuners. |
Defines | Entity types (vertex labels), relationship types (edge labels), property keys, data types, and constraints (uniqueness, cardinality). | Storage engines (e.g., native graph, relational), index types (B-tree, full-text), partitioning strategies (sharding), and data file layouts. |
Technology Dependence | Largely independent of the specific graph database (Neo4j, Amazon Neptune, JanusGraph). | Highly dependent on the capabilities and architecture of the chosen graph database system. |
Change Management | Evolved based on business requirements (schema evolution). | Evolved based on performance, scalability, and hardware considerations. |
Example Artifacts | UML diagrams, OWL ontologies, RDFS vocabularies, Cypher/GQL | Configuration files for index creation, shard keys, memory allocation, and storage path directives. |
Logical Schema Examples
A logical schema defines the blueprint for a graph's structure. These examples illustrate common patterns used to model real-world domains, focusing on entity types, relationships, and constraints.
Social Network Schema
Models user interactions and content. Core entity types include Person and Post. Key relationship types are FOLLOWS (between Person nodes), LIKES (Person→Post), and AUTHORED (Person→Post).
- Constraints: A uniqueness constraint on
Person.userId. - Property Examples:
Personnodes have properties likename,joinedDate.FOLLOWSedges can have asincetimestamp property. - Cardinality: A
Postcan have only oneAUTHOR(one-to-many from Person to Post).
Product Recommendation Schema
Connects customers, products, and behaviors for personalized suggestions. Central entity types are Customer, Product, and Category.
- Relationship Semantics:
PURCHASED(Customer→Product),VIEWED(Customer→Product),BELONGS_TO(Product→Category). - Key Properties:
Productnodes includesku,price,brand.PURCHASEDedges storequantityandpurchaseDate. - Inference Path: A recommendation can be generated by traversing
Customer-PURCHASED->Product-BELONGS_TO->Category<-BELONGS_TO-OtherProduct.
Enterprise IT Asset Management
Tracks hardware, software, and dependencies. Core entities include Server, Application, Database, and Employee.
- Dependency Modeling:
HOSTS(Server→Application),DEPENDS_ON(Application→Database),OWNS(Employee→Server). - Critical for Impact Analysis: A schema like this enables rapid traversal to answer "Which applications are affected if this server fails?"
- Property Examples:
Servernodes havehostname,ipAddress,osVersion.DEPENDS_ONedges may have aconnectionStringproperty.
Biomedical Knowledge Graph
Integrates biological entities for research. Standard entity types are Gene, Protein, Disease, and Drug.
- Semantic Relationships:
ENCODES(Gene→Protein),ASSOCIATED_WITH(Gene→Disease),TREATS(Drug→Disease),INTERACTS_WITH(Protein→Protein). - Uses Rich Ontologies: Often aligns with public ontologies like the Gene Ontology (GO) or Disease Ontology (DOID) for standardized typing.
- Enables Discovery: Paths like
Drug-TREATS->Disease<-ASSOCIATED_WITH->Genehelp identify novel drug targets.
Financial Fraud Detection
Models transactions, accounts, and parties to identify suspicious patterns. Key entities are Account, Transaction, Person, and Merchant.
- Money Flow Tracking:
SENT(Account→Transaction),RECEIVED(Transaction→Account),OWNS(Person→Account). - Temporal Properties:
Transactionnodes haveamount,currency,timestamp.OWNSedges have avalidFrom/validTofor temporal history. - Analytics Foundation: This schema supports graph algorithms like community detection to find clusters of colluding accounts.
Content Management & Taxonomy
Organizes digital assets with rich metadata. Core entities are Article, Author, Tag, and Category.
- Hierarchical & Tagging Relations:
WROTE(Author→Article),HAS_TAG(Article→Tag),SUBCATEGORY_OF(Category→Category). - Flexible Tagging:
Tagnodes allow for a folksonomy (user-generated categorization) alongside the formalCategoryhierarchy. - Query Patterns: Enables faceted search via queries like "Find all Articles by Author X that have Tag Y within Category Z."
Frequently Asked Questions
A logical schema is the abstract blueprint for a graph database, defining its structure and meaning independent of any specific software implementation. This FAQ addresses common questions about its purpose, components, and relationship to other data modeling concepts.
A logical schema is an abstract, implementation-independent representation of a graph data model that defines the entity types, relationship types, attributes, and constraints, focusing on the structure and meaning of the data. It serves as a conceptual blueprint, analogous to an Entity-Relationship (ER) diagram in relational design, specifying what the data is without dictating how it is stored. For a property graph, this includes defining vertex labels (e.g., Person, Product), edge labels (e.g., PURCHASED, WORKS_FOR), property keys with data types, and rules like uniqueness or cardinality constraints. For an RDF-based knowledge graph, it is defined using an ontology in languages like RDFS or OWL, specifying classes, properties, and their hierarchies. The logical schema is a critical layer for ensuring data consistency, enabling semantic integration, and providing a stable interface for applications as the underlying physical schema evolves.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
A logical schema defines the abstract blueprint for a graph. These related concepts detail its components, implementation languages, and operational counterparts.
Physical Schema
The physical schema is the concrete, implementation-specific realization of a logical schema. It defines how the abstract data model is physically stored and accessed on disk or in memory.
- Key Details: Specifies file formats, indexing strategies (e.g., B-trees, LSM-trees), partitioning schemes, and data encoding.
- Relationship to Logical Schema: A single logical schema can be implemented by multiple physical schemas across different database systems (e.g., Neo4j vs. Amazon Neptune).
- Performance Impact: Choices in the physical schema directly determine query latency, storage efficiency, and scalability.
Graph Schema Language
A graph schema language is a formal syntax used to declaratively define the structure and constraints of a logical schema.
- Purpose: Provides a machine-readable and often human-writable specification for vertex types, edge types, property keys, and data constraints.
- Examples:
- Cypher's
CREATE CONSTRAINT: Used in property graphs (e.g.,CREATE CONSTRAINT FOR (p:Person) REQUIRE p.id IS UNIQUE). - PGQL's Schema Definition Language: A standard for the Property Graph Query Language (GQL).
- Apache TinkerPop's Gremlin Type Definitions: For defining schema in JanusGraph or other TinkerPop-enabled systems.
- Cypher's
- Advantage: Enables schema validation, automated documentation, and tool-assisted data modeling.
RDF Schema (RDFS)
RDF Schema (RDFS) is a foundational semantic extension of the Resource Description Framework (RDF) used to define lightweight ontologies, serving as a logical schema for RDF triplestores.
- Core Constructs: Provides basic vocabulary (e.g.,
rdfs:Class,rdfs:subClassOf,rdfs:domain,rdfs:range) for organizing entities and properties into taxonomies. - Function: It defines classes of resources and the properties (predicates) that can be applied to them, establishing a type system for RDF data.
- Inference Enablement: RDFS axioms allow for basic semantic reasoning, such as inferring that an instance of a subclass is also an instance of its superclass.
- Contrast with Property Graphs: While a property graph's logical schema defines labels and property keys, RDFS defines classes and properties with formal inheritance semantics.
SHACL (Shapes Constraint Language)
SHACL is a W3C standard for validating RDF graphs against a set of conditions, effectively defining a rigorous, constraint-based logical schema.
- Primary Role: Schema validation. SHACL shapes define the expected structure, data types, value ranges, and cardinality for nodes in an RDF graph.
- Key Features:
- Property Constraints: Mandate the presence, datatype, and allowed values of properties.
- Logical Constraints: Support
AND,OR,NOToperations. - Closed-World Assumption: Can declare that only specified properties are allowed on a node.
- Analogy: For RDF, SHACL serves a similar purpose to the combination of a relational CREATE TABLE statement and CHECK constraints, ensuring data quality and integrity.
Schema Mapping
Schema mapping is the process of defining transformation rules that align elements of a source data schema (e.g., relational, JSON) with the target logical schema of a knowledge graph.
- Core Activity: Creating correspondences between source fields/columns and target graph entities, relationships, and properties.
- Techniques:
- Direct Mapping: A field
customer_namemaps to anameproperty on aCustomervertex. - Complex Transformation: A join between
OrdersandProductstables maps to aPURCHASEDedge betweenPersonandProductvertices. - Value Transformation: Converting string status codes to enumerated property values.
- Direct Mapping: A field
- Tools: Often implemented using ETL/ELT tools (e.g., Apache NiFi, custom Spark jobs) or dedicated semantic integration frameworks. It is the critical bridge between raw data and a populated graph adhering to its logical schema.
Schema Evolution
Schema evolution encompasses the strategies and processes for modifying a graph's logical schema over time without causing system failures or data corruption.
- Challenge: Applications and queries depend on a stable schema, but business requirements change, necessitating updates.
- Common Operations:
- Additive Changes: Introducing new vertex/edge types or optional properties (generally safe).
- Destructive Changes: Renaming or removing types, or making optional properties required (risky, requires data migration).
- Refactoring Changes: Splitting a vertex type into more specialized subtypes.
- Best Practices:
- Use versioned schemas to track changes.
- Implement backward compatibility where possible.
- Employ gradual rollout and data migration scripts for breaking changes.
- Update associated indexes and constraints in tandem.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us