Explore the ASAM ODS Data Model#
In this example Notebook, we show you how to explore the data model of your Peak ODS Server.
Understanding the data model is important once it comes to query (instance) data from your Peak ODS Server.
The first sections is on inspecting the base model. The programming fun starts with “Explore the ASAM ODS Application Model”.
ASAM ODS Base Model#
The ASAM ODS Base Model defines the sematic or building blocks of an ASAM ODS Application Model. It defines the fundamental entities, attributes, and relations that are used to describe and structure measurement and test data in a standardized way.
The ASAM ODS BaseModel Viewer below lets you interactively inspect the base model.
Have fun 😊 exploring the base model.
Click here to open the ASAM ODS BaseModel Viewer in a separate window.
# The ASAM ODS BaseModel Viewer HTML file is locally installed in the curriculum
# We use an IFrame to display it in the notebook
#
base_model_viewer = "../_static/asam_ods_basemodel_viewer.html"
from IPython.display import IFrame
IFrame(src=base_model_viewer, width='100%', height=600)
ASAM ODS Application Model#
The ASAM ODS application model use the building blocks of the base model to define an application specific data model - tailored to your needs.
Establish session#
The ODS HTTP API is a session based API. The session ID is called con_i in the ODS documentation. The ASAM ODSBox uses con_i as API object representing the session. Close this session to release the connection license. Otherwise the session will be auto closed after 30 minutes of inactivity.
try:
import odsbox
except:
!pip install odsbox
from odsbox.con_i import ConI
con_i = ConI(url='https://docker.peak-solution.de:10032/api', auth=('Demo','mdm'))
Explore the Data Model#
The data model describes the way your data is stored in the Peak ODS Server. The data model consists of entities (you can compare them to class-definitions) and their according attributes and relations to other entities.
model = con_i.model()
List all Entities#
Entities are the major building blocks of the data model. You typically query for instances of entities to explore your data. Let’s list all entities to see what we have
for entity in model.entities:
print(entity)
TplSensorAttr
TestSequence
ExtSystemAttr
Status
TplGroup
CatSensorAttr
WorkflowParameterSet
TplTestStepUsage
ValueList
CatTestEquipmentComp
ValueListValue
TplTestSequenceAttr
TplUnitUnderTestAttr
Project
Quantity
Role
TplUnitUnderTestRoot
DynToken
ProjectDomain
Unit
LocalColumn
MeaQuantity
CatTestSequenceAttr
WorkflowRun
StructureLevel
CatUnitUnderTestAttr
TplParameterSet
TplTestStep
TestStep
TplTestSequenceRoot
MeaResult
MDMRole
UnitUnderTest
UserParameter
MDMLocalization
Domain
WorkflowParameter
TplSensor
TplMeaResult
AttributeMap
CatSensor
TplUnitUnderTestComp
PhysDimension
TplTest
ActionRun
ExternalComponent
StatusValidity
MDMTag
User
CatTestSequenceComp
Action
Environment
MDMLog
ExtSystem
CatUnitUnderTestComp
TplTestEquipmentRoot
MDMFunction
Condition
TplTestEquipmentComp
MDMTagParameterSet
ResultParameterSet
SubMatrix
SystemParameter
ToCondition
MDMTagParameter
TplTestSequenceComp
TplSubMatrix
MDMGroup
CatTestEquipmentAttr
FavouriteLists
TplParameter
Workflow
TplTestEquipmentAttr
TokenType
TestEquipment
ResultParameter
InitToken
Classification
NameMap
ToAction
Test
MDMAttr
Examine a specific entitiy#
The entitiy definition contains some information of the entity itself and all attributes and references of this entity.
Have a specifc look to the base_name - in other data models your specific entity may have a diferent name. You can use the base_name for data model agnostic queries.
Also the aid can be of importance of you deal directly with the ASAM ODS REST API, not using JAQueL.
model.entities["Unit"]
name: "Unit"
base_name: "AoUnit"
aid: 54
attributes {
key: "dB"
value {
name: "dB"
data_type: DT_BOOLEAN
length: 1
id: 7
}
}
attributes {
key: "dB_reference_factor"
value {
name: "dB_reference_factor"
data_type: DT_FLOAT
length: 1
id: 8
}
}
attributes {
key: "Offset"
value {
name: "Offset"
base_name: "offset"
data_type: DT_DOUBLE
length: 1
obligatory: true
id: 6
}
}
attributes {
key: "Name"
value {
name: "Name"
base_name: "name"
data_type: DT_STRING
length: 50
obligatory: true
unique: true
id: 1
}
}
attributes {
key: "MimeType"
value {
name: "MimeType"
base_name: "mime_type"
data_type: DT_STRING
length: 256
obligatory: true
id: 2
}
}
attributes {
key: "Id"
value {
name: "Id"
base_name: "id"
data_type: DT_LONGLONG
length: 1
obligatory: true
unique: true
autogenerated: true
}
}
attributes {
key: "Factor"
value {
name: "Factor"
base_name: "factor"
data_type: DT_DOUBLE
length: 1
obligatory: true
id: 5
}
}
attributes {
key: "Description"
value {
name: "Description"
base_name: "description"
data_type: DT_STRING
length: 500
id: 3
}
}
attributes {
key: "DateCreated"
value {
name: "DateCreated"
base_name: "version_date"
data_type: DT_DATE
length: 30
id: 4
}
}
relations {
key: "WorkflowParameter"
value {
name: "WorkflowParameter"
base_name: "parameters"
inverse_name: "Unit"
inverse_base_name: "unit"
entity_name: "WorkflowParameter"
entity_aid: 73
virtual_reference: true
range_max: -1
inverse_range_max: 1
relation_type: RT_INFO
relationship: RS_INFO_FROM
}
}
relations {
key: "TplParameter"
value {
name: "TplParameter"
base_name: "parameters"
inverse_name: "Unit"
inverse_base_name: "unit"
entity_name: "TplParameter"
entity_aid: 71
virtual_reference: true
range_max: -1
inverse_range_max: 1
relation_type: RT_INFO
relationship: RS_INFO_FROM
}
}
relations {
key: "ResultParameter"
value {
name: "ResultParameter"
base_name: "parameters"
inverse_name: "Unit"
inverse_base_name: "unit"
entity_name: "ResultParameter"
entity_aid: 66
virtual_reference: true
range_max: -1
inverse_range_max: 1
relation_type: RT_INFO
relationship: RS_INFO_FROM
}
}
relations {
key: "Quantities"
value {
name: "Quantities"
base_name: "quantities"
inverse_name: "Unit"
inverse_base_name: "default_unit"
entity_name: "Quantity"
entity_aid: 55
virtual_reference: true
range_max: -1
inverse_range_max: 1
relation_type: RT_INFO
relationship: RS_INFO_FROM
}
}
relations {
key: "PhysDimension"
value {
name: "PhysDimension"
base_name: "phys_dimension"
inverse_name: "Units"
inverse_base_name: "units"
entity_name: "PhysDimension"
entity_aid: 47
range_min: 1
range_max: 1
inverse_range_max: -1
relation_type: RT_INFO
relationship: RS_INFO_TO
}
}
relations {
key: "MeaQuantities"
value {
name: "MeaQuantities"
base_name: "measurement_quantities"
inverse_name: "Unit"
inverse_base_name: "unit"
entity_name: "MeaQuantity"
entity_aid: 80
virtual_reference: true
range_max: -1
inverse_range_max: 1
relation_type: RT_INFO
relationship: RS_INFO_FROM
}
}
relations {
key: "MDMTagParameter"
value {
name: "MDMTagParameter"
base_name: "parameters"
inverse_name: "Unit"
inverse_base_name: "unit"
entity_name: "MDMTagParameter"
entity_aid: 65
virtual_reference: true
range_max: -1
inverse_range_max: 1
relation_type: RT_INFO
relationship: RS_INFO_FROM
}
}
Examine Attributes#
Looking at the attributes is also important when examine the data model. Like entities, also attributes can have a base_name to be used for data model agnostsic queries.
Furthermore data_type and obligatory information is important - especially when it comes to writing data
model.entities["Unit"].attributes["Name"]
name: "Name"
base_name: "name"
data_type: DT_STRING
length: 50
obligatory: true
unique: true
id: 1
Examine Relations#
Relations describe the connection between entities. In a data model relations are important for exploring the data neighbors. Relations have names to identify them (think of identifying a specific tire like “front left”) and the definition of the entity they’re pointing to: the entity_name. With range_min and range_max you can determine whether a relation is obligatory. In case a relation has also a (parallel) backward relation, the inverse_name contains this information.
model.entities["Unit"].relations["PhysDimension"]
name: "PhysDimension"
base_name: "phys_dimension"
inverse_name: "Units"
inverse_base_name: "units"
entity_name: "PhysDimension"
entity_aid: 47
range_min: 1
range_max: 1
inverse_range_max: -1
relation_type: RT_INFO
relationship: RS_INFO_TO
Close session#
Don’t forget to close the session to release the connection license. Otherwise the session will be auto closed after 30 minutes of inactivity.
con_i.logout()
License#
Copyright © 2025 Peak Solution GmbH
The training material in this repository is licensed under a Creative Commons BY-NC-SA 4.0 license. See LICENSE file for more information.
Notebook: 📓 Back to ASAM ODS Overview