Schemas and Types in Cypher

Obviously, we’ve barely touched upon the full power of Cypher for building and querying graph stores and its special capabilities to query over paths within the graph. But what about the data models that can be supported in property graphs? Well, Cypher provides some strong data management facilities—schemas and data typing.

Schemas

One aspect that we haven’t discussed yet is schemas. Cypher includes support for managing both indexes and constraints over labels, which together constitute a property graph schema.

Indexes

Indexes (both simple and composite) are used for expediting query lookup. For nodes with a given label, an index can be created on a single property (simple) or a number of properties (composite). ...

Get Exploring Graphs with Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.