Skip to content

Base Data Models

mosaicolabs.models.data.base_types

This module provides specialized wrapper classes for standard Python primitive types, including Integers, Floating-point numbers, Booleans, and Strings.

In the Mosaico ecosystem, raw primitives cannot be transmitted directly because the platform requires structured metadata and explicit serialization schemas. These wrappers elevate basic data types to "first-class citizens" of the messaging system by inheriting from Serializable and HeaderMixin.

Key Features: * Standardized Metadata: Every wrapped value includes a standard Header, enabling full traceability and temporal context (timestamps) for even the simplest data points. * Explicit Serialization: Each class defines a precise pyarrow.StructType schema, ensuring consistent bit-width (e.g., 8-bit vs 64-bit) across the entire data platform. * Registry Integration: Wrapped types are automatically registered in the Mosaico ontology, allowing them to be used in platform-side Queries.

Integer8

Bases: Serializable, HeaderMixin

A wrapper for a signed 8-bit integer.

Attributes:

Name Type Description
data int

The underlying 8-bit integer value.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Integer8, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Integer8.Q.data.gt(123)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Integer8.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying integer value.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Integer8.Q.data Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, Integer8, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Integer8.Q.data.gt(-10)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Integer8.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

Integer16

Bases: Serializable, HeaderMixin

A wrapper for a signed 16-bit integer.

Attributes:

Name Type Description
data int

The underlying 16-bit integer value.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Integer16, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Integer16.Q.data.gt(123)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Integer16.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying integer value.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Integer16.Q.data Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, Integer16, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Integer16.Q.data.gt(-10)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Integer16.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

Integer32

Bases: Serializable, HeaderMixin

A wrapper for a signed 32-bit integer.

Attributes:

Name Type Description
data int

The underlying 32-bit integer value.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Integer32, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Integer32.Q.data.gt(123)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Integer32.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying integer value.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Integer32.Q.data Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, Integer32, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Integer32.Q.data.gt(-10)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Integer32.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

Integer64

Bases: Serializable, HeaderMixin

A wrapper for a signed 64-bit integer.

Attributes:

Name Type Description
data int

The underlying 64-bit integer value.

header Optional[Header]

An optional metadata header injected by HeaderMixin.ù

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Integer64, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Integer64.Q.data.gt(123)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Integer64.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying integer value.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Integer64.Q.data Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, Integer64, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Integer64.Q.data.gt(123)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Integer64.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

Unsigned8

Bases: Serializable, HeaderMixin

A wrapper for an unsigned 8-bit integer.

Attributes:

Name Type Description
data int

The underlying unsigned 8-bit integer value.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Raises:

Type Description
ValueError

If data is initialized with a negative value.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Unsigned8, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Unsigned8.Q.data.gt(123)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Unsigned8.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying unsigned integer value.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Unsigned8.Q.data Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, Unsigned8, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Unsigned8.Q.data.leq(253)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Unsigned8.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

model_post_init

model_post_init(context)

Validates that the input data is non-negative.

Raises:

Type Description
ValueError

If data < 0.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

Unsigned16

Bases: Serializable, HeaderMixin

A wrapper for an unsigned 16-bit integer.

Attributes:

Name Type Description
data int

The underlying unsigned 16-bit integer value.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Raises:

Type Description
ValueError

If data is initialized with a negative value.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Unsigned16, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Unsigned16.Q.data.gt(123)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Unsigned16.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying unsigned integer value.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Unsigned16.Q.data Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, Unsigned16, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Unsigned16.Q.data.eq(2)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Unsigned16.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

model_post_init

model_post_init(context)

Validates that the input data is non-negative.

Raises:

Type Description
ValueError

If data < 0.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

Unsigned32

Bases: Serializable, HeaderMixin

A wrapper for an unsigned 32-bit integer.

Attributes:

Name Type Description
data int

The underlying unsigned 32-bit integer value.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Raises:

Type Description
ValueError

If data is initialized with a negative value.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Unsigned32, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Unsigned32.Q.data.gt(123)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Unsigned32.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying unsigned integer value.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Unsigned32.Q.data Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, Unsigned32, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Unsigned32.Q.data.gt(123)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Unsigned32.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

model_post_init

model_post_init(context)

Validates that the input data is non-negative.

Raises:

Type Description
ValueError

If data < 0.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

Unsigned64

Bases: Serializable, HeaderMixin

A wrapper for an unsigned 64-bit integer.

Attributes:

Name Type Description
data int

The underlying unsigned 64-bit integer value.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Raises:

Type Description
ValueError

