Skip to main content

Data Resources

DataResources are data files in expansion-resources. When a developer adds an expansion-resource to their expansionSettings, the data from the DataResources will be available to the model. Uses can vary from parts of the model, like ValueTypes, to technical data for the expansion, like ModelLoadingListeners

The functionality of different data types will be explained below, but first we'll focus on how to add data resource files to the expansion-resource.

Data Resource Files

Data resources are XML files which are packaged in an expansion-resource.

A DataResource file looks like this:

<dataResource type="elements::Technology">
<technology name="HSQLDB">
<concernType name="DATABASE"/>
<technology name="POSTGRESQL">
<concernType name="DATABASE"/>
<description>PostgreSQL Database</description>
  • The root tag should be dataResource and should contain a type attribute. This type refers to the ElementType.
  • The files should be placed in a resources directory so that they are included in the build. Pick a subdirectory data/<your-subdir> that is unique for your expansion-resource to avoid any classpath collisions (can be problematic during tests).

If everything went correctly, you should see the dataResources appear in the target/classes/expansionResource.xml file after building:

<expansionResource name="org.example:example-expanders">


To test if the data has been configured correctly, we can call the validate-data mojo:


This will try to load the configuration during the maven verify phase to check if the data can be loaded correctly.

It might be necessary to add a dependency on prime-data if the data references predefined data (such as standard layerTypes):