Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pkg/clients/dgc_relation_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (

// Well-known Collibra UUIDs for relation and attribute types.
const (
DefinitionAttributeTypeID = "00000000-0000-0000-0000-000000003008"
DataAttributeRepresentsMeasureRelID = "00000000-0000-0000-0000-000000007200"
GenericConnectedAssetRelID = "00000000-0000-0000-0000-000000007038"
ColumnToTableRelID = "00000000-0000-0000-0000-000000007042"
DataAttributeRelID1 = "00000000-0000-0000-0000-000000007094"
DataAttributeRelID2 = "cd000000-0000-0000-0000-000000000023"
DefinitionAttributeTypeID = "00000000-0000-0000-0000-000000000202"
MeasureIsCalculatedUsingDataElementRelID = "00000000-0000-0000-0000-000000007200"
BusinessAssetRepresentsDataAssetRelID = "00000000-0000-0000-0000-000000007038"
ColumnIsPartOfTableRelID = "00000000-0000-0000-0000-000000007042"
DataAttributeRepresentsColumnRelID = "00000000-0000-0000-0000-000000007094"
ColumnIsSourceForDataAttributeRelID = "00000000-0000-0000-0000-120000000011"
)

type RelationsQueryParams struct {
Expand Down Expand Up @@ -164,7 +164,7 @@ func FindColumnsForDataAttribute(ctx context.Context, client *http.Client, dataA
seen := make(map[string]struct{})
result := make([]ConnectedAsset, 0)

for _, relID := range []string{DataAttributeRelID1, DataAttributeRelID2} {
for _, relID := range []string{DataAttributeRepresentsColumnRelID, ColumnIsSourceForDataAttributeRelID} {
assets, err := FindConnectedAssets(ctx, client, dataAttributeID, relID)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/tools/add_business_term/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const (
// BusinessTermTypeID is the fixed type public ID for Business Term assets.
BusinessTermTypeID = "BusinessTerm"
// DefinitionAttributeTypeID is the type ID for the Definition attribute.
DefinitionAttributeTypeID = "00000000-0000-0000-0000-000000003114"
DefinitionAttributeTypeID = "00000000-0000-0000-0000-000000000202"
)

// InputAttribute represents an additional attribute to add to the business term.
Expand Down
4 changes: 2 additions & 2 deletions pkg/tools/add_business_term/tool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func TestAddBusinessTermSuccess(t *testing.T) {
if req.AssetId != "new-asset-uuid-456" {
t.Errorf("expected assetId 'new-asset-uuid-456', got '%s'", req.AssetId)
}
if req.TypeId != "00000000-0000-0000-0000-000000003114" {
t.Errorf("expected definition typeId '00000000-0000-0000-0000-000000003114', got '%s'", req.TypeId)
if req.TypeId != "00000000-0000-0000-0000-000000000202" {
t.Errorf("expected definition typeId '00000000-0000-0000-0000-000000000202', got '%s'", req.TypeId)
}
if req.Value != "Total income generated from sales" {
t.Errorf("expected value 'Total income generated from sales', got '%s'", req.Value)
Expand Down
4 changes: 2 additions & 2 deletions pkg/tools/get_business_term_data/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func handler(collibraClient *http.Client) chip.ToolHandlerFunc[Input, Output] {
return Output{Error: "businessTermId is required"}, nil
}

dataAttributes, err := clients.FindConnectedAssets(ctx, collibraClient, input.BusinessTermID, clients.GenericConnectedAssetRelID)
dataAttributes, err := clients.FindConnectedAssets(ctx, collibraClient, input.BusinessTermID, clients.BusinessAssetRepresentsDataAssetRelID)
if err != nil {
return Output{}, err
}
Expand All @@ -79,7 +79,7 @@ func handler(collibraClient *http.Client) chip.ToolHandlerFunc[Input, Output] {
Description: clients.FetchDescription(ctx, collibraClient, col.ID),
}

tables, err := clients.FindConnectedAssets(ctx, collibraClient, col.ID, clients.ColumnToTableRelID)
tables, err := clients.FindConnectedAssets(ctx, collibraClient, col.ID, clients.ColumnIsPartOfTableRelID)
if err != nil {
return Output{}, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/tools/get_column_semantics/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func handler(collibraClient *http.Client) chip.ToolHandlerFunc[Input, Output] {
for _, da := range dataAttributes {
description := clients.FetchDescription(ctx, collibraClient, da.ID)

rawMeasures, err := clients.FindConnectedAssets(ctx, collibraClient, da.ID, clients.DataAttributeRepresentsMeasureRelID)
rawMeasures, err := clients.FindConnectedAssets(ctx, collibraClient, da.ID, clients.MeasureIsCalculatedUsingDataElementRelID)
if err != nil {
return Output{}, err
}
Expand All @@ -73,7 +73,7 @@ func handler(collibraClient *http.Client) chip.ToolHandlerFunc[Input, Output] {
})
}

rawGenericAssets, err := clients.FindConnectedAssets(ctx, collibraClient, da.ID, clients.GenericConnectedAssetRelID)
rawGenericAssets, err := clients.FindConnectedAssets(ctx, collibraClient, da.ID, clients.BusinessAssetRepresentsDataAssetRelID)
if err != nil {
return Output{}, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/tools/get_measure_data/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func handler(collibraClient *http.Client) chip.ToolHandlerFunc[Input, Output] {
return Output{Error: "measureId is required"}, nil
}

dataAttributes, err := clients.FindConnectedAssets(ctx, collibraClient, input.MeasureID, clients.DataAttributeRepresentsMeasureRelID)
dataAttributes, err := clients.FindConnectedAssets(ctx, collibraClient, input.MeasureID, clients.MeasureIsCalculatedUsingDataElementRelID)
if err != nil {
return Output{}, err
}
Expand All @@ -76,7 +76,7 @@ func handler(collibraClient *http.Client) chip.ToolHandlerFunc[Input, Output] {
Description: clients.FetchDescription(ctx, collibraClient, col.ID),
}

tables, err := clients.FindConnectedAssets(ctx, collibraClient, col.ID, clients.ColumnToTableRelID)
tables, err := clients.FindConnectedAssets(ctx, collibraClient, col.ID, clients.ColumnIsPartOfTableRelID)
if err != nil {
return Output{}, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/tools/get_table_semantics/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func handler(collibraClient *http.Client) chip.ToolHandlerFunc[Input, Output] {
return Output{Error: "tableId is required"}, nil
}

rawColumns, err := clients.FindConnectedAssets(ctx, collibraClient, input.TableID, clients.ColumnToTableRelID)
rawColumns, err := clients.FindConnectedAssets(ctx, collibraClient, input.TableID, clients.ColumnIsPartOfTableRelID)
if err != nil {
return Output{}, err
}
Expand All @@ -74,7 +74,7 @@ func handler(collibraClient *http.Client) chip.ToolHandlerFunc[Input, Output] {
for _, da := range dataAttributes {
daDescription := clients.FetchDescription(ctx, collibraClient, da.ID)

rawMeasures, err := clients.FindConnectedAssets(ctx, collibraClient, da.ID, clients.DataAttributeRepresentsMeasureRelID)
rawMeasures, err := clients.FindConnectedAssets(ctx, collibraClient, da.ID, clients.MeasureIsCalculatedUsingDataElementRelID)
if err != nil {
return Output{}, err
}
Expand Down
Loading