Skip to content

Add TechnicalDataBuilder with ECLASS/IEC-61360 validation and Template Integration#25

Merged
Freezor merged 5 commits intomainfrom
codex/implement-technicaldatabuilder-for-aas-project
Mar 28, 2026
Merged

Add TechnicalDataBuilder with ECLASS/IEC-61360 validation and Template Integration#25
Freezor merged 5 commits intomainfrom
codex/implement-technicaldatabuilder-for-aas-project

Conversation

@Freezor
Copy link
Copy Markdown
Owner

@Freezor Freezor commented Mar 28, 2026

Motivation

  • Technical parameters were previously represented as unstructured properties, causing inconsistent implementations and risk of invalid configurations for DPP scenarios.
  • The project needs a reusable, IDTA-aligned builder that enforces ECLASS semantic mapping, IEC 61360 data type/units, and required-parameter rules at build-time.
  • Provide integrators a fluent, typed API that composes cleanly into existing AAS workflows and reduces runtime surprises by failing fast during composition.

Description

  • Added a fluent TechnicalDataBuilder with typed groups MotorPerformance and BearingCharacteristics and group-level builders such as MotorPerformanceGroupBuilder and BearingCharacteristicsGroupBuilder.
  • Introduced an integrated ECLASS mapping via TechnicalDataEclassCatalog and semantics/constants in TechnicalDataSemantics and TechnicalDataIdentifiers that use concrete IRDIs (e.g., 0173-1#02-BAF053#008 for RatedVoltage).
  • Enforced validation rules in the builder including required-parameter checks, IEC 61360 datatype checks (decimal constraints), allowed-unit checks (e.g., V, A, kW, mm, 1/min), and semantic-ID/ECLASS mapping conformity, and wire-up to AAS elements using existing ReferenceFactory helpers.
  • Added AddTechnicalData extension for IShellBuilder, a runnable composition example TechnicalDataCompositionExample.BuildMotorAndBearingExampleEnvironment(), and unit tests under FluentAAS.Templates.Tests/TechnicalData exercising required-parameter, unit-conformity, semantic-ID validation and a positive build path.

Testing

  • Unit tests were added (FluentAAS.Templates.Tests/TechnicalData/TechnicalDataBuilderTests.cs) and cover the three validation categories plus a happy-path composition and example execution.
  • Attempted to run dotnet test for FluentAAS.Templates.Tests, but execution could not be completed because dotnet is not available in the environment where the rollout ran.
  • All validation logic is exercised by the test suite (missing-parameter failures, invalid-unit failures, semantic-ID mismatch failures, and successful build assertions) and is ready to run in CI or a developer environment with the .NET SDK installed.
  • The change integrates into existing AAS composition flows via AddTechnicalData and was implemented to match project naming and builder patterns so it should compile and run in the normal project toolchain.

Codex Task

Summary by CodeRabbit

  • New Features

    • Added a TechnicalData template for creating technical-data submodels
    • Support for motor performance (voltage, current, power, speed) and bearing characteristics (dimensions, limiting speed)
    • Fluent builder API and shell extension for easy composition and semantic-ID mapped validation
    • Example factory to build a motor-and-bearing environment
  • Tests

    • Added comprehensive tests for builder validation, semantic-id checks, unit validation, construction, and composition

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 28, 2026

Warning

Rate limit exceeded

@Freezor has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 41 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 2 minutes and 41 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4115c5e0-1cc0-4076-a600-27380f0505bf

📥 Commits

Reviewing files that changed from the base of the PR and between a99d976 and fa95a87.

📒 Files selected for processing (8)
  • FluentAAS/FluentAAS.Templates.Tests/TechnicalData/TechnicalDataBuilderTests.cs
  • FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataBuilder.cs
  • FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataIdentifiers.cs
  • FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataSemantics.cs
  • FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataShellBuilderExtensions.cs
  • FluentAAS/FluentAASTests.Integration/FluentAasEndToEndTests.cs
  • FluentAAS/FluentAASTests.Integration/TechnicalDataCompositionExample.cs
  • README.md

Walkthrough

Adds a new TechnicalData builder and templates: fluent APIs to compose motor performance and bearing characteristics submodels, an internal ECLASS property catalog and validators, semantic/identifier constants, an example composition, and tests covering validation and construction.

Changes

Cohort / File(s) Summary
Builder Implementation
FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataBuilder.cs
New sealed fluent builder that collects group/value assignments, validates units and semantic IDs against an internal ECLASS catalog, enforces required properties, and builds a TechnicalData submodel attached to a shell.
ECLASS Catalog & Identifiers
FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataEclassCatalog.cs, FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataIdentifiers.cs, FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataSemantics.cs
Adds an internal catalog mapping idShort → PropertyDefinition (ECLASS IRDI, XSD type, required flag, allowed units) plus public const identifier and semantic ID constants used by the builder and templates.
Shell Extension & Example
FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataShellBuilderExtensions.cs, FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataCompositionExample.cs
Extension method AddTechnicalData on IShellBuilder to start the builder; an example factory building a motor-and-bearing TechnicalData environment with semantic IDs and units.
Tests
FluentAAS/FluentAAS.Templates.Tests/TechnicalData/TechnicalDataBuilderTests.cs
New test suite verifying mandatory-parameter enforcement, invalid unit and semantic-ID rejections, successful construction with ECLASS semantics, and composition example producing one shell and one submodel.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ShellBuilder
    participant TechDataBuilder as TechnicalDataBuilder
    participant Catalog as EclassCatalog
    participant SubmodelBuilder
    participant Shell

    Client->>ShellBuilder: AddTechnicalData(id, idShort)
    ShellBuilder->>TechDataBuilder: instantiate(builder)

    Client->>TechDataBuilder: WithMotorPerformance(configure)
    Client->>TechDataBuilder: WithBearingCharacteristics(configure)
    Note over TechDataBuilder: store group assignments and semantics

    Client->>TechDataBuilder: BuildTechnicalData()
    TechDataBuilder->>TechDataBuilder: validate required groups/properties

    TechDataBuilder->>Catalog: ForIdShort(propertyId)
    Catalog-->>TechDataBuilder: PropertyDefinition

    TechDataBuilder->>Catalog: IsKnownEclassReference(irdi)
    Catalog-->>TechDataBuilder: bool

    alt Validation fails
        TechDataBuilder-->>Client: InvalidOperationException
    else Validation succeeds
        TechDataBuilder->>SubmodelBuilder: create submodel & collections
        loop For each group & property
            SubmodelBuilder->>SubmodelBuilder: Add Property (value, unit, semanticId)
        end
        SubmodelBuilder->>Shell: AddSubmodelReference(submodel)
        TechDataBuilder-->>Client: return ShellBuilder
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a TechnicalDataBuilder with ECLASS/IEC-61360 validation. It directly reflects the core purpose and scope of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/implement-technicaldatabuilder-for-aas-project

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the enhancement New feature or request label Mar 28, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataBuilder.cs (1)

85-88: Redundant validation: ValidateEclassCatalogMapping always passes.

The assignment.Definition originates from TechnicalDataEclassCatalog.ForIdShort() in UpsertDecimalProperty, so ValidateEclassCatalogMapping(assignment.Definition.EclassIrdi) will always succeed—the IRDI is guaranteed to exist in the catalog.

♻️ Consider removing redundant validation
 foreach (var assignment in group.Assignments.Values.OrderBy(x => x.Definition.IdShort, StringComparer.Ordinal))
 {
-    ValidateEclassCatalogMapping(assignment.Definition.EclassIrdi);
-
     var property = new Property(assignment.Definition.ValueType)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataBuilder.cs` around
lines 85 - 88, The call to
ValidateEclassCatalogMapping(assignment.Definition.EclassIrdi) is redundant
because assignment.Definition is created via
TechnicalDataEclassCatalog.ForIdShort() in UpsertDecimalProperty and therefore
always has a valid EclassIrdi; remove the redundant validation call from the
foreach loop in TechnicalDataBuilder (i.e., delete the
ValidateEclassCatalogMapping(...) invocation referencing
assignment.Definition.EclassIrdi) and run tests to ensure no other code relies
on its side effects.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@FluentAAS/FluentAAS.Templates.Tests/TechnicalData/TechnicalDataBuilderTests.cs`:
- Around line 92-101: The test CompositionExample_ShouldBuildEnvironment fails
because TechnicalDataCompositionExample.BuildMotorAndBearingExampleEnvironment
calls an IShellBuilder.Build() method that doesn't exist; update the builder
usage in TechnicalDataCompositionExample so it calls the correct method on
IShellBuilder (or add a Build() implementation to the IShellBuilder concrete
builder) to return the built shell/environment, ensuring the call signature and
return type match the rest of the composition code used by
CompositionExample_ShouldBuildEnvironment and any related methods that expect
the built result.
- Around line 83-89: The test currently asserts the deprecated Property.Category
("ratedVoltage.Category.ShouldBe(\"V\")"); update the test and builder so the
unit is stored on the ConceptDescription's DataSpecificationIec61360 instead:
remove the Category assertion in
FluentAAS.Templates.Tests.TechnicalData.TechnicalDataBuilderTests (the
ratedVoltage variable usage) and add an assertion that the ConceptDescription
created by TechnicalDataBuilder contains a DataSpecificationIec61360 with unit
== "V"; update TechnicalDataBuilder (the code that currently sets
Property.Category around the TechnicalDataBuilder.Create... logic) to stop
populating Property.Category and instead populate the
ConceptDescription.DataSpecificationIec61360.unit field with the unit string.

In `@FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataBuilder.cs`:
- Around line 89-96: The Property construction incorrectly stores measurement
units in Category; update TechnicalDataBuilder to remove Category =
assignment.Unit and instead attach a DataSpecificationIec61360 to the created
Property (use the Property instance created in TechnicalDataBuilder.cs)
populating the unit (assignment.Unit) and unitId (use your ReferenceFactory to
create a global unit Reference) and keep SemanticId/ValueId as-is; if a
classification is required set Category to an appropriate AAS classification
token (e.g., "PARAMETER") rather than the unit.

In
`@FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataCompositionExample.cs`:
- Around line 9-23: BuildTechnicalData() currently returns IShellBuilder which
lacks Build(), causing the fluent chain to fail; change BuildTechnicalData() to
return an interface that exposes the environment-level Build() (e.g., return
IEnvironmentBuilder or a new composite interface exposing Build()), update the
implementation of BuildTechnicalData() to hand back the environment builder
instance instead of IShellBuilder, and adjust any interface definitions and
callers (references: BuildTechnicalData(), IShellBuilder, IEnvironmentBuilder,
Build()) so the final .Build() call is available in the fluent chain.

---

Nitpick comments:
In `@FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataBuilder.cs`:
- Around line 85-88: The call to
ValidateEclassCatalogMapping(assignment.Definition.EclassIrdi) is redundant
because assignment.Definition is created via
TechnicalDataEclassCatalog.ForIdShort() in UpsertDecimalProperty and therefore
always has a valid EclassIrdi; remove the redundant validation call from the
foreach loop in TechnicalDataBuilder (i.e., delete the
ValidateEclassCatalogMapping(...) invocation referencing
assignment.Definition.EclassIrdi) and run tests to ensure no other code relies
on its side effects.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 67e2420c-eb49-45e5-9e77-0fb557ec51f2

📥 Commits

Reviewing files that changed from the base of the PR and between a419797 and a7c7dd0.

📒 Files selected for processing (7)
  • FluentAAS/FluentAAS.Templates.Tests/TechnicalData/TechnicalDataBuilderTests.cs
  • FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataBuilder.cs
  • FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataCompositionExample.cs
  • FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataEclassCatalog.cs
  • FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataIdentifiers.cs
  • FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataSemantics.cs
  • FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataShellBuilderExtensions.cs

Comment on lines +83 to +89
var ratedVoltage = motorGroup.Value!
.OfType<Property>()
.Single(x => x.IdShort == TechnicalDataIdentifiers.RatedVoltage);

ratedVoltage.Value.ShouldBe("400");
ratedVoltage.Category.ShouldBe("V");
ratedVoltage.SemanticId!.Keys.Single().Value.ShouldBe(TechnicalDataSemantics.RatedVoltage);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check how Category is typically used in the AAS 3.0 library and existing codebase
rg -n -C3 'Category\s*=' --type=cs

Repository: Freezor/FluentAAS

Length of output: 3003


🌐 Web query:

AAS 3.0 Property Category field usage and IEC 61360 unit storage

💡 Result:

In AAS 3.0, the 'category' field is defined in the Referable abstract class, inherited by elements like Property. It provides meta-information about the element's class, affecting expected attributes and constraints (e.g., distinguishing measurement values). It is optional (string type, default null) and deprecated since V3.0, though still present for backward compatibility. Legacy values include PARAMETER, CONSTANT, VALUE for data elements like Properties, influencing validation (e.g., in ConceptDescription constraints referencing category, marked deprecated). IEC 61360 units for quantitative properties (e.g., dataType INTEGER_MEASURE, REAL_MEASURE) are stored in ConceptDescriptions via the DataSpecificationIec61360 template, using 'unit' (string, primary unit text) or 'unitId' (Reference to global unit identifier, e.g., IRDI). These are embedded in the semanticId-referenced ConceptDescription of the Property, not directly in the Property.value. Constraint AASc-3a-009 requires unit/unitId for measure types. The Property.valueType maps IEC data types to XSD (e.g., xs:integer for INTEGER_MEASURE).

Citations:


Remove Category field usage for unit storage; use ConceptDescription's DataSpecificationIec61360 instead.

The test asserts ratedVoltage.Category.ShouldBe("V"), but in AAS 3.0, the Category field is deprecated and meant for element classification (e.g., PARAMETER, CONSTANT, VALUE). Units should be stored in the ConceptDescription's DataSpecificationIec61360 template via the unit field, not in the Property's Category field. This applies to the builder implementation as well (TechnicalDataBuilder.cs:95).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@FluentAAS/FluentAAS.Templates.Tests/TechnicalData/TechnicalDataBuilderTests.cs`
around lines 83 - 89, The test currently asserts the deprecated
Property.Category ("ratedVoltage.Category.ShouldBe(\"V\")"); update the test and
builder so the unit is stored on the ConceptDescription's
DataSpecificationIec61360 instead: remove the Category assertion in
FluentAAS.Templates.Tests.TechnicalData.TechnicalDataBuilderTests (the
ratedVoltage variable usage) and add an assertion that the ConceptDescription
created by TechnicalDataBuilder contains a DataSpecificationIec61360 with unit
== "V"; update TechnicalDataBuilder (the code that currently sets
Property.Category around the TechnicalDataBuilder.Create... logic) to stop
populating Property.Category and instead populate the
ConceptDescription.DataSpecificationIec61360.unit field with the unit string.

Comment on lines +89 to +96
var property = new Property(assignment.Definition.ValueType)
{
IdShort = assignment.Definition.IdShort,
Value = assignment.Value,
ValueId = ReferenceFactory.GlobalSemanticReference(assignment.Definition.EclassIrdi),
SemanticId = ReferenceFactory.GlobalConceptDescription(assignment.Definition.EclassIrdi),
Category = assignment.Unit
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

IDTA Technical Data submodel template property unit storage AAS 3.0

💡 Result:

The IDTA Technical Data submodel template is the "Generic Frame for Technical Data for Industrial Equipment in Manufacturing" (IDTA number 02003, version 2.0), published by the Industrial Digital Twin Association (IDTA) for use with Asset Administration Shell (AAS) 3.0. It provides an interoperable structure for technical properties of assets, using semantic dictionaries like ECLASS and IEC CDD. Properties in this submodel are defined as AAS Property elements with semanticIds referencing external concept descriptions (e.g., IRDIs from ECLASS). For quantitative properties (e.g., dataType INTEGER_MEASURE, REAL_MEASURE), the unit is specified via the IEC 61360 data specification template (IDTA-01003-a), which includes attributes: - unit: string for unit in text (e.g., "m³" for storage volume). - unitId: Reference to a unit concept (e.g., IRDI for cubic meter). "Storage" likely refers to a property like storage capacity (e.g., ECLASS property for volume), where the value has a unit such as cubic meters (m³). Example structure: - Property idShort: "storageCapacity" - semanticId: IRDI (e.g., 0173-1#02-BAF188#007 for gross volume) - value: e.g., "10" - hasDataSpecification: DataSpecificationIec61360 with unit="m³", unitId=reference to unit concept. This follows AAS 3.0 metamodel (IDTA-01001), where units are part of embedded data specs for interoperability. Official spec downloadable from IDTA site; GitHub repo at admin-shell-io/submodel-templates for JSON/UML/AASX files.

Citations:


🏁 Script executed:

# First, find the Property class definition
find . -type f -name "*.cs" | head -20

Repository: Freezor/FluentAAS

Length of output: 1180


🏁 Script executed:

# Search for Property class definition
rg "class Property" -A 10 --max-count 5

Repository: Freezor/FluentAAS

Length of output: 43


🏁 Script executed:

# Look for IEC 61360 or DataSpecification references related to units
rg -i "iec.?61360|dataspecification|unit" --max-count 20

Repository: Freezor/FluentAAS

Length of output: 10802


🏁 Script executed:

# Check if there are comments explaining Category usage in this file
cat -n FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataBuilder.cs | head -100

Repository: Freezor/FluentAAS

Length of output: 4192


🏁 Script executed:

# Search for other Category assignments to see if this is a pattern
rg "Category\s*=" -B 2 -A 2 --max-count 10

Repository: Freezor/FluentAAS

Length of output: 2220


Store unit information using IEC 61360 data specification instead of the Category field.

The Category field per AAS 3.0 should contain classification values (e.g., PARAMETER, CONSTANT, VARIABLE), not measurement units. IDTA Technical Data (IDTA-02003 v2.0) specifies units must be stored via DataSpecificationIec61360 with unit (string) and unitId (Reference) attributes. The current implementation on lines 89–96 violates this requirement by assigning the unit string directly to Category. This breaks IDTA compliance and causes misinterpretation of property semantics by AAS consumers.

Consider:

  • Adding DataSpecificationIec61360 (or embedded data specification) to the Property with proper unit and unitId fields
  • Removing Category = assignment.Unit or setting it to an appropriate classification value if needed
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataBuilder.cs` around
lines 89 - 96, The Property construction incorrectly stores measurement units in
Category; update TechnicalDataBuilder to remove Category = assignment.Unit and
instead attach a DataSpecificationIec61360 to the created Property (use the
Property instance created in TechnicalDataBuilder.cs) populating the unit
(assignment.Unit) and unitId (use your ReferenceFactory to create a global unit
Reference) and keep SemanticId/ValueId as-is; if a classification is required
set Category to an appropriate AAS classification token (e.g., "PARAMETER")
rather than the unit.

Comment thread FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataCompositionExample.cs Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7c7dd06b9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

.WithWidth(20m, "mm", TechnicalDataSemantics.Width)
.WithLimitingSpeed(6500m, "1/min", TechnicalDataSemantics.LimitingSpeed))
.BuildTechnicalData()
.Build();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Complete shell chain before invoking Build()

BuildTechnicalData() returns IShellBuilder, but IShellBuilder has no Build() method (it only exposes CompleteShellConfiguration() and Parent). Chaining .Build() directly here makes this example uncompilable and breaks CompositionExample_ShouldBuildEnvironment, so callers cannot execute the sample as written unless they first return to AasBuilder.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataCompositionExample.cs (1)

11-12: Consider extracting sample identifiers to named constants for maintainability.

The URNs and display name are currently inline literals; moving them to local constants would reduce typo risk if this sample evolves.

♻️ Suggested refactor
 public static IEnvironment BuildMotorAndBearingExampleEnvironment()
 {
+    const string aasId = "urn:aas:example:drivetrain:1000";
+    const string aasName = "DriveTrainAAS";
+    const string technicalDataSubmodelId = "urn:aas:submodel:technical-data:drivetrain:1000";
+
     var aasBuilder = AasBuilder.Create();

-    aasBuilder.AddShell("urn:aas:example:drivetrain:1000", "DriveTrainAAS")
-              .AddTechnicalData("urn:aas:submodel:technical-data:drivetrain:1000")
+    aasBuilder.AddShell(aasId, aasName)
+              .AddTechnicalData(technicalDataSubmodelId)
               .WithMotorPerformance(motor => motor
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataCompositionExample.cs`
around lines 11 - 12, Extract the inline literal identifiers used in the
aasBuilder.AddShell(...).AddTechnicalData(...) chain into local named constants
(e.g., const string ShellId, const string ShellDisplayName, const string
TechnicalDataSubmodelId) and replace the raw literal strings with those
constants; update the AddShell call to use ShellId and ShellDisplayName and the
AddTechnicalData call to use TechnicalDataSubmodelId so the identifiers are
centralized and less error-prone.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataCompositionExample.cs`:
- Around line 11-12: Extract the inline literal identifiers used in the
aasBuilder.AddShell(...).AddTechnicalData(...) chain into local named constants
(e.g., const string ShellId, const string ShellDisplayName, const string
TechnicalDataSubmodelId) and replace the raw literal strings with those
constants; update the AddShell call to use ShellId and ShellDisplayName and the
AddTechnicalData call to use TechnicalDataSubmodelId so the identifiers are
centralized and less error-prone.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9a044ec3-2422-4aed-bbfd-69ee42769d53

📥 Commits

Reviewing files that changed from the base of the PR and between a7c7dd0 and a99d976.

📒 Files selected for processing (1)
  • FluentAAS/FluentAAS.Templates/TechnicalData/TechnicalDataCompositionExample.cs

@Freezor Freezor merged commit 9cb54b9 into main Mar 28, 2026
3 checks passed
@Freezor Freezor deleted the codex/implement-technicaldatabuilder-for-aas-project branch March 28, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant