Skip to main content

One post tagged with "metamodel"

View All Tags

Metamodels 2024.3.9

· 5 min read
Koen De Cock
Koen De Cock
R&D Engineer

Resources

This version introduces a new expansion-resource ontology-metamodel-expanders, which is included in the metamodel stack.

ResourceVersion
nsx-metamodel-stack2024.3.9

Changes

Expanders 2024.3.x introduce the ontology-metamodel-expanders. These expanders have been to made to replace the metamodel-expanders. They use the ontology-based metamodel directly instead of first requiring the GenerateMetamodelApplication transmuter.

Different Project Structure

The new expanders generate a simplified project.

  • The different submodules for each component/ontology have been merged. There is now a single {ontology}-model submodule for each ontology
  • The onion-spec classes have been moved to the test-support module.
  • Harvesting ext files works differently. There are no ext/gen directories. Instead, the expanders harvest every file that was not expanded. The project contains a number of .harvestInclude files, which contain glob patterns for which files to harvest.
  • The expanders module has been removed. Instead, expanders should be implemented in a separate project similar to regular expander projects.

Merged with CompositeBuilder Expanders

Before, it was necessary to expand with model-builder-expanders in a separate project to generate helper classes for transmuters. These expanders have now been merged into the ontology-metamodel-expanders so that this is no longer needed.

Profiles

The new expanders make use of profiles to configure cross-cutting concerns. The Standard Metamodel enables every feature, but it is possible to create new profiles if necessary.

<dataResource type="expansionControl::ExpansionProfile">
<profile name="Standard Metamodel">
<tags>
<tag>#meta.maven</tag>
<tag>#meta.xml</tag>
<tag>#meta.transmutation</tag>
</tags>
</profile>
</dataResource>

XML and XSD

The expanders generate XSD files to describe the ElementClass XML files. The default namespace is https://schemas.normalizedsystems.org/xsd/${ontology}/${version}, which can be modified with the meta.xml.namespace option on ontology. If it contains ${version}, this will be replaced with the actual version.

There are also some changes to the XML representation.

  • References are represented as text-content with the full functional key.
  • Exported XML files have one or more xmlns attributes. In case of mixed metamodels, the XML tags can contain prefixes.

The XMLReaders are implemented to be backwards compatible (they can read both old and new formats).

Miscellaneous

  • MappingContext: Now uses Optional instead of Option. There is an option meta.compatibility.mappingContext.option for backwards compatibility.
  • Dropped support for valueFieldTypes. Attributes now only support DataTypes with String, Boolean or Integer.
  • Dropped DataRefConverter. Keys can be parsed with a method on the {element}DataRef class.
  • Dropped CompositeRegistrar. This was not used.
  • Dropped OptionConverter.
  • CompositeScanner now also scans aggregate relations, e.g. Application -> Component.
  • SpecBuilders no longer support embedding parent specs into the child spec.
  • Now uses dataResource notation instead of _data.xml for most DataResources.
  • expansion directory uses expansionMetamodel name
  • Ontologies now have versions, and imported ontologies without versions are interpreted as being expanded with older expanders.