If data is initialized with a negative value.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Unsigned64, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Unsigned64.Q.data.gt(123)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Unsigned64.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying unsigned integer value.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Unsigned64.Q.data Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, Unsigned64, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Unsigned64.Q.data.gt(123)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Unsigned64.Q.data.gt(123), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

model_post_init

model_post_init(context)

Validates that the input data is non-negative.

Raises:

Type Description
ValueError

If data < 0.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

Floating16

Bases: Serializable, HeaderMixin

A wrapper for a 16-bit single-precision floating-point number.

Attributes:

Name Type Description
data float

The underlying single-precision float.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Floating16, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Floating16.Q.data.gt(123.45)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Floating16.Q.data.gt(123.45), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying single-precision float.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Floating16.Q.data Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, Floating16, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Floating16.Q.data.leq(123.4)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Floating16.Q.data.gt(123.45), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

Floating32

Bases: Serializable, HeaderMixin

A wrapper for a 32-bit single-precision floating-point number.

Attributes:

Name Type Description
data float

The underlying single-precision float.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Floating32, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Floating32.Q.data.gt(123.45)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Floating32.Q.data.gt(123.45), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying single-precision float.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Floating32.Q.data Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, Floating32, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Floating32.Q.data.leq(123.4)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Floating32.Q.data.gt(123.45), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

Floating64

Bases: Serializable, HeaderMixin

A wrapper for a 64-bit single-precision floating-point number.

Attributes:

Name Type Description
data float

The underlying single-precision float.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Floating64, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Floating64.Q.data.gt(123.45)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Floating64.Q.data.gt(123.45), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying single-precision float.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Floating64.Q.data Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, Floating64, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Floating64.Q.data.leq(123.4)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Floating64.Q.data.gt(123.45), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

Boolean

Bases: Serializable, HeaderMixin

A wrapper for a standard boolean value.

Attributes:

Name Type Description
data bool

