Hi, I'm trying to use app-schema to create complex feature for INSPIRE
Geology theme. In most part it's working OK, but in one case I've got
an error and I can't find any information whats wrong. Minimal example in
which it can be reproduced is having 3 joined tables: geology_feature: - id
- serial - shape - geometry - name - text geologic_event: - id - serial -
name- text - geologic_feature - FK to geologic_feature event_process: -
event_process - text (uri) - geologic_event - FK to geologic_event There are
1:N relations between them. I've created alignment in HALE Studio to
application schema for Geology 4.0 where I'm joinig this tables and mapping
attributes. So far so good, exporting transformed data to GML 3.2 works OK.
Now I'm trying to export this configuration to GeoServer using app-schema
plugin. On feature chaining step I'm setting target type for geology_event
to GeologicEvent feature type, and event_process to eventProcess property of
GeologicEvent. Then it's showing two workspaces: - ge with GeologicEvent
and MappedFeature features - gml with ReferenceType feature On import
I've got error in GeoServer: 27 lis 09:28:14 WARN [feature.type] - No top
level element found in schemas: { www.opengis.net
http://www.opengis.net/gml/3.2}ReferenceType 27 lis 09:28:14 WARN
[complex.config] - Error creating app-schema data store for
'gml:ReferenceType', caused by: No top level element found in schemas:
{ www.opengis.net http://www.opengis.net/gml/3.2}ReferenceType 27 lis 09:28:14
ERROR [geoserver.web] - Error retrieving layers for the specified store
java.lang.RuntimeException: Could not list layers for this store, an error
occurred retrieving them: java.util.NoSuchElementException: No top level
element found in schemas: { www.opengis.net
http://www.opengis.net/gml/3.2}ReferenceType I'm not sure but I suspects
that it's because eventProcess element is gml:ReferenceType which is not a
feature type. But how can I join this tables in appschema mapping to ommit this
problem and still got 1:N relation between event_process and geologic_event
tables? I've tried to manualy edit mapping files in GeoServer but without
success. I've also search for more information about this error (No top
level element) but can't find anything helpfull. Tutorials are based on
older version of geosciml schemas (2.0 I think) where eventProcess are
CGI_TermValue data types and it's working fine. I'm struggeling with
this for days without success, so mayby someone have any idea what is wrong,
how this can be fixed or where to find more information about this case.
Below are my mapping files: GeologyCore.appschema <?xml
version="1.0" encoding="UTF-8" standalone="yes"?>
<ns3:AppSchemaDataAccess xmlns:ns2=" www.opengis.net
http://www.opengis.net/ogc " xmlns:ns3=" www.geotools.org
http://www.geotools.org/app-schema "> <namespaces>
<Namespace> <prefix>ge</prefix>
<uri> inspire.ec.europa.eu
http://inspire.ec.europa.eu/schemas/ge-core/4.0 </uri>
</Namespace> <Namespace>
<prefix>gml</prefix> <uri> www.opengis.net
http://www.opengis.net/gml/3.2 </uri> </Namespace>
<Namespace> <prefix>xlink</prefix>
<uri> www.w3.org http://www.w3.org/1999/xlink </uri>
</Namespace> <Namespace>
<prefix>xsi</prefix> <uri> www.w3.org
http://www.w3.org/2001/XMLSchema-instance </uri>
</Namespace> </namespaces> <includedTypes>
<Include xmlns:xsi=" www.w3.org
http://www.w3.org/2001/XMLSchema-instance " xmlns:xs=" www.w3.org
http://www.w3.org/2001/XMLSchema "
xsi:type="xs:string">includedTypes.xml</Include>
</includedTypes> <sourceDataStores> <DataStore>
<id>dataStore</id> <parameters>
<Parameter>
<name>host</name>
<value>localhost</value> </Parameter>
<Parameter> <name>port</name>
<value>5432</value>
</Parameter> <Parameter>
<name>database</name>
<value>szkolenie2</value> </Parameter>
<Parameter>
<name>schema</name>
<value>public</value> </Parameter>
<Parameter> <name>user</name>
<value>postgres</value>
</Parameter> <Parameter>
<name>passwd</name>
<value>postgis</value> </Parameter>
<Parameter> <name>Expose primary
keys</name> <value>true</value>
</Parameter> <Parameter>
<name>dbtype</name>
<value>postgis</value> </Parameter>
</parameters> </DataStore>
</sourceDataStores> <targetTypes> <FeatureType>
<schemaUri>_schemas/GeologyCore.xsd</schemaUri>
</FeatureType> </targetTypes> <typeMappings>
<FeatureTypeMapping>
<sourceDataStore>dataStore</sourceDataStore>
<sourceType>geologic_feature</sourceType>
<targetElement>ge:MappedFeature</targetElement>
<attributeMappings> <AttributeMapping>
<targetAttribute>ge:specification/ge:GeologicUnit/ge:geologicHistory</targetAttribute>
<sourceExpression>
<OCQL>id</OCQL>
<linkElement>ge:GeologicEvent</linkElement>
<linkField>FEATURE_LINK[1]</linkField>
</sourceExpression>
<isMultiple>true</isMultiple>
</AttributeMapping> <AttributeMapping>
<targetAttribute>ge:MappedFeature</targetAttribute>
<idExpression>
<OCQL>id</OCQL> </idExpression>
</AttributeMapping> <AttributeMapping>
<targetAttribute>ge:shape</targetAttribute>
<sourceExpression>
<OCQL>shape</OCQL> </sourceExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>ge:specification/ge:GeologicUnit/ge:name</targetAttribute>
<sourceExpression>
<OCQL>name</OCQL> </sourceExpression>
<ClientProperty>
<name>xsi:nil</name>
<value>if_then_else(isNull(name), 'true',
Expression.NIL)</value> </ClientProperty>
</AttributeMapping> </attributeMappings>
</FeatureTypeMapping> <FeatureTypeMapping>
<sourceDataStore>dataStore</sourceDataStore>
<sourceType>geologic_event</sourceType>
<targetElement>ge:GeologicEvent</targetElement>
<attributeMappings> <AttributeMapping>
<targetAttribute>FEATURE_LINK[1]</targetAttribute>
<sourceExpression>
<OCQL>geologic_feature</OCQL>
</sourceExpression> </AttributeMapping>
<AttributeMapping>
<targetAttribute>ge:eventProcess</targetAttribute>
<sourceExpression>
<OCQL>id</OCQL>
<linkElement>gml:ReferenceType</linkElement>
<linkField>FEATURE_LINK[1]</linkField>
</sourceExpression>
<isMultiple>true</isMultiple>
</AttributeMapping> <AttributeMapping>
<targetAttribute>ge:GeologicEvent</targetAttribute>
<idExpression>
<OCQL>id</OCQL> </idExpression>
</AttributeMapping> <AttributeMapping>
<targetAttribute>ge:name</targetAttribute>
<sourceExpression>
<OCQL>name</OCQL> </sourceExpression>
<ClientProperty>
<name>xsi:nil</name>
<value>if_then_else(isNull(name), 'true',
Expression.NIL)</value> </ClientProperty>
</AttributeMapping> </attributeMappings>
</FeatureTypeMapping> </typeMappings>
</ns3:AppSchemaDataAccess> includedTypes.xml <?xml
version="1.0" encoding="UTF-8" standalone="yes"?>
<ns3:AppSchemaDataAccess xmlns:ns2=" www.opengis.net
http://www.opengis.net/ogc " xmlns:ns3=" www.geotools.org
http://www.geotools.org/app-schema "> <namespaces>
<Namespace> <prefix>ge</prefix>
<uri> inspire.ec.europa.eu
http://inspire.ec.europa.eu/schemas/ge-core/4.0 </uri>
</Namespace> <Namespace>
<prefix>gml</prefix> <uri> www.opengis.net
http://www.opengis.net/gml/3.2 </uri> </Namespace>
<Namespace> <prefix>xlink</prefix>
<uri> www.w3.org http://www.w3.org/1999/xlink </uri>
</Namespace> <Namespace>
<prefix>xsi</prefix> <uri> www.w3.org
http://www.w3.org/2001/XMLSchema-instance </uri>
</Namespace> </namespaces> <includedTypes/>
<sourceDataStores> <DataStore>
<id>dataStore</id> <parameters>
<Parameter> <name>host</name>
<value>localhost</value>
</Parameter> <Parameter>
<name>port</name>
<value>5432</value> </Parameter>
<Parameter> <name>database</name>
<value>szkolenie2</value>
</Parameter> <Parameter>
<name>schema</name>
<value>public</value> </Parameter>
<Parameter> <name>user</name>
<value>postgres</value>
</Parameter> <Parameter>
<name>passwd</name>
<value>postgis</value> </Parameter>
<Parameter> <name>Expose primary
keys</name> <value>true</value>
</Parameter> <Parameter>
<name>dbtype</name>
<value>postgis</value> </Parameter>
</parameters> </DataStore>
</sourceDataStores> <targetTypes> <FeatureType>
<schemaUri>_schemas/GeologyCore.xsd</schemaUri>
</FeatureType> </targetTypes> <typeMappings>
<FeatureTypeMapping>
<sourceDataStore>dataStore</sourceDataStore>
<sourceType>event_process</sourceType>
<targetElement>gml:ReferenceType</targetElement>
<attributeMappings> <AttributeMapping>
<targetAttribute>FEATURE_LINK[1]</targetAttribute>
<sourceExpression>
<OCQL>geologic_event</OCQL>
</sourceExpression> </AttributeMapping>
<AttributeMapping>
<targetAttribute>ge:specification/ge:GeologicUnit/ge:geologicHistory/ge:GeologicEvent/ge:eventProcess</targetAttribute>
<ClientProperty>
<name>xlink:href</name>
<value>event_process</value>
</ClientProperty> </AttributeMapping>
</attributeMappings> </FeatureTypeMapping>
</typeMappings> </ns3:AppSchemaDataAccess> Thanks a lot for any
clue Piotr
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
If you want to request a feature or an improvement, also see this:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users