Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- See link between 1 SO_Soil and multiple soHorizon
- 1 SO_Soil -> *soHorizon
- FileName: soil_SO_Soil.xml
- OUTPUT:
- <wfs:member>
- <soil:SO_Soil gml:id="soil.so_soil.45108">
- <gml:description>WOSIS profile code AO 1448_P227/59</gml:description>
- <gml:identifier codeSpace="http://www.landcareresearch.co.nz">http://lab.scinfo.org.nz/soil-data-ie/id/isric/soil/so_soil/45108</gml:identifier>
- <soil:soHorizon href="77612"/>
- <soil:soHorizon href="77613"/>
- <soil:soHorizon href="77614"/>
- <soil:soHorizon href="77615"/>
- <soil:soHorizon href="77616"/>
- <soil:soHorizon href="77617"/>
- </soil:SO_Soil></wfs:member>
- DATABASE:
- profile_id[PK],dataset,code
- 45108;"AfSP-1.2";"AO SOTER_P.52/57"
- 45108;"AfSP-1.2";"AO 1448_P120/59"
- 45108;"AfSP-1.2";"AO 1446_P53/57"
- Then the horizon table:
- profile_layer_id[PK],profile_id_fk,code,upper,lower
- 77612;45108;"Ap";0;21
- 77613;45108;"E1";21;35
- 77614;45108;"E2";35;56
- PROBLEM:
- If this happen:
- wfs:member><soil:SO_Soil gml:id="profile_layer.1"/>
- </wfs:member><wfs:member><soil:SO_Soil gml:id="profile_layer.2"/>
- </wfs:member>
- Make a service tomcat7 restart, this is probably caused by some problem reading the DB
- -->
- <?xml version="1.0" encoding="UTF-8"?>
- <as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd">
- <namespaces>
- <Namespace><prefix>gml</prefix><uri>http://www.opengis.net/gml/3.2</uri></Namespace>
- <Namespace><prefix>om</prefix><uri>http://www.opengis.net/om/2.0</uri></Namespace>
- <Namespace><prefix>sam</prefix><uri>http://www.opengis.net/sampling/2.0</uri></Namespace>
- <Namespace><prefix>sams</prefix><uri>http://www.opengis.net/samplingSpatial/2.0</uri></Namespace>
- <Namespace><prefix>xlink</prefix><uri>http://www.w3.org/1999/xlink</uri></Namespace>
- <Namespace><prefix>xsi</prefix><uri>http://www.w3.org/2001/XMLSchema-instance</uri></Namespace>
- <Namespace><prefix>soil</prefix><uri>http://www.opengis.net/soil-data-ie/0.1</uri></Namespace>
- </namespaces>
- <sourceDataStores>
- <DataStore>
- <id>datastore</id>
- <parameters>
- <Parameter><name>dbtype</name><value>postgisng</value></Parameter>
- <!-- REMOVED DB PARAMETERS-->
- <Parameter><name>Expose primary keys</name><value>true</value></Parameter>
- </parameters>
- </DataStore>
- </sourceDataStores>
- <targetTypes>
- <FeatureType>
- <schemaUri>http://schemas.opengis.net/samplingSpatial/2.0/spatialSamplingFeature.xsd</schemaUri>
- <schemaUri>http://schemas.opengis.net/om/2.0/observation.xsd</schemaUri>
- <schemaUri>http://schemas.opengis.net/sampling/2.0/samplingFeature.xsd</schemaUri>
- <schemaUri>http://lab.scinfo.org.nz/static/schema/soil-data-ie/0.1/soil-data-ie.xsd</schemaUri>
- <schemaUri>http://schemas.opengis.net/gml/3.2.1/gml.xsd</schemaUri>
- </FeatureType>
- </targetTypes>
- <typeMappings>
- <FeatureTypeMapping>
- <sourceDataStore>datastore</sourceDataStore>
- <sourceType>soil</sourceType>
- <targetElement>soil:SO_Soil</targetElement>
- <attributeMappings>
- <AttributeMapping>
- <targetAttribute>soil:SO_Soil</targetAttribute>
- <idExpression>
- <!--this works-->
- <!--<OCQL>strConCat('so_' , profile_code)</OCQL>-->
- <OCQL>strConCat('soil.so_soil.' , profile_id)</OCQL>
- </idExpression>
- </AttributeMapping>
- <AttributeMapping>
- <targetAttribute>gml:identifier</targetAttribute>
- <sourceExpression>
- <OCQL>strConCat('http://lab.scinfo.org.nz/soil-data-ie/id/isric/soil/so_soil/',profile_id)</OCQL>
- </sourceExpression>
- <ClientProperty>
- <name>codeSpace</name>
- <value>'http://www.landcareresearch.co.nz'</value>
- </ClientProperty>
- </AttributeMapping>
- <AttributeMapping>
- <targetAttribute>gml:description</targetAttribute>
- <sourceExpression>
- <OCQL>strConCat('WOSIS profile code ',profile_code)</OCQL>
- </sourceExpression>
- </AttributeMapping>
- <AttributeMapping>
- <encodeIfEmpty>true</encodeIfEmpty>
- <targetAttribute>soil:soRelatedSamplingFeature</targetAttribute>
- </AttributeMapping>
- <AttributeMapping>
- <encodeIfEmpty>true</encodeIfEmpty>
- <targetAttribute>soil:soClassifier</targetAttribute>
- </AttributeMapping>
- <AttributeMapping>
- <encodeIfEmpty>true</encodeIfEmpty>
- <targetAttribute>soil:soAvailableWaterCapacity</targetAttribute>
- </AttributeMapping>
- <AttributeMapping>
- <encodeIfEmpty>true</encodeIfEmpty>
- <targetAttribute>soil:soDrainage</targetAttribute>
- </AttributeMapping>
- <AttributeMapping>
- <encodeIfEmpty>true</encodeIfEmpty>
- <targetAttribute>soil:soDepthToRock</targetAttribute>
- </AttributeMapping>
- <AttributeMapping>
- <targetAttribute>soil:soHorizon</targetAttribute>
- <encodeIfEmpty>true</encodeIfEmpty>
- <sourceExpression>
- <!--PK in soil table-->
- <OCQL>profile_id</OCQL>
- <linkElement>_sohorizon</linkElement>
- <linkField>FEATURE_LINK</linkField>
- </sourceExpression>
- <isMultiple>true</isMultiple>
- <ClientProperty>
- <name>xlink:href</name>
- <!-- PK in table profile_layer-->
- <value>profile_layer_id</value>
- </ClientProperty>
- </AttributeMapping>
- </attributeMappings>
- </FeatureTypeMapping>
- <!-- ======================================== -->
- <!-- link to gml_name datastore for multiple gml:name -->
- <!-- Feature Linking-->
- <FeatureTypeMapping>
- <mappingName>_sohorizon</mappingName>
- <sourceDataStore>datastore</sourceDataStore>
- <sourceType>profile_layer</sourceType>
- <targetElement>soil:SO_Soil</targetElement>
- <attributeMappings>
- <encodeIfEmpty>true</encodeIfEmpty>
- <AttributeMapping>
- <targetAttribute>FEATURE_LINK</targetAttribute>
- <!-- FK in table profile_layer-->
- <sourceExpression><OCQL>profile_id_fk</OCQL></sourceExpression>
- </AttributeMapping>
- <AttributeMapping>
- <targetAttribute>soil:soHorizon</targetAttribute>
- </AttributeMapping>
- </attributeMappings>
- </FeatureTypeMapping>
- </typeMappings>
- </as:AppSchemaDataAccess>
Advertisement
Add Comment
Please, Sign In to add comment