Learn more about the Concerto modeling language and its runtime at concerto.accordproject.org
What you’ll build
You’ll create a simpleHelloWorld concept with a name property. This model will serve as the foundation for your template in the following modules.
Creating your first model
Follow these steps in the Concerto Model editor to build your data model:Define the model namespace
Open the Concerto Model editor and define the model namespace. The namespace provides a unique identifier for your model.The namespace follows the format
name@version, which helps organize and version your models.Create a concept
Define a new concept called
HelloWorld. Concepts are the building blocks of Concerto models and represent data structures.Add the template decorator
Add the Decorators provide metadata about your model elements and enable special behaviors.
@template decorator to the concept. This decorator marks the concept as a template data model.Add a string property
Add a string property called The
name to store the name value.o prefix indicates this is an optional property. You can also use --> for relationships or add modifiers like [] for arrays.Complete example
Here’s the complete model you’ve created:Understanding the model
Your model now defines:- Namespace:
[email protected]- uniquely identifies this model - Concept:
HelloWorld- the data structure for your template - Decorator:
@template- marks this as a template model - Property:
nameof typeString- the data field that will be used in your template
Real-world example
Here’s a more complex example from a product announcement template:Next steps
Now that you’ve defined your data model, proceed to Module 2: TemplateMark templates to create a template that uses this model.Key concepts
What is a namespace?
What is a namespace?
A namespace provides a unique identifier for your model and helps prevent naming conflicts. It follows semantic versioning (e.g.,
[email protected]) so you can evolve your models over time.What are concepts?
What are concepts?
Concepts are classes that define data structures in Concerto. They can contain properties, relationships to other concepts, and decorators that add metadata.
What are decorators?
What are decorators?
Decorators are annotations that provide metadata about model elements. The
@template decorator indicates that this concept represents template data, enabling special handling by the template engine.What property types are available?
What property types are available?
Concerto supports various property types including
String, Integer, Double, Boolean, DateTime, and custom concepts. You can also create arrays and optional fields.