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: {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: {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: {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=“http://www.opengis.net/ogc” xmlns:ns3=“http://www.geotools.org/app-schema”>
ge
http://inspire.ec.europa.eu/schemas/ge-core/4.0
gml
http://www.opengis.net/gml/3.2
xlink
xsi
http://www.w3.org/2001/XMLSchema-instance
includedTypes.xml
dataStore
host
localhost
port
5432
database
szkolenie2
schema
public
user
postgres
passwd
postgis
Expose primary keys
true
dbtype
postgis
_schemas/GeologyCore.xsd
dataStore
geologic_feature
ge:MappedFeature
ge:specification/ge:GeologicUnit/ge:geologicHistory
id
ge:GeologicEvent
FEATURE_LINK[1]
true
ge:MappedFeature
id
ge:shape
shape
ge:specification/ge:GeologicUnit/ge:name
name
xsi:nil
if_then_else(isNull(name), ‘true’, Expression.NIL)
dataStore
geologic_event
ge:GeologicEvent
FEATURE_LINK[1]
geologic_feature
ge:eventProcess
id
gml:ReferenceType
FEATURE_LINK[1]
true
ge:GeologicEvent
id
ge:name
name
xsi:nil
if_then_else(isNull(name), ‘true’, Expression.NIL)
</ns3:AppSchemaDataAccess>
includedTypes.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns3:AppSchemaDataAccess xmlns:ns2=“http://www.opengis.net/ogc” xmlns:ns3=“http://www.geotools.org/app-schema”>
ge
http://inspire.ec.europa.eu/schemas/ge-core/4.0
gml
http://www.opengis.net/gml/3.2
xlink
xsi
http://www.w3.org/2001/XMLSchema-instance
dataStore
host
localhost
port
5432
database
szkolenie2
schema
public
user
postgres
passwd
postgis
Expose primary keys
true
dbtype
postgis
_schemas/GeologyCore.xsd
dataStore
event_process
gml:ReferenceType
FEATURE_LINK[1]
geologic_event
ge:specification/ge:GeologicUnit/ge:geologicHistory/ge:GeologicEvent/ge:eventProcess
xlink:href
event_process
</ns3:AppSchemaDataAccess>
Thanks a lot for any clue
Piotr