EDM structure
The $metadata
for each model describes the structure of the data model
according to the conventions defined in the OData protocol.
The main components that make up the model are described as follows:
- Service Document
- The context URL of the
$metadata
of the service. The$metadata
document describes the resources made available by the service. - Metadata
- A conceptual schema definition (CSDL) that describes the EDM, which is exposed as
/api/v1/$metadata
. - Entity container
- A single container in a metadata document that describes the information that is made available
by the service. The entity container represents an entry point into a primary collection of one or
more
edm:EntitySet
,edm:Singleton
,edm:ActionImport
, oredm:FunctionImport
elements. For example, for the TM1 REST API, theedm:EntityContainer
element defines the main components that make up the API:<EntityContainer Name="API"> <EntitySet Name="Cubes" EntityType="ibm.tm1.api.v1.Cube" tm1:Since="10.2.2.0"> <NavigationPropertyBinding Path="Dimensions" Target="Dimensions"/> <NavigationPropertyBinding Path="Annotations" Target="Annotations"/> </EntitySet> <EntitySet Name="Dimensions" EntityType="ibm.tm1.api.v1.Dimension" tm1:Since="10.2.2.0"/> <EntitySet Name="Processes" EntityType="ibm.tm1.api.v1.Process" tm1:Since="10.2.2.0"/> <EntitySet Name="ProcessDebugContexts" EntityType="ibm.tm1.api.v1.ProcessDebugContext" IncludeInServiceDocument="false" tm1:Since="11.0.0.0"> <NavigationPropertyBinding Path="Process" Target="Processes"/> </EntitySet> <EntitySet Name="Annotations" EntityType="ibm.tm1.api.v1.Annotation" tm1:Since="10.2.2.0"/> <EntitySet Name="Cellsets" EntityType="ibm.tm1.api.v1.Cellset" IncludeInServiceDocument="false" tm1:Since="10.2.2.0"> <NavigationPropertyBinding Path="Cube" Target="Cubes"/> </EntitySet> <EntitySet Name="MemberSets" EntityType="ibm.tm1.api.v1.CellsetAxis" IncludeInServiceDocument="false" tm1:Since="11.0.0.2"> <NavigationPropertyBinding Path="Cube" Target="Cubes"/> </EntitySet> <EntitySet Name="Users" EntityType="ibm.tm1.api.v1.User" tm1:Since="10.2.2.0"> <NavigationPropertyBinding Path="Groups" Target="Groups"/> <NavigationPropertyBinding Path="Sessions" Target="Sessions"/> </EntitySet> <Singleton Name="ActiveUser" Type="ibm.tm1.api.v1.User" tm1:Since="10.2.2.4"> <NavigationPropertyBinding Path="Groups" Target="Groups"/> <NavigationPropertyBinding Path="Sessions" Target="Sessions"/> </Singleton> <EntitySet Name="Groups" EntityType="ibm.tm1.api.v1.Group" tm1:Since="10.2.2.0"> <NavigationPropertyBinding Path="Users" Target="Users"/> </EntitySet> <EntitySet Name="Sandboxes" EntityType="ibm.tm1.api.v1.Sandbox" tm1:Since="10.2.2.0"/> <EntitySet Name="ApplicationContextFacets" EntityType="ibm.tm1.api.v1.ApplicationContextFacet" tm1:Since="10.2.2.0"/> <EntitySet Name="CubeAttributes" EntityType="ibm.tm1.api.v1.AttributeDefinition" tm1:Since="10.2.2.1"/> <EntitySet Name="DimensionAttributes" EntityType="ibm.tm1.api.v1.AttributeDefinition" tm1:Since="10.2.2.1"/> <EntitySet Name="ProcessAttributes" EntityType="ibm.tm1.api.v1.AttributeDefinition" tm1:Since="11.0.0.0"/> <EntitySet Name="ChoreAttributes" EntityType="ibm.tm1.api.v1.AttributeDefinition" tm1:Since="11.0.0.0"/> <Singleton Name="Configuration" Type="ibm.tm1.api.v1.Configuration" tm1:Since="10.2.2.0"/> <Singleton Name="StaticConfiguration" Type="ibm.tm1.api.v1.ServerSettings" tm1:Since="11.0.0.0"/> <Singleton Name="ActiveConfiguration" Type="ibm.tm1.api.v1.ServerSettings" tm1:Since="11.0.0.0"/> <Singleton Name="Server" Type="ibm.tm1.api.v1.Server" tm1:Since="11.0.0.0"/> <EntitySet Name="Sessions" EntityType="ibm.tm1.api.v1.Session" tm1:Since="10.2.2.5"> <NavigationPropertyBinding Path="User" Target="Users"/> <NavigationPropertyBinding Path="Threads" Target="Threads"/> </EntitySet> <Singleton Name="ActiveSession" Type="ibm.tm1.api.v1.Session" tm1:Since="10.2.2.5"> <NavigationPropertyBinding Path="User" Target="Users"/> <NavigationPropertyBinding Path="Threads" Target="Threads"/> </Singleton> <EntitySet Name="Threads" EntityType="ibm.tm1.api.v1.Thread" tm1:Since="10.2.2.1"> <NavigationPropertyBinding Path="Session" Target="Sessions"/> </EntitySet> <EntitySet Name="Chores" EntityType="ibm.tm1.api.v1.Chore" tm1:Since="10.2.2.1"/> <EntitySet Name="Contents" EntityType="ibm.tm1.api.v1.Folder" tm1:Since="10.2.2.1"/> <EntitySet Name="Loggers" EntityType="ibm.tm1.api.v1.Logger" tm1:Since="10.2.2.6"/> <EntitySet Name="MessageLogEntries" EntityType="ibm.tm1.api.v1.MessageLogEntry" tm1:Since="10.2.2.4"> <Annotation Term="Org.OData.Capabilities.V1.IndexableByKey" Bool="false"/> <Annotation Term="Org.OData.Capabilities.V1.ChangeTracking"> <Record> <PropertyValue Property="Supported" Bool="true"/> <PropertyValue Property="FilterableProperties"> <Collection> <PropertyPath>ThreadID</PropertyPath> <PropertyPath>SessionID</PropertyPath> <PropertyPath>Level</PropertyPath> <PropertyPath>TimeStamp</PropertyPath> <PropertyPath>Logger</PropertyPath> <PropertyPath>Message</PropertyPath> </Collection> </PropertyValue> </Record> </Annotation> </EntitySet> <EntitySet Name="TransactionLogEntries" EntityType="ibm.tm1.api.v1.TransactionLogEntry" tm1:Since="10.2.2.4"> <Annotation Term="Org.OData.Capabilities.V1.IndexableByKey" Bool="false"/> <Annotation Term="Org.OData.Capabilities.V1.ChangeTracking"> <Record> <PropertyValue Property="Supported" Bool="true"/> <PropertyValue Property="FilterableProperties"> <Collection> <PropertyPath>ChangeSetID</PropertyPath> <PropertyPath>TimeStamp</PropertyPath> <PropertyPath>ReplicationTime</PropertyPath> <PropertyPath>Cube</PropertyPath> <PropertyPath>Tuple</PropertyPath> <PropertyPath>OldValue</PropertyPath> <PropertyPath>NewValue</PropertyPath> <PropertyPath>StatusMessage</PropertyPath> </Collection> </PropertyValue> </Record> </Annotation> </EntitySet> <FunctionImport Name="ModelCubes" Function="ibm.tm1.api.v1.ModelCubes" EntitySet="Cubes" IncludeInServiceDocument="true"/> <FunctionImport Name="ControlCubes" Function="ibm.tm1.api.v1.ControlCubes" EntitySet="Cubes" IncludeInServiceDocument="true"/> <FunctionImport Name="ModelDimensions" Function="ibm.tm1.api.v1.ModelDimensions" EntitySet="Dimensions" IncludeInServiceDocument="true"/> <FunctionImport Name="ControlDimensions" Function="ibm.tm1.api.v1.ControlDimensions" EntitySet="Dimensions" IncludeInServiceDocument="true"/> <FunctionImport Name="MessageLog" Function="ibm.tm1.api.v1.MessageLog" IncludeInServiceDocument="true"/> <FunctionImport Name="TransactionLog" Function="ibm.tm1.api.v1.TransactionLog" IncludeInServiceDocument="true"/> <ActionImport Name="ExecuteMDX" Action="ibm.tm1.api.v1.ExecuteMDX" EntitySet="Cellsets"/> <ActionImport Name="ExecuteMDXSetExpression" Action="ibm.tm1.api.v1.ExecuteMDXSetExpression" EntitySet="MemberSets"/> <ActionImport Name="DeleteAnnotationArtifacts" Action="ibm.tm1.api.v1.DeleteAnnotationArtifacts"/> <ActionImport Name="BeginChangeSet" Action="ibm.tm1.api.v1.BeginChangeSet"/> <ActionImport Name="EndChangeSet" Action="ibm.tm1.api.v1.EndChangeSet"/> <ActionImport Name="UndoChangeSet" Action="ibm.tm1.api.v1.UndoChangeSet"/> <ActionImport Name="Update" Action="ibm.tm1.api.v1.Update"/> <ActionImport Name="ExecuteProcess" Action="ibm.tm1.api.v1.ExecuteProcess"/> <ActionImport Name="CompileProcess" Action="ibm.tm1.api.v1.CompileProcess"/> <ActionImport Name="EncryptDataModel" Action="ibm.tm1.api.v1.EncryptDataModel" tm1:hidden="true"/> <ActionImport Name="DecryptDataModel" Action="ibm.tm1.api.v1.DecryptDataModel" tm1:hidden="true"/> <ActionImport Name="EncryptDataFile" Action="ibm.tm1.api.v1.EncryptDataFile" tm1:hidden="true"/> <ActionImport Name="DecryptDataFile" Action="ibm.tm1.api.v1.DecryptDataFile" tm1:hidden="true"/> <ActionImport Name="RotateDataModelKey" Action="ibm.tm1.api.v1.RotateDataModelKey" tm1:hidden="true"/> </EntityContainer>
- Entities
-
An object in the data model and its properties or complex types. An entity is similar to a class definition in an object-oriented language. Entities support the following features:
- Named structures with keys
- The ability to reference other entities in the model with navigation properties, which define relationships to other objects
- Inheritance from another entity definition
For example, a Cube is made up of dimensions, but the dimensions are not contained within the cube. The entity definition for a
Cube
referencesDimension
entities at another location, and identifies the entity type asibm.tm1.api.v1.Dimension
:<EntityType Name="Cube"> <Key> <PropertyRef Name="Name" /> </Key> <Property Name="Name" Nullable="false" Type="Edm.String" /> <Property Name="Rules" Nullable="true" Type="Edm.String" /> <Property Name="LastSchemaUpdate" Nullable="true" Type="Edm.DateTimeOffset" /> <Property Name="LastDataUpdate" Nullable="true" Type="Edm.DateTimeOffset" /> <Property Name="Attributes" Type="ibm.tm1.api.v1.Attributes" /> <NavigationProperty Name="Dimensions" Type="Collection(ibm.tm1.api.v1.Dimension)" /> <NavigationProperty Name="Views" Type="Collection(ibm.tm1.api.v1.View)" Partner="Cube" ContainsTarget="true" /> <NavigationProperty Name="ViewAttributes" Type="Collection(ibm.tm1.api.v1.AttributeDefinition)" ContainsTarget="true" /> <NavigationProperty Name="PrivateViews" Type="Collection(ibm.tm1.api.v1.View)" Partner="Cube" ContainsTarget="true" /> <NavigationProperty Name="Annotations" Type="Collection(ibm.tm1.api.v1.Annotation)" /> <NavigationProperty Name="LocalizedAttributes" Type="Collection(ibm.tm1.api.v1.LocalizedAttributes)" ContainsTarget="true" /> </EntityType>
The
Dimension
entity is defined elsewhere in the$metadata
document. - Relationships
- A relationship can exist between entities in an EDM by:
- Navigation paths that reference another entity or collection of entities in the model. For example, an invoice entity might have a relationship defined that references a customer ID.
- Containment of one entity by another identified by the
ContainesTarget
attribute.
The following diagram illustrates the relationship between a
Cube
and aDimension
entity, and how the abstractView
entity provides the base for theMDXView
andNativeView
entities.