ConceptDeclaration generation

What is the best way to use a generator to produce ConceptDeclarations?


I have a table schema definition language with with two concepts: ColumnDefinition (e.g., with name and type) and SchemaDefinition (containing ColumnDefinitions). The SchemaDefinition concept is rootable, the ColumnDefinition is not.

Given instances of these concepts, I'd like to generate two types of concept declarations:
  • table entries (with children for each of the columns)
  • tables (containing the table entries)

The table concepts should be rootable, the table entry concept should not.

What I've tried

I've tried creating a "root mapping rule" for the SchemaDefinition concept with a "new root template" for Concept. However, I get a "Not rootable concept added as root" error. What does this error mean?

I can write template fragments for both SchemaDefinition and ColumnDefinition that produce ConceptDeclarations, however I'm not sure how to have the generator use these.

Please let me know if you have any questions.
1 comment
Comment actions Permalink
First of all, my question is: are you sure you have to create instances of ConceptDeclarations? For me it seems like if you have to create Table instances for each SchemaDefinition then you should define somewhere a concept for Table and then use it in generator inside root mapping rule like:

root mapping rules:      
  concept SchemaDefinition            --> map_SchemaDefinition 

  inheritors false       
  condition <always>     
  keep input root default
where map_SchemaDefinition is an instance of Table concept.

Please sign in to leave a comment.