Skip to main content

Introduction

At the heart of OctoMesh lies the concept of Construction Kits. These kits serve as a fundamental building block for defining object models and providing the essential context that transforms data into actionable insights. With OctoMesh, you can construct models that align with your specific needs, allowing you to shape data in ways that make sense for your organization.

Key Features

  • Construction Kits: Construction Kits are the cornerstone of OctoMesh. They enable you to describe object models by specifying how data should be structured and organized. These kits act as blueprints, guiding the transformation process and ensuring that your data aligns with your goals and requirements.
  • Contextual Transformation: OctoMesh goes beyond simple data manipulation; it's all about context. By using Construction Kits, you can provide the necessary context to your data, making it far more informative and actionable. This contextualization is key to deriving valuable insights from your data.
  • Validation: Ensuring data integrity is critical. OctoMesh includes a robust Construction Kit Compiler that rigorously validates your defined models. This validation process helps catch errors early in the development phase, preventing costly mistakes downstream.
  • Dependency Resolution: Managing dependencies is a breeze with OctoMesh. The built-in compiler resolves dependencies efficiently, simplifying the integration of your models into the transformation process.

Construction Kit Libraries

Construction Kit Libraries are specialized libraries designed to define necessary data model types for specific use cases. These libraries serve as a foundational tool for Data Owners, streamlining the creation and management of complex data structures tailored to particular applications.

Each Construction Kit Library may have dependencies to other Libraries, but muss have at least a dependency to the Construction Kit Library System. This System Library provides the essential elements that all other construction kits build upon. It establishes the fundamental types, attributes and association roles that are common across various applications, ensuring consistency and interoperability among derived libraries.

meshmakers is delivering common Construction Kit Libraries for diverse industries using GitHub, see here.

This hierarchical and modular approach allows for significant flexibility and efficiency in developing and maintaining data models. By standardizing the core aspects of data handling and allowing for specific customizations, Construction Kit Libraries play a crucial role in facilitating robust and scalable application development. They not only speed up the development process but also enhance the quality and reliability of the software products.

Elements of a Construction Kit Library

Construction Kit Libraries are described using YAML files. Typically, each element type is in a separate folder. See here to get started creating Libraries..

Construction Kit Library Scheme

Enums

In the context of Construction Kit Libraries, enums (short for enumerations) play a critical role in defining a clear, efficient, and standardized set of values that can be used within data models. Enums are particularly useful for establishing a set of predefined constants, which can represent various states, types, or configurations within the library's data modeling framework. Here's a detailed look at how enums might be utilized within a Construction Kit Library:

  1. Standardization: Enums help standardize the values that can be assigned to certain fields in data models. For example, if a Construction Kit Library is used for managing a digital library system, an enum could define categories such as FICTION, NONFICTION, REFERENCE, MAGAZINE, ensuring consistent categorization across the database.
  2. Code Clarity and Safety: Using enums improves code readability and maintenance because it restricts the values that can be set, reducing errors from invalid inputs. For instance, a construction kit for a shipping application might use an enum to represent the status of an order, such as PENDING, SHIPPED, DELIVERED, RETURNED. This makes the code less prone to mistakes and easier to understand.
  3. Interoperability: Enums defined in a base Construction Kit Library System can be inherited or extended by other libraries in the hierarchy, ensuring that there is a common understanding of specific values across multiple systems or applications that might be using different construction kits from the same family.
  4. Efficiency: Enums are generally more memory-efficient than other types of constants in programming languages like Java or C#, because they are typically implemented as integers under the hood. This efficiency is critical in large-scale applications where performance is a key concern.
  5. Integration with Other Features: Enums can easily integrate with other features of a Construction Kit Library, such as validation mechanisms or serialization/deserialization processes. For example, an enum can be automatically checked for validity by the library's runtime, ensuring that only allowable values are persisted in databases or transmitted over networks.

Enums are later on referenced at an attribute.

Example

$schema: https://schemas.meshmakers.cloud/construction-kit-elements.schema.json
enums:
- enumId: TypeOfTelephoneEnhanced
useFlags: false
values:
- key: 1
name: Office
- key: 2
name: OfficeMobile
- key: 3
name: Secretary
- key: 4
name: Substitute
- key: 5
name: Home
- key: 6
name: PrivateMobile

Attributes

This area describes attributes, with a system-wide unique id, description, metadata and value type. A value type may be scalar (string, int, double, boolean, enums), a scalar array type (StringArray, IntArray) or complex types.

The goal is here to make attributes unique in the system. That means an attribute "Name" for example has already context - it is a name of an item. Every type later should use this attribute if a type may get naming functionality.

Example of double attribute

$schema: https://schemas.meshmakers.cloud/construction-kit-elements.schema.json
attributes:
- id: Temperature
valueType: Double
metaData:
- key: Unit
value: "°C"
- key: Type
value: Current

Example of int attribute

$schema: https://schemas.meshmakers.cloud/construction-kit-elements.schema.json
attributes:
- id: AddressZipcode
valueType: Int
metaData:
- key: semanticId
value: "0173-1#02-AAO129#002"
description: "ZIP code of address"

Example of enum attribute

$schema: https://schemas.meshmakers.cloud/construction-kit-elements.schema.json
attributes:
- id: EMailTypeOfEmailAddress
valueType: Enum
valueCkEnumId: Basic/TypeOfTelephoneBasic
metaData:
- key: semanticId
value: "0173-1#02-AAO199#003"
description: "characterization of an e-mail address according to its location or usage"

Records

Records represents structured data entities containing various attributes, also called "Structs" in many programming languages. Each attribute holds data that describes some aspect of the entity. Records are designed to be flexible, allowing for easy data manipulation and interaction within the library.

A record is defined by specifying its attributes and their respective data types. Attributes can be of any data type supported by the library, including basic data types (like integers and strings) and more complex types (like lists or other records).

Example

$schema: https://schemas.meshmakers.cloud/construction-kit-elements.schema.json
records:
- recordId: EMail
attributes:
- id: ${thisModel}/EMailAddress
name: EMail
- id: ${thisModel}/EMailPublicKey
name: PublicKey
isOptional: true
- id: ${thisModel}/EMailTypeOfEmailAddress
name: TypeOfEMail
isOptional: true
- id: ${thisModel}/EMailTypeOfPublicKey
name: TypeOfPublicKey
isOptional: true

AssociationRoles

In the context of data modeling, particularly in software development and database design, "association roles" describe the relationships between different entities or types. These roles are crucial for defining how instances of one type relate to instances of another, determining how they interact within the application or system. Here’s a detailed explanation of association roles, including types of associations, their names, multiplicities, and the concept of inbound and outbound navigation names:

Association roles define the relationship between two or more types in a system. Each role in an association describes how an entity behaves and interacts with another entity. Associations are characterized by their name, the type of relationship, and their multiplicity, which describes how many instances of one type relate to instances of another type.

Types of Associations

  1. One-to-One: Each instance of one type associates with one and only one instance of another type. For example, a User and a UserProfile.
  2. One-to-Many: One instance of a type is associated with multiple instances of another type. For example, a Teacher can have multiple Students.
  3. Many-to-One: Multiple instances of a type associate with a single instance of another type. This is often the reverse perspective of a One-to-Many association.
  4. Many-to-Many: Instances of one type can have relationships with multiple instances of another type, and vice versa. For example, a Student might be enrolled in multiple Courses, and each Course might have multiple Students.

Naming Associations

Associations are typically named to clearly reflect the nature of the relationship between the entities. For example:

  • A one-to-many relationship between Teacher and Student might be named Teaches.
  • A many-to-many relationship between Student and Course might be named Enrollment.

Multiplicity

Multiplicity defines the number of instances that can participate in the association from each side:

  • 1..1: Exactly one instance must participate.
  • 0..1: Zero or one instance can participate (optional relationship).
  • 1..N: At least one instance must participate, up to a maximum of N.
  • 0..N: Any number of instances can participate, including none.
  • N..M: Between N and M instances must participate, inclusive.

Inbound and Outbound Names (Navigation Properties)

Navigation properties are used in object-oriented and relational mapping to navigate between associated types:

  • Inbound Name: This is the name used to navigate to an entity from the perspective of the related entity. For example, in a Teaches relationship, from Student to Teacher, the inbound name might be Instructor, indicating the teacher of the student.
  • Outbound Name: This is the name used to navigate from an entity to another associated entity. In the same example, the outbound name from Teacher to Student might be Students, indicating the students taught by the teacher.

These names are critical for understanding and navigating the model, especially in complex systems with many interrelated entities. They provide clarity and a semantic understanding of how entities are related, facilitating easier data access and manipulation in software applications.

Examples

$schema: https://schemas.meshmakers.cloud/construction-kit-elements.schema.json
associationRoles:
- id: RelatedEquipment
inboundName: RelatesTo
outboundName: RelatesFrom
inboundMultiplicity: N
outboundMultiplicity: N

Types

In the world of software design and architecture, Construction Kit Type Elements play a crucial role in modeling and structuring data in a systematic and scalable way. These elements allow for inheritance, definition of attributes, and establishment of associations, which are fundamental in creating robust and reusable software components. Here's an in-depth explanation of how these elements function within a construction kit:

  1. Inheritance: Inheritance allows a type (often called a subclass) to inherit properties and methods from another type (called a superclass), promoting reusability and the creation of generalized frameworks. This feature is crucial in construction kits as it facilitates the extension of base functionality without altering the original code base.
  2. Attributes: Attributes define the properties or characteristics of a type. In construction kits, attributes are specified with their data types, and possibly default values and validation rules, which describe what kind of data the attributes hold and how they should be processed.
  3. Associations: Associations describe the relationships between different types within the system. These relationships can be characterized by their cardinality (one-to-one, one-to-many, many-to-many) and navigability (which type knows about the other type in the relationship).

Examples

$schema: https://schemas.meshmakers.cloud/construction-kit-elements.schema.json
types:
- typeId: Photovoltaic.Module
derivedFromCkTypeId: Industry.Basic/Machine
attributes:
- id: ${thisModel}/PeakPower
name: PeakPower
- id: Industry.Basic/Power
name: Power
isOptional: true
associations:
- id: System/ParentChild
targetCkTypeId: Industry.Energy/Photovoltaic.String

Instances of Construction Kits

The collection of instances of Construction Kit types is called Runtime Model (RtModel). An instance of a type is called Runtime Entity (RtEntity).

Construction Kit to Runtime model Scheme

What's Next?