Geoserver 2.27, AppSchema extension
Error: “Error applying mapping with targetAttribute sam:relatedObservation Feature type http://www.opengis.net/om/2.0:OM_Observation not found. Has the data access been registered in DataAccessRegistry?”
Short questions: When I search for “DataAccessRegistry” in the documentation, the only result is the “Data Access Integration” page. I have followed the instructions and get the error above. What is the “DataAccessRegistry”?
-------------------------------
Detailed explanation of the background to the error:
I have working WFS services that are configured with a PostGIS datastore and AppSchema feature chaining. Now I need to add new functionality following OGC Observations & Measurements (O&M, https://www.ogc.org/publications/standard/om/). The new layer provides om:OM_Observation as WFS (tested, works fine), also based on PostGIS and AppSchema. The path to the mapping file is workspaces/om/om_Observation.xml
In addition to the stand-alone service, I try to provide om:OM_Observation as part of the feature (borehole) on which the observation is made (in-band, as the schema does not allow out-of-band):
<wfs:member>
<bh:some_borehole_content/>
<sam:relatedObservation>
<om:OM_Observation>
(observation content)
</om:OM_Observation>
</sam:relatedObservation>
(possibly more sam:realtedObservation-s)
<bh:more_borehole_content)
</wfs:member>
This is my datastore configuration in the AppSchema mapping file for the referencing feature (borehole). The first datastore is the main one for the borehole AppSchema mapping, the second datastore refers to the mapping file of the OM_Observation layer, whose features I want to chain from the borehole mapping. I needed several attempts to get the path in the latter correct. Thus, I know that at least the directory that contains the mapping file om_Observation.xml is correct and recognised.
<sourceDataStores>
<DataStore>
<id>datastore</id>
<parameters>
<Parameter>
<name>dbtype</name>
<value>postgisng</value>
</Parameter>
<Parameter>
<name>host</name>
<value>${xyz.host}</value>
</Parameter>
<Parameter>
<name>port</name>
<value>${xyz.port}</value>
</Parameter>
<Parameter>
<name>database</name>
<value>${xyz.database}</value>
</Parameter>
<Parameter>
<name>user</name>
<value>${xyz.user}</value>
</Parameter>
<Parameter>
<name>passwd</name>
<value>${xyz.passwd}</value>
</Parameter>
<Parameter>
<name>schema</name>
<value>${xyz.schema}</value>
</Parameter>
<Parameter>
<name>Expose primary keys</name>
<value>true</value>
</Parameter>
</parameters>
</DataStore>
<DataStore>
<id>Observation</id>
<parameters>
<Parameter>
<name>directory</name>
<value>file:../../workspaces/om/</value>
</Parameter>
</parameters>
<isDataAccess>true</isDataAccess>
</DataStore>
</sourceDataStores>
In the borehole mapping file, the feature chaining to OM_Observation is defined like this:
<AttributeMapping>
<targetAttribute>sam:relatedObservation</targetAttribute>
<sourceExpression>
<inputAttribute>BoreholeID</inputAttribute>
<linkElement>if_then_else(Observationexists, 'om:OM_Observation', Expression.NIL)</linkElement>
<linkField>FEATURE_LINK</linkField>
</sourceExpression>
<isMultiple>true</isMultiple>
</AttributeMapping>
As long as the request only contains boreholes that have no related observation, everything works fine. However, when geoserver encounters a borehole with related observation, I get the following error: “Error applying mapping with targetAttribute sam:relatedObservation Feature type http://www.opengis.net/om/2.0:OM_Observation not found. Has the data access been registered in DataAccessRegistry?”
What is the “DataAccessRegistry”? Where else, in addition to the datastore definitions, do I have to register the data access? When I search for “DataAccessRegistry” in the documentation, the only result is the “Data Access Integration” page, which is the documentation page that I have cited above and which I followed.
For the sake of completeness, the mapping of the target attribute is:
<FeatureTypeMapping>
<sourceDataStore>datastore</sourceDataStore>
<sourceType>borehole_om_observation</sourceType>
<targetElement>om:OM_Observation</targetElement>
<AttributeMapping>
<targetAttribute>FEATURE_LINK</targetAttribute>
<sourceExpression>
<OCQL>BoreholeID</OCQL>
</sourceExpression>
</AttributeMapping>
Many thanks in advance for any help on this problem.
Henning