The underlying boolean value.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, Boolean, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Boolean.Q.data.eq(True)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Boolean.Q.data.eq(True), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying boolean value.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
Boolean.Q.data Bool .eq()
Example
from mosaicolabs import MosaicoClient, Boolean, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(Boolean.Q.data.eq(True)))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(Boolean.Q.data.eq(True), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

String

Bases: Serializable, HeaderMixin

A wrapper for a standard UTF-8 encoded string.

Attributes:

Name Type Description
data str

The underlying string data.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, String, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(String.Q.data.eq("hello")))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(String.Q.data.eq("hello"), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying string data.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
String.Q.data String .eq(), .neq(), .match(), .in_()
Example
from mosaicolabs import MosaicoClient, String, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for strings containing a specific log pattern
    qresponse = client.query(QueryOntologyCatalog(String.Q.data.match("[ERR]")))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(String.Q.data.eq("hello"), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

LargeString

Bases: Serializable, HeaderMixin

A wrapper for a Large UTF-8 encoded string.

Use this class when string data is expected to exceed 2GB in size, necessitating the use of 64-bit offsets in the underlying PyArrow implementation.

Attributes:

Name Type Description
data str

The underlying large string data.

header Optional[Header]

An optional metadata header injected by HeaderMixin.

Querying with the .Q Proxy

The fields of this class are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, LargeString, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value
    qresponse = client.query(QueryOntologyCatalog(LargeString.Q.data.eq("hello")))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(LargeString.Q.data.eq("hello"), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

data instance-attribute

data

The underlying large string data.

Querying with the .Q Proxy

This field is queryable when constructing a QueryOntologyCatalog via the .Q proxy.

Field Access Path Queryable Type Supported Operators
LargeString.Q.data String .eq(), .neq(), .match(), .in_()
Example
from mosaicolabs import MosaicoClient, LargeString, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for large strings containing a specific log pattern
    qresponse = client.query(QueryOntologyCatalog(LargeString.Q.data.match("CRITICAL_ERR_")))

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific data value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(LargeString.Q.data.eq("hello"), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

mosaicolabs.models.data.ROI

Bases: Serializable, HeaderMixin

Represents a rectangular Region of Interest (ROI) within a 2D coordinate system.

This class is primarily used in imaging and computer vision pipelines to define sub-windows for processing or rectification.

Attributes:

Name Type Description
offset Vector2d

A Vector2d representing the top-left (leftmost, topmost) pixel coordinates of the ROI.

height int

The vertical extent of the ROI in pixels.

width int

The horizontal extent of the ROI in pixels.

do_rectify Optional[bool]

Optional flag; True if a sub-window is captured and requires rectification.

header Optional[Header]

Standard metadata header providing temporal and spatial context.

Querying with the .Q Proxy

This class fields are queryable when constructing a QueryOntologyCatalog via the .Q proxy. Check the fields documentation for detailed description.

Example
from mosaicolabs import MosaicoClient, ROI, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter ROIs with offset X-component AND offset Y-component
    qresponse = client.query(
        QueryOntologyCatalog(ROI.Q.offset.x.gt(5.0))
            .with_expression(ROI.Q.offset.y.lt(10))
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific component value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(ROI.Q.offset.x.gt(5.0), include_timestamp_range=True)
        .with_expression(ROI.Q.offset.y.lt(10))
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

header class-attribute instance-attribute

header = None

An optional metadata header providing temporal and spatial context to the ontology model.

This field is injected into the model via composition, ensuring that sensor data is paired with standard acquisition attributes like sequence IDs and high-precision timestamps.

Querying with the .Q Proxy

Check the documentation of the HeaderMixin to construct a valid expression for the QueryOntologyCatalog builder involving the header component.

offset instance-attribute

offset

The top-left pixel coordinates of the ROI.

Querying with the .Q Proxy

Offset components are queryable through the offset field prefix.

Field Access Path Queryable Type Supported Operators
ROI.Q.offset.x Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
ROI.Q.offset.y Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, ROI, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for ROIs starting between the 10th and 350th pixel vertically
    qresponse = client.query(
        QueryOntologyCatalog(ROI.Q.offset.x.gt(100))
            .with_expression(ROI.Q.offset.y.between(10, 350))
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific component value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(ROI.Q.offset.x.gt(100), include_timestamp_range=True)
        .with_expression(ROI.Q.offset.y.between(10, 350))
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

height instance-attribute

height

Height of the ROI in pixels.

Querying with the .Q Proxy
Field Access Path Queryable Type Supported Operators
ROI.Q.height Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, ROI, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for ROIs with height beyond 100 pixels
    qresponse = client.query(
        QueryOntologyCatalog(ROI.Q.height.gt(100))
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific component value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(ROI.Q.height.gt(100), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

width instance-attribute

width

Width of the ROI in pixels.

Querying with the .Q Proxy
Field Access Path Queryable Type Supported Operators
ROI.Q.width Numeric .eq(), .neq(), .lt(), .gt(), .leq(), .geq(), .in_(), .between()
Example
from mosaicolabs import MosaicoClient, ROI, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for ROIs with width below (or equal to) 250 pixels
    qresponse = client.query(
        QueryOntologyCatalog(ROI.Q.width.leq(250))
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

    # Filter for a specific component value and extract the first and last occurrence times
    qresponse = client.query(
        QueryOntologyCatalog(ROI.Q.width.gt(100), include_timestamp_range=True)
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {{topic.name:
                        [topic.timestamp_range.start, topic.timestamp_range.end]
                        for topic in item.topics}}")

do_rectify class-attribute instance-attribute

do_rectify = None

Flag indicating if the ROI requires rectification.

Querying with the .Q Proxy
Field Access Path Queryable Type Supported Operators
ROI.Q.do_rectify Boolean .eq()
Example
from mosaicolabs import MosaicoClient, ROI, QueryOntologyCatalog

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for explicitly non-rectified ROIs (not None)
    qresponse = client.query(
        QueryOntologyCatalog(ROI.Q.do_rectify.eq(False))
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")

is_registered classmethod

is_registered()

Checks if a class is registered.

Returns:

Name Type Description
bool bool

True if registered.

ontology_tag classmethod

ontology_tag()

Retrieves the unique identifier (tag) for the current ontology class, automatically generated during class definition.

This method provides the string key used by the Mosaico platform to identify and route specific data types within the ontology registry. It abstracts away the internal naming conventions, ensuring that you always use the correct identifier for queries and serialization.

Returns:

Type Description
str

The registered string tag for this class (e.g., "imu", "gps").

Raises:

Type Description
Exception

If the class was not properly initialized via __init_subclass__.

Practical Application: Topic Filtering

This method is particularly useful when constructing QueryTopic requests. By using the convenience method QueryTopic.with_ontology_tag(), you can filter topics by data type without hardcoding strings that might change.

Example:

from mosaicolabs import MosaicoClient, Topic, IMU, QueryTopic

with MosaicoClient.connect("localhost", 6726) as client:
    # Filter for a specific data value (using constructor)
    qresponse = client.query(
        QueryTopic(
            Topic.with_ontology_tag(IMU.ontology_tag()),
        )
    )

    # Inspect the response
    if qresponse is not None:
        # Results are automatically grouped by Sequence for easier data management
        for item in qresponse:
            print(f"Sequence: {item.sequence.name}")
            print(f"Topics: {[topic.name for topic in item.topics]}")