Namespaces

In Polypheny, namespaces play a significant role in the organization and structuring of data, serving as the backbone for defining logical schemas. Understanding namespaces is crucial for the effective use of Polypheny’s PolyDBMS. This document provides an in-depth overview of namespaces in Polypheny, explaining what they are, how they’re used, and the benefits they offer.

What are Namespaces?

Namespaces in Polypheny are essentially logical containers that segregate different data models within the logical schema of the PolyDBMS. Each namespace is identified by a unique name and corresponds to a specific data model.

When you define a schema, you’re defining it within a namespace, and this namespace determines the rules and semantics for that schema based on the corresponding data model. For instance, a namespace associated with a relational model will mandate strict schema rules, while a namespace related to a document model will allow a schema-less structure.

How are Namespaces Used?

Defining Namespaces

When setting up a logical schema in Polypheny, you start by defining the namespaces. Each namespace is allocated a unique name and is associated with a specific data model. This effectively segments your database into multiple logical spaces, each with its unique characteristics based on the underlying data model.

Creating Entities within Namespaces

Once a namespace is defined, entities (like tables, documents, or nodes, depending on the data model) can be created within the namespace. These entities adhere to the rules of the corresponding data model. For instance, if you’re working within a namespace associated with a relational model, you’d create tables with a fixed schema.

Referencing Namespaces in Queries

In Polypheny, namespaces also come into play when writing queries. When referencing an entity in a query, you must specify the namespace where that entity resides. This allows Polypheny to correctly interpret the query in the context of the corresponding data model.

Benefits of Namespaces

Using namespaces in Polypheny provides several key benefits:

  1. Organization: Namespaces allow for logical segmentation of your database according to different data models. This makes it easier to manage and structure your data based on its inherent characteristics.

  2. Flexibility: With each namespace corresponding to a different data model, you have the flexibility to choose the most appropriate data model for each portion of your data.

  3. Interoperability: Despite the separation of data models using namespaces, Polypheny allows cross-namespace queries. This means you can run a single query that joins data from entities residing in different namespaces.

  4. Simplicity: Namespaces simplify the user’s interaction with the data by abstracting away the complexity of managing different data models. A user interacts with the data in a way consistent with the logical schema, oblivious of the complexities underneath.

In conclusion, namespaces are a powerful concept in Polypheny that support a high degree of flexibility, enabling the effective organization and management of data across multiple data models, while providing a simplified and consistent interface to users. Understanding namespaces is key to leveraging the full potential of Polypheny’s multi-model database capabilities.

© Polypheny GmbH. All Rights Reserved.