Meta-Models
What is a Meta-Model?
Meta-models are data-structures that reflect type systems. The data-structures are represented as OWL individuals. They are called meta-models because they are instance data that describes type data. These data-structures can then be used for a variety of purposes, which include:
- Create Java objects that mirror the meta-model
- Instantiate the meta-model with data that represents a particular schema
- Write rules that transform data in one meta-model to data in another meta-model
Why would I want to develop a Meta-Model?
Whenever you have a type of raw data source that has not been seen before by ComparaGrid, you will need to develop a new Meta-Model. Several types of data will be handled by the core project team. These include:
- SQL Databases
- Tab-delimited Files
- BioMart
You should first see if your type of data is already covered. If it is not, then to use our tools to expose your data to the Fluxion stack, you will need to develop a meta-model.
Developing a Meta-Model for Fluxion
It is very easy to develop a meta-model. A meta-model is just a normal OWL ontology. You can use a tool such as Protégé to build the ontology. It should contain concepts which map to the different types in your model. For example, the SQL ontology has OWL classes for concepts such as Table, Field and Key.
The more detailed your meta-model is, the more the Fluxion tool support can do sensible optimisations to generated code. In the case of SQL, clearly Table and Field are disjoint concepts. So, in the OWL, it is important to capture this by making the classes disjoint.
Once you are happy with your meta-model, you should create a maven module that contains this meta-model so it is subsequently available as a dependency. Typically, this module qould be named after the thing being created - for example, "sql-meta-owl", "biomart-meta-owl" etc. Within this artifact, you should place the OWL file under src/main/owl and under a directory which captures an appropriate name for you model - so for example, the OWL file for SQL is placed in the directory src/main/owl/net/sourceforge/fluxion/datapublisher/sql/meta. The second half of this directory will become the root package name for code generated from your meta-model
What next?
Your meta-model is now created, so you can take advantage of the autogeneration facililties the Fluxion stack offers. But if you've needed to develop your own datasource meta-model, you may well need to also develop a Database Management System support module for your datasource. We describe how to do this in Adding support for a new DBM. Or, if you have already done this or one is already available, take a look back at Exposing a Datasource.