Our goal is to build a mapping between the schema that has been implemented in the caaml_data
database and our small portion of the EAWS CAAML schema CAAMLv5_BulletinEAWS_GA.xsd
.
Open Hale Studio for the goal of this section:
If we want to work with the GeoAvalanche server in order to upload the mapping configuration of CAAML as new GML application schema datastore we have to double check that Hale is properly set up and the compatibility mode is on. Select Transformation → Compatibility mode → GeoServer from the menu. You should see Geo appearing close to a green tick mark icon at the status bar on the bottom right side:
Things can be a little more complex for complex relations like Bulletin, BulletinMeasurements and LocationCollection, just to mention few, but the concept of mapping would still continue to be valid.
Define the source as a JDBC connection:
Once imported the source then edit the relevant source types of interest:
And choice what you are interested in mapping, for now just caaml_Region
is fine:
Define the source as a file resource (the modified XSD CAAML schema is part of the data package):
Then click on Next
Finally click on Finish
We will now define the caaml_Region → Region relation (our case is the simplest one):
Select the caaml_Region
type in the Source section of the Schema Explorer view;
Select the Region
type in the Target section of the Schema Explorer view
Click on the blue bi-directional arrow icon in between the Source and Target sections of the Schema Explorer view and select Retype from the popup menu
Verify from the popup window that the entities are those previously selected and click on the button Next
and then Finish
on the next window.
A new retype mapping will be added in the Assignment view.
Once the type relation have been assigned, it is time to configure the relations between source and target properties.
The mapping between the source and target is not completely done because we want more. Specifically we'd like to have a reword of the GML identification id
of the Region feature. Effectively we want to end up to something like this:
<caaml:Region gml:id="region.IT1">
In order to achieve that we have to add a new mapping property:
ID
attribute from the Source type of the Schema Explorer view and finally select id
attribute from the Target type of the Schema Explorer view:then click on Formatted String
item
double check source and target variables then click Next
assign the format pattern for the retype which is in our case region.{ID}
you finally should see a new mapping item in the Alignment view
We want then to configure the remaining properties as a simple pass through from source to target type. So we can see how it works for one of them and then apply the concept to the rest.
Let's apply the Rename to description
:
description
attribute from the Source type of the Schema Explorer view and finally select description
attribute from the Target type of the Schema Explorer view:then click on Rename
item
double check source and target property then click Next
Leave parameters as it is and click Finish
You should now see the Alignment view updated with the Rename mapping for description
. Then it's just a matter of applying the same to all properties from the source type.