Skip to content

Commit 17121fc

Browse files
authored
Merge pull request #29 from data-solution-automation-engine/dev-2024-06
Dev 2024 06 - 2.1.0 version
2 parents 80dfe2d + 537e499 commit 17121fc

35 files changed

+837
-1011
lines changed

DataWarehouseAutomation/DataWarehouseAutomation.sln

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1313
Images\Ravos-logo.png = Images\Ravos-logo.png
1414
EndProjectSection
1515
EndProject
16-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Validation", "Test_Project\Validation.csproj", "{23CF4A46-B17F-4642-B949-02E061868BBC}"
17-
ProjectSection(ProjectDependencies) = postProject
18-
{F0458983-9646-42E6-9E18-90AD91288B40} = {F0458983-9646-42E6-9E18-90AD91288B40}
19-
EndProjectSection
20-
EndProject
2116
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample Metadata", "Sample Metadata", "{242F4BD0-68F9-4193-A329-826E755C6B08}"
2217
ProjectSection(SolutionItems) = preProject
2318
Sample_Metadata\myFirstMapping.json = Sample_Metadata\myFirstMapping.json
2419
Sample_Metadata\sampleBasic.json = Sample_Metadata\sampleBasic.json
2520
Sample_Metadata\sampleBasicWithExtensions.json = Sample_Metadata\sampleBasicWithExtensions.json
2621
Sample_Metadata\sampleCalculation.json = Sample_Metadata\sampleCalculation.json
2722
Sample_Metadata\sampleCustomFunctions.json = Sample_Metadata\sampleCustomFunctions.json
28-
Sample_Metadata\sampleDataVaultHub.json = Sample_Metadata\sampleDataVaultHub.json
2923
Sample_Metadata\sampleFreeForm.json = Sample_Metadata\sampleFreeForm.json
30-
Sample_Metadata\sampleJsonStagingWithPsaDetails.json = Sample_Metadata\sampleJsonStagingWithPsaDetails.json
3124
Sample_Metadata\sampleMultipleDataItemMappings.json = Sample_Metadata\sampleMultipleDataItemMappings.json
3225
Sample_Metadata\sampleSimpleDDL.json = Sample_Metadata\sampleSimpleDDL.json
3326
Sample_Metadata\sampleSourceQuery.json = Sample_Metadata\sampleSourceQuery.json
@@ -46,13 +39,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample Templates", "Sample
4639
Sample_Templates\TemplateSampleSourceQuery.Handlebars = Sample_Templates\TemplateSampleSourceQuery.Handlebars
4740
EndProjectSection
4841
EndProject
49-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples", "Example_Project\Examples.csproj", "{F77AC518-6300-4927-8775-B92CDF15CC8E}"
50-
EndProject
5142
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RunDwhAutomation", "RunDwhAutomation\RunDwhAutomation.csproj", "{62C992C6-370D-4591-B54E-2F61E2D8B638}"
5243
EndProject
5344
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SchemaJsonConverter", "SchemaJsonConverter\SchemaJsonConverter.csproj", "{07214B80-37A9-4137-B0F3-109FA0D0926A}"
5445
EndProject
55-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Export", "Export\Export.csproj", "{555AD192-6E8B-49DD-B60C-2E2CC41C0FA2}"
46+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Validation", "Validation\Validation.csproj", "{DB4DA80B-39D0-451F-ADF4-C4CA75F1851D}"
47+
EndProject
48+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples", "Examples\Examples.csproj", "{59169ABF-D3E5-479E-B4F5-D30DEB5900A2}"
5649
EndProject
5750
Global
5851
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -64,14 +57,6 @@ Global
6457
{F0458983-9646-42E6-9E18-90AD91288B40}.Debug|Any CPU.Build.0 = Debug|Any CPU
6558
{F0458983-9646-42E6-9E18-90AD91288B40}.Release|Any CPU.ActiveCfg = Release|Any CPU
6659
{F0458983-9646-42E6-9E18-90AD91288B40}.Release|Any CPU.Build.0 = Release|Any CPU
67-
{23CF4A46-B17F-4642-B949-02E061868BBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
68-
{23CF4A46-B17F-4642-B949-02E061868BBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
69-
{23CF4A46-B17F-4642-B949-02E061868BBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
70-
{23CF4A46-B17F-4642-B949-02E061868BBC}.Release|Any CPU.Build.0 = Release|Any CPU
71-
{F77AC518-6300-4927-8775-B92CDF15CC8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72-
{F77AC518-6300-4927-8775-B92CDF15CC8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
73-
{F77AC518-6300-4927-8775-B92CDF15CC8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
74-
{F77AC518-6300-4927-8775-B92CDF15CC8E}.Release|Any CPU.Build.0 = Release|Any CPU
7560
{62C992C6-370D-4591-B54E-2F61E2D8B638}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
7661
{62C992C6-370D-4591-B54E-2F61E2D8B638}.Debug|Any CPU.Build.0 = Debug|Any CPU
7762
{62C992C6-370D-4591-B54E-2F61E2D8B638}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -80,10 +65,14 @@ Global
8065
{07214B80-37A9-4137-B0F3-109FA0D0926A}.Debug|Any CPU.Build.0 = Debug|Any CPU
8166
{07214B80-37A9-4137-B0F3-109FA0D0926A}.Release|Any CPU.ActiveCfg = Release|Any CPU
8267
{07214B80-37A9-4137-B0F3-109FA0D0926A}.Release|Any CPU.Build.0 = Release|Any CPU
83-
{555AD192-6E8B-49DD-B60C-2E2CC41C0FA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
84-
{555AD192-6E8B-49DD-B60C-2E2CC41C0FA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
85-
{555AD192-6E8B-49DD-B60C-2E2CC41C0FA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
86-
{555AD192-6E8B-49DD-B60C-2E2CC41C0FA2}.Release|Any CPU.Build.0 = Release|Any CPU
68+
{DB4DA80B-39D0-451F-ADF4-C4CA75F1851D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
69+
{DB4DA80B-39D0-451F-ADF4-C4CA75F1851D}.Debug|Any CPU.Build.0 = Debug|Any CPU
70+
{DB4DA80B-39D0-451F-ADF4-C4CA75F1851D}.Release|Any CPU.ActiveCfg = Release|Any CPU
71+
{DB4DA80B-39D0-451F-ADF4-C4CA75F1851D}.Release|Any CPU.Build.0 = Release|Any CPU
72+
{59169ABF-D3E5-479E-B4F5-D30DEB5900A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
73+
{59169ABF-D3E5-479E-B4F5-D30DEB5900A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
74+
{59169ABF-D3E5-479E-B4F5-D30DEB5900A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
75+
{59169ABF-D3E5-479E-B4F5-D30DEB5900A2}.Release|Any CPU.Build.0 = Release|Any CPU
8776
EndGlobalSection
8877
GlobalSection(SolutionProperties) = preSolution
8978
HideSolutionNode = FALSE

DataWarehouseAutomation/DataWarehouseAutomation/DataWarehouseAutomation.csproj

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7-
<Version>2.0.3</Version>
7+
<Version>2.1.0</Version>
88
<Authors>Roelant Vos</Authors>
99
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
1010
<Title>Data Warehouse Automation</Title>
11-
<PackageProjectUrl>https://roelantvos.com/blog/interface-for-data-warehouse-automation/</PackageProjectUrl>
11+
<PackageProjectUrl>https://github.com/data-solution-automation-engine/data-warehouse-automation-metadata-schema</PackageProjectUrl>
1212
<PackageIcon>Ravos-logo.png</PackageIcon>
1313
<PackageReadmeFile>index.md</PackageReadmeFile>
14-
<RepositoryUrl>https://github.com/RoelantVos/data-warehouse-automation-metadata-schema</RepositoryUrl>
14+
<RepositoryUrl>https://github.com/data-solution-automation-engine/data-warehouse-automation-metadata-schema</RepositoryUrl>
1515
<PackageTags>data warehouse; etl; data integration; data warehouse automation</PackageTags>
1616
<Description>The generic schema for Data Warehouse Automation covers the efforts towards defining a standard interface to exchange Data Warehouse Automation and ETL generation metadata.
1717

@@ -35,6 +35,22 @@ The interface itself is a Json schema definition (JSDL) with examples on how to
3535
<PackageReference Include="Handlebars.Net" Version="2.1.4" />
3636
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
3737
<PackageReference Include="Newtonsoft.Json.Schema" Version="3.0.15" />
38+
<PackageReference Include="Roslynator.Analyzers" Version="4.12.4">
39+
<PrivateAssets>all</PrivateAssets>
40+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
41+
</PackageReference>
42+
<PackageReference Include="Roslynator.CodeFixes" Version="4.12.4">
43+
<PrivateAssets>all</PrivateAssets>
44+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
45+
</PackageReference>
46+
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.12.4">
47+
<PrivateAssets>all</PrivateAssets>
48+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
49+
</PackageReference>
50+
<PackageReference Include="Roslynator.Refactorings" Version="4.12.4">
51+
<PrivateAssets>all</PrivateAssets>
52+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
53+
</PackageReference>
3854
</ItemGroup>
3955

4056
</Project>

DataWarehouseAutomation/DataWarehouseAutomation/DwaModel/BusinessKeyDefinition.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace DataWarehouseAutomation.DwaModel;
22

33
/// <summary>
4-
/// A Business Key, which consists of one or more components (column mappings) and has its own surrogate key.
5-
/// A Business Key is a special column, or combination of columns, that is defined separately outside of regular data item mappings.
4+
/// A business key definition is a special object that is defined as an optional property of a data object mapping.
5+
/// In other words, the business key definition can be a part of describing the relationship between a source data object and a target data object.
66
/// </summary>
77
public class BusinessKeyDefinition
88
{
@@ -14,16 +14,18 @@ public class BusinessKeyDefinition
1414
public string? Id { get; set; }
1515

1616
/// <summary>
17-
/// The optional name of the Business Key Definition.
17+
/// The optional name of the business key definition.
1818
/// </summary>
1919
[JsonPropertyName("name")]
2020
public string? Name { get; set; }
2121

2222
/// <summary>
23-
/// Items that define the Business Key e.g. the collection of columns for a Business Key.
23+
/// Items that define the Business Key e.g. the collection of columns for a business key.
24+
/// The integer value defines the order of the components in the business key definition.
25+
/// The order is significant, and is recorded as part of the tuple definition.
2426
/// </summary>
25-
[JsonPropertyName("businessKeyComponentMappings")]
26-
public List<DataItemMapping> BusinessKeyComponentMappings { get; set; } = new();
27+
[JsonPropertyName("businessKeyComponents")]
28+
public List<BusinessKeyComponents>? BusinessKeyComponents { get; set; }
2729

2830
/// <summary>
2931
/// An optional label for the end result e.g. the target business key attribute.
@@ -33,14 +35,14 @@ public class BusinessKeyDefinition
3335
public string? SurrogateKey { get; set; }
3436

3537
/// <summary>
36-
/// Free-form and optional classification for the Business Key for use in generation logic (evaluation).
38+
/// Free-form and optional classification for the business key for use in generation logic (evaluation).
3739
/// </summary>
3840
[JsonPropertyName("classifications")]
3941
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
4042
public List<DataClassification>? Classifications { get; set; }
4143

4244
/// <summary>
43-
/// The collection of extension Key/Value pairs.
45+
/// The collection of extension key/value pairs.
4446
/// </summary>
4547
[JsonPropertyName("extensions")]
4648
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
namespace DataWarehouseAutomation.DwaModel;
2+
3+
/// <summary>
4+
/// This object captures the cardinality and ordinality of a relationship.
5+
/// Cardinality refers to the uniqueness of data values contained in a column (attribute) of a database table.
6+
/// It defines the number of occurrences of one entity that are associated with the number of occurrences of another entity through a relationship.
7+
/// </summary>
8+
public class Cardinality
9+
{
10+
/// <summary>
11+
/// Optional identifier as a string value to allow various identifier approaches.
12+
/// </summary>
13+
[JsonPropertyName("id")]
14+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
15+
public string? Id { get; set; }
16+
17+
/// <summary>
18+
/// Optional information to name a certain cardinality construct.
19+
/// For example one-to-one, one-to-many, or many-to-many.
20+
/// E.g. one-to-one could be defined as {"fromRange": {"min": "1", "max": "1"}, "toRange": {"min": "1", "max": "1"}}.
21+
/// </summary>
22+
[JsonPropertyName("name")]
23+
public string? Name { get; set; }
24+
25+
/// <summary>
26+
/// The 'from' component in the cardinality, e.g. the '1' in 1 to many.
27+
/// </summary>
28+
[JsonPropertyName("fromRange")]
29+
public CardinalityRange? FromRange { get; set; } = new CardinalityRange { Min = "1", Max = "1" };
30+
31+
/// <summary>
32+
/// The 'to' component in the cardinality, e.g. the 'many' in 1 to many.
33+
/// </summary>
34+
[JsonPropertyName("toRange")]
35+
public CardinalityRange? ToRange { get; set; } = new CardinalityRange { Min = "1", Max = "N" };
36+
37+
/// <summary>
38+
/// Free-form and optional classification for the Cardinality for use in generation logic (evaluation).
39+
/// </summary>
40+
[JsonPropertyName("classifications")]
41+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
42+
public List<DataClassification>? Classifications { get; set; }
43+
44+
/// <summary>
45+
/// The collection of extension Key/Value pairs.
46+
/// </summary>
47+
[JsonPropertyName("extensions")]
48+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
49+
public List<Extension>? Extensions { get; set; }
50+
51+
/// <summary>
52+
/// Free-format notes.
53+
/// </summary>
54+
[JsonPropertyName("notes")]
55+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
56+
public string? Notes { get; set; }
57+
58+
#region Methods
59+
/// <summary>
60+
/// Use this method to assert if two Cardinalities are the same, based on their Ids.
61+
/// </summary>
62+
/// <param name="obj"></param>
63+
/// <returns>True if the Cardinalities are the same, based on their Ids</returns>
64+
public override bool Equals(object? obj)
65+
{
66+
var other = obj as Cardinality;
67+
return other?.Id == Id;
68+
}
69+
70+
/// <summary>
71+
/// Override to get a hash value that represents the identifier.
72+
/// </summary>
73+
/// <returns>A 32-bit signed integer hash code</returns>
74+
public override int GetHashCode() => (Id?.GetHashCode()) ?? 0;
75+
76+
/// <summary>
77+
/// String override so that the object returns its value ('Name').
78+
/// When an instance of this class is passed to a method that expects a string, the ToString() method will be called implicitly to convert the object to a string, and the value of the "Name" property will be returned.
79+
/// </summary>
80+
/// <returns>The Name</returns>
81+
public override string ToString()
82+
{
83+
return Name ?? string.Empty;
84+
}
85+
#endregion
86+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace DataWarehouseAutomation.DwaModel;
2+
3+
/// <summary>
4+
/// The possible range for a from/to component for the cardinality.
5+
/// For example "min": "1", "max": "N"
6+
/// This way, you can define "at least 1 to many". Or "0 or 1 to 1".
7+
/// </summary>
8+
public class CardinalityRange
9+
{
10+
[JsonPropertyName("min")]
11+
public string? Min { get; set; }
12+
13+
[JsonPropertyName("max")]
14+
public string? Max { get; set; }
15+
}

DataWarehouseAutomation/DataWarehouseAutomation/DwaModel/DataItem.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
namespace DataWarehouseAutomation.DwaModel;
22

3+
/// <summary>
4+
/// Data items belong to data objects or data object queries. This means that a given data item always has a parent object.
5+
/// They describe the individual elements, such as the columns in a table or headers in a file.
6+
/// </summary>
37
public class DataItem : IDataItem
48
{
59
/// <summary>
@@ -14,7 +18,7 @@ public class DataItem : IDataItem
1418
public string Name { get; set; } = "NewDataItem";
1519

1620
/// <summary>
17-
/// The data object to which the data item belongs. This can be used to construct fully qualified names.
21+
/// The <see cref="IDataObject"/> to which the data item belongs. This can be used to construct fully qualified names.
1822
/// </summary>
1923
[JsonPropertyName("dataObject")]
2024
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]

DataWarehouseAutomation/DataWarehouseAutomation/DwaModel/DataItemMapping.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace DataWarehouseAutomation.DwaModel;
22

33
/// <summary>
4-
/// The individual column-to-column mapping.
4+
/// The individual <see cref="IDataItem"/> to <see cref="IDataItem"/>, column-to-column mapping.
55
/// </summary>
66
public class DataItemMapping
77
{
@@ -13,7 +13,7 @@ public class DataItemMapping
1313
public string? Id { get; set; }
1414

1515
[JsonPropertyName("sourceDataItems")]
16-
public List<IDataItem> SourceDataItems { get; set; } = new();
16+
public List<IDataItem> SourceDataItems { get; set; } = [];
1717

1818
[JsonPropertyName("targetDataItem")]
1919
public IDataItem TargetDataItem { get; set; } = new DataItem() { Name = "newTargetDataItem" };

DataWarehouseAutomation/DataWarehouseAutomation/DwaModel/DataItemQuery.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ public class DataItemQuery : IDataItem
1616
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
1717
public string Name { get; set; } = string.Empty;
1818

19-
// convenience property for parent, derived on json load, never stored in the json file
20-
// Can be either a DataObject or a DataQuery when the DataQuery is a DataItem level thing
19+
/// <summary>
20+
/// The <see cref="IDataObject"/> to which the data item belongs. This can be used to construct fully qualified names.
21+
/// </summary>
2122
[JsonIgnore(Condition = JsonIgnoreCondition.Always)]
2223
public IDataObject? DataObject { get; set; }
2324

DataWarehouseAutomation/DataWarehouseAutomation/DwaModel/DataObject.cs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
/// <summary>
44
/// The definition of a data set, file, or table.
5-
/// The Data Object can be the 'source' or 'target' in a Data Object Mapping.
6-
/// A Data Object which acts as target in one mapping, can be a source in another mapping, building up the data logistics lineage.
5+
/// The Data Object can be the 'source' or 'target' in a <see cref="DataObjectMapping"/>.
6+
/// A Data Object which acts as target in one mapping, can be a source in another mapping,
7+
/// building up the data logistics lineage.
78
/// </summary>
89
public class DataObject : IMetadata, IDataObject
910
{
@@ -35,7 +36,24 @@ public class DataObject : IMetadata, IDataObject
3536
public DataConnection? DataConnection { get; set; }
3637

3738
/// <summary>
38-
/// Free-form and optional classification for the Data Object for use in ETL generation logic (evaluation).
39+
/// The definition of the Business Key(s) for the Data Object.
40+
/// Being able to record the business key definition
41+
/// This serves multiple purposes, but one of them is to support defining a series of business key definitions against the source data object, and reuse these across different data object mappings.
42+
/// The order is stored as well, because in some cases the order of keys is meaningful.
43+
/// </summary>
44+
[JsonPropertyName("businessKeyDefinitions")]
45+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
46+
public List<BusinessKeyDefinitions>? BusinessKeyDefinitions { get; set; }
47+
48+
/// <summary>
49+
/// Any relationship to other data objects.
50+
/// </summary>
51+
[JsonPropertyName("relationships")]
52+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
53+
public List<Relationships>? Relationships { get; set; }
54+
55+
/// <summary>
56+
/// Free-form and optional classification for the Data Object.
3957
/// </summary>
4058
[JsonPropertyName("classifications")]
4159
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]

0 commit comments

Comments
 (0)