Skip to content

Commit

Permalink
Update docs on attribute overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCockx authored Dec 16, 2024
1 parent 9b917aa commit 0ce292e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/rune-modelling-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,28 @@ type Vehicle extends VehicleFeature:
vehicleClassification VehicleClassificationEnum (1..1)
```
An attribute can also be *overridden* to restrict the type or cardinality, or to add annotations to it, by using the `override` keyword:
``` Haskell
type VehicleReport:
vehicleRegistrationID string (1..1)
firstRegistrationDate date (0..1)
engineType EngineTypeEnum (0..1)
type EuropeanParliamentReport extends VehicleReport:
override vehicleRegistrationID Max40Text (1..1) // Change type to compatible string type limited to 40 characters
[ruleReference VehicleRegistrationID] // Add rule reference
override firstRegistrationDate date (1..1) // Change cardinality to be required
[ruleReference FirstRegistrationDate] // Add rule reference
override engineType EngineTypeEnum (1..1) // Change cardinality to be required
[ruleReference EngineType] // Add rule reference
// New attributes can be a added after all overrides
vehicleClassificationType VehicleClassificationEnum (1..1)
[ruleReference VehicleClassificationType]
euroEmissionStandard string (1..1)
[ruleReference EuroEmissionStandard]
```
{{< notice info "Note" >}}
For clarity purposes, the documentation snippets omit the annotations and definitions that are associated with the data types and attributes, unless the purpose of the snippet is to highlight some of those features.
{{< /notice >}}
Expand Down

0 comments on commit 0ce292e

Please sign in to comment.