# Robotics

TypeDB’s ability to model complexity is extremely useful in robotics, where worlds, datasets and interactions can be extremely heterogenous.

The [TypeDB Robotics](https://github.com/typedb-osi/typedb-robotics) open-source example shows how to use TypeDB for robotic navigation of the world. It is based on a real-world usage developed by Joris Sijs at the TNO University.

## [](#_installation)Installation

The robotics example is released as a schema and data file (note: good for small or medium-sized examples, but not recommended for large datasets!). You can easily load the latest schema and dataset, either using TypeDB Cloud to create a server with the dataset preloaded, or using TypeDB Console:

```bash
typdb console --username=<USERNAME> --address=<ADDRESS> --command="database create-init robotics http://github.com/typedb-osi/typedb-robotics/releases/latest/download/schema_floorplan.tql http://github.com/typedb-osi/typedb-robotics/releases/latest/download/data_floorplan_assignment.tql"
```

## [](#_schema)Schema

This schema models a physical and mathematical domain, defining concepts ranging from physical objects and their spatial relationships to abstract mathematical constructs. The schema serves as a knowledge graph for describing, locating, and analyzing the components of a given environment, such as a building or a room. It is designed to be highly extensible and hierarchical, using abstract types to create a flexible and powerful model.

### [](#_core_concepts)Core Concepts

**Key Entities**

The schema is built around two primary, top-level abstractions:

*   physical\_entity: Represents anything that exists in the real world. This is the root for all concrete, tangible things. It owns attributes for existence, name, and id.
    
    *   being: A living or artificial entity, like a human or a robot.
        
    *   space: An open or closed area, such as a room or an open\_space.
        
    *   artifact: A manufactured item. This is further divided into stationary\_artifact (like a building or wall) and constituent\_artifact (like furniture or toys).
        
    
*   abstract\_entity: Represents non-physical concepts, typically for defining and describing physical entities.
    
    *   mathematical: Defines abstract shapes (shape), lines (line), and points (point), which can be used to model the physical world. For example, a room can have the shape of a box.
        
    *   measure: Represents quantifiable features, like distance or height. These concepts are used to describe the properties of physical entities.
        
    *   time: A simple entity to capture datetime values.
        
    

**Key Relationships**

The schema’s true power lies in its relations, which define how these concepts connect to each other. They are also categorized into mathematics and physics to reflect their purpose.

*   featuring: A fundamental relation that links a subject (a physical entity) to a feature (an abstract measure). This allows you to say, for example, a human has a height.
    
*   locating: A physical\_entity is located in a space. This is a core relation for modeling the position of objects and beings within an environment.
    
*   taking\_form: A mathematical concept is used to describe the form of a physical entity. For instance, a room is enclosed by a box, and a wall has the form of a rectangle.
    
*   positioning: Defines the precise spatial relationship between two points using attributes like lin\_x and rot\_x to represent coordinates and rotation.
    
*   composing: Defines a hierarchical structure, such as a building being composed of multiple rooms (volume) and walls (partition).
    

**Key Attributes**

The schema includes a rich set of attributes to describe entities and relations.

*   Existence: The exists and not\_exists attributes, which are sub-types of the abstract existance, are used to model the current state of a physical\_entity. This is useful for tracking things that may be created or destroyed.
    
*   Quantifiables: The schema has a comprehensive hierarchy of quantifiable attributes, ranging from continuous values like distance to categorical ones like color\_name. This allows for highly detailed and specific data representation.
    

## [](#_dataset)Dataset

This example ships with a sample dataset containing physical entities, spaces, artifacts, mathematical constructs, and spatial relationships. Feel free to play around and explore!

[Use Cases](../index.md) [IAM](../iam/index.md)

[Edit on GitHub](https://github.com/typedb/typedb-docs/edit/3.x-development/use-cases/modules/ROOT/pages/robotics.adoc) Edit this page on GitHub.