Problem with INSPIRE xsd schema

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with INSPIRE xsd schema

komencanto

Hi, 

I'm working on my diploma thesis with GeoServer and complement application schema. 

When I created data store, and create a new layer program writes an error in the mapping file: 
"Could not list layers for this store, an error occurred retrieving them: java.util.NoSuchElementException: No top-level element found in Schemes: {} 
http://inspire.ec.europa.eu/schemas/ps/4.0/ProtectedSite ProtectedSite " 

I don´t know how to resolve because there isn´t another source ProtectedSites.xsd scheme download source. 

How I can solve this problem ????? 

here is my mapping file for download: 
https://drive.google.com/open?id=0B1bulwJXoip1VHdxSHFyenNXLXM

Adam


------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with INSPIRE xsd schema

Ben Caradoc-Davies-2
Adam,

it looks like your namespaces are incorrect. The ps namespace should be:
http://inspire.ec.europa.eu/schemas/ps/4.0

But below it looks like you have requested type with namespace:
http://inspire.ec.europa.eu/schemas/ps/4.0/ProtectedSite

Your namespace.xml also has a different namespace URI:
http://inspire.ec.europa.eu/schemas/ps

Please check that all your namespaces are correct. You may also need to
create secondary namespaces to ensure that these are defined for the
GeoTools encoder:
http://docs.geoserver.org/latest/en/user/data/app-schema/secondary-namespaces.html

There are also several problems with your mapping file: you use a
namespace prefix "base" that is not defined, and one targetAttribute is
"ps:" (no prefix, missing local name).

It would also be useful to examine the geoserver logs and look for
exception stack traces; sometimes a strange error later may be caused by
earlier exception that has left something in an incomplete state. First
fix your namespaces.

Kind regards,
Ben.

On 07/04/16 19:32, Adam Mydla wrote:

> Hi,
>
> I'm working on my diploma thesis with GeoServer and complement application
> schema.
>
> When I created data store, and create a new layer program writes an error
> in the mapping file:
> "Could not list layers for this store, an error occurred retrieving them:
> java.util.NoSuchElementException: No top-level element found in Schemes: {}
> http://inspire.ec.europa.eu/schemas/ps/4.0/ProtectedSite ProtectedSite "
>
> I don´t know how to resolve because there isn´t another source
> ProtectedSites.xsd scheme download source.
>
> How I can solve this problem ?????
>
> here is my mapping file for download:
> https://drive.google.com/open?id=0B1bulwJXoip1VHdxSHFyenNXLXM
>
> Adam
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>

--
Ben Caradoc-Davies <[hidden email]>
Director
Transient Software Limited <http://transient.nz/>
New Zealand

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with INSPIRE xsd schema

Ben Caradoc-Davies-2
Adam, you must keep discussions on the geoserver-users list or purchase
a support contract. On-list discussions help the whole community, so
community members may answer on-list questions for free. You are better
off asking the list because individual members may be unavailable or not
have a good answer.

In app-schema, geometries are treated as atomic types and will be
converted into GML by the encoder. Use targetAttribute to map the top
level geometry property. Change this:
<targetAttribute>/ps:ProtectedSite/ps:geometry/gml:Polygon/gml:exterior/gml:LinearRing/gml:posList</targetAttribute>

to this:
<targetAttribute>ps:geometry</targetAttribute>

The leading slash was also unexpected, and you do not need the target
element unless you are addressing its attributes.

Even once you fix your mapping, your request will fail because you are
using a GML 3.2.1 application schema but WFS 1.1.0 which defaults to GML
3.1.1, incompatible with your target application schema. See:
http://docs.geoserver.org/latest/en/user/data/app-schema/supported-gml-versions.html#gml-3-2-1

Either specify outputformat=gml32 in your request:
http://localhost:8080/geoserver2/wfs?service=WFS&version=1.1.0&request=GetFeature&typename=ps:ProtectedSite&outputformat=gml32

or use WFS 2.0.0:
http://localhost:8080/geoserver2/wfs?service=WFS&version=2.0.0&request=GetFeature&typenames=ps:ProtectedSite

You are also specifying many unnecessary <FeatureType><schemaUri>; just
specify the top-level schemaUri and app-schema will follow any
imports/includes. You may need more than one. You certainly go not need
to specify GML 3.2.1.

Kind regards,
Ben.


On 14/04/16 01:51, Adam Mydla wrote:

> Thank you for your advice,
>
>
> It was very helpful.
>
>
> I modified the namespace name, added attributes, in some parts I must
> change target attribute for testing responses to requests. Only for example
> I am mapped all attributes like INSPIRE ID.
>
>
> When I send request GetFeature:
>
> http://localhost:8080/geoserver2/wfs?request=GetFeature&version=1.1.0&typeName=ps:ProtectedSite
>
>
> This is answer:
>
>
>
> <ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="
> http://www.opengis.net/ows" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance
> " version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows
> http://localhost:8080/geoserver2/schemas/ows/1.0.0/owsExceptionReport.xsd">
>
> <ows:Exception exceptionCode="NoApplicableCode">
>
> <ows:ExceptionText>
>
> java.lang.RuntimeException: Error applying mapping with targetAttribute
> ps:geometry/gml:Polygon/gml:exterior/gml:LinearRing/gml:posList Error
> applying mapping with targetAttribute
> ps:geometry/gml:Polygon/gml:exterior/gml:LinearRing/gml:posList Could not
> find working property accessor for attribute (Shape) in object
> (SimpleFeatureImpl:chko=[SimpleFeatureImpl.Attribute: the_geom<the_geom
> id=chko.1>=MULTIPOLYGON (((48.709917 18.08879, 48.71037 18.089492,
> 48.710799 18.089892, 48.710175 18.091621, 48.709862 18.091097, 48.709789
> 18.090894, 48.70971 18.090842, 48.709584 18.090511, 48.709714 18.090136,
> 48.7094 18.088812, 48.709812 18.089396, 48.709917 18.08879))),
> SimpleFeatureImpl.Attribute: OSM_ID<OSM_ID id=chko.1>=81009135,
> SimpleFeatureImpl.Attribute: URL<URL id=chko.1>=http://oksovske-duby.oma.sk/,
> SimpleFeatureImpl.Attribute: TYP<TYP id=chko.1>=chko,
> SimpleFeatureImpl.Attribute: POPIS_MALY<POPIS_MALY id=chko.1>=Chránený
> areál rozlohy 1,56&nbsp;ha, typ chráneného územia Chránený areál,
> názvy: Chránený areál, <a href='http://oksovske-duby.oma.sk/'>plná
> stránka o Okšovské duby</a>])
>
> </ows:ExceptionText>
>
> </ows:Exception>
>
> </ows:ExceptionReport>
>
>
>
> I do not know what's wrong ?  Why it seems that GeoServer not followed my
> mapping file?
>
>
> My modified mapping file:
>
> https://drive.google.com/open?id=0B1bulwJXoip1X3ZabTJJN2kzeDg
>
>
> GeoServer log file:
>
> https://drive.google.com/open?id=0B1bulwJXoip1QkZCYko4VWhONW8
>
>
> Regards,
>
>
> Adam
>
> 2016-04-07 10:23 GMT+02:00 Ben Caradoc-Davies <[hidden email]>:
>
>> Adam,
>>
>> it looks like your namespaces are incorrect. The ps namespace should be:
>> http://inspire.ec.europa.eu/schemas/ps/4.0
>>
>> But below it looks like you have requested type with namespace:
>> http://inspire.ec.europa.eu/schemas/ps/4.0/ProtectedSite
>>
>> Your namespace.xml also has a different namespace URI:
>> http://inspire.ec.europa.eu/schemas/ps
>>
>> Please check that all your namespaces are correct. You may also need to
>> create secondary namespaces to ensure that these are defined for the
>> GeoTools encoder:
>>
>> http://docs.geoserver.org/latest/en/user/data/app-schema/secondary-namespaces.html
>>
>> There are also several problems with your mapping file: you use a
>> namespace prefix "base" that is not defined, and one targetAttribute is
>> "ps:" (no prefix, missing local name).
>>
>> It would also be useful to examine the geoserver logs and look for
>> exception stack traces; sometimes a strange error later may be caused by
>> earlier exception that has left something in an incomplete state. First fix
>> your namespaces.
>>
>> Kind regards,
>> Ben.
>>
>>
>> On 07/04/16 19:32, Adam Mydla wrote:
>>
>>> Hi,
>>>
>>> I'm working on my diploma thesis with GeoServer and complement application
>>> schema.
>>>
>>> When I created data store, and create a new layer program writes an error
>>> in the mapping file:
>>> "Could not list layers for this store, an error occurred retrieving them:
>>> java.util.NoSuchElementException: No top-level element found in Schemes:
>>> {}
>>> http://inspire.ec.europa.eu/schemas/ps/4.0/ProtectedSite ProtectedSite "
>>>
>>> I don´t know how to resolve because there isn´t another source
>>> ProtectedSites.xsd scheme download source.
>>>
>>> How I can solve this problem ?????
>>>
>>> here is my mapping file for download:
>>> https://drive.google.com/open?id=0B1bulwJXoip1VHdxSHFyenNXLXM
>>>
>>> Adam
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>>
>>>
>>> _______________________________________________
>>> Geoserver-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>>
>>>
>> --
>> Ben Caradoc-Davies <[hidden email]>
>> Director
>> Transient Software Limited <http://transient.nz/>
>> New Zealand
>>
>

--
Ben Caradoc-Davies <[hidden email]>
Director
Transient Software Limited <http://transient.nz/>
New Zealand

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with INSPIRE xsd schema

ljacedo
Hello,

Please help:

I´m trying to do the same think you have done, and Im getting the same
error.
I have check and dobule check my namespace to see if there is a problem and
still I get the same error.

Here is my namespace in ProtectedSite mapping file xml:
        <namespaces>
                <Namespace>
                        <prefix>ps</prefix>
                       
<uri>"http://inspire.ec.europa.eu/schemas/ps/4.0"</uri>
                </Namespace>
                <Namespace>
                        <prefix>base</prefix>
                       
<uri>"http://inspire.ec.europa.eu/schemas/base/3.3"</uri>
                </Namespace>
                <Namespace>
                        <prefix>gn</prefix>
                       
<uri>"http://inspire.ec.europa.eu/schemas/gn/4.0"</uri>
                </Namespace>
                <Namespace>
                        <prefix>qmd</prefix>
                        <uri>"http://www.isotc211.org/2005/gmd"</uri>
                </Namespace>
                <Namespace>
                        <prefix>gml</prefix>
                        <uri>"http://www.opengis.net/gml/3.2"</uri>
                </Namespace>          
        </namespaces>

This is the FeatureTypeMapping in ProtectedSite Mapping file:
                <FeatureTypeMapping>
                        <sourceDataStore>bd_oracle</sourceDataStore>
                        <sourceType>PROTECTEDSITE</sourceType>
                        <targetElement>ps:ProtectedSite</targetElement>
                        <attributeMappings>
                                <AttributeMapping>
                                       
<targetAttribute>ps:legalFoundationDate</targetAttribute>
                                        <sourceExpression>
                                               
<OCQL>LEGALFOUNDATIONDATE</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                        </attributeMappings>
                </FeatureTypeMapping>

Also, Here is the targetTypes (I don't think this could be a problem)
        <targetTypes>
                <FeatureType>
                        <schemaUri>./ProtectedSites.xsd</schemaUri>
                </FeatureType>
        </targetTypes>

The error log shows as follow:
2018-12-04 14:16:38,201 INFO [org.geoserver] - Loaded store 'ProtectedSite',
enabled
2018-12-04 14:16:38,201 INFO [org.geoserver] - Loaded data store
'ProtectedSite'
2018-12-04 14:17:22,839 WARN [data.complex] - No top level element found in
schemas: {"http://inspire.ec.europa.eu/schemas/ps/4.0"}ProtectedSite
2018-12-04 14:17:22,839 WARN [complex.config] - Error creating app-schema
data store for 'ps:ProtectedSite', caused by: No top level element found in
schemas: {"http://inspire.ec.europa.eu/schemas/ps/4.0"}ProtectedSite
2018-12-04 14:17:22,842 WARN [org.geoserver] - Error connecting to
'ProtectedSite'. Disabling.
2018-12-04 14:17:22,842 INFO [org.geoserver] -
java.io.IOException: java.util.NoSuchElementException: No top level element
found in schemas:
{"http://inspire.ec.europa.eu/schemas/ps/4.0"}ProtectedSite

If you could give some guiden on this matter I would appreciate

Thanks
Luis Acedo



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html


_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem with INSPIRE xsd schema

tõnis kärdi
Hey Luis,

some time has passed and I can't remember exactly, but a couple of
possible pointers for no-top-element:
- you'll need to declare all required xml namespaces in appschema/namespaces
- add them as ("secondary" I think they were called) workspaces in the
GS data dir aswell.
- and watch out for misspellings (e.g <prefix>qmd</prefix> vs
<prefix>gmd</prefix> :) )

If you'd like to take a look at a working example of inspire ps using
GeoServer appschema then there's
https://github.com/e-gov/kem-inspire/blob/reporting/src/data/ps/ProtectedSite/ProtectedSite.appschema
available with all the required (+ more) data dir contents aswell. The
service itself based on this app-schema can be reached through
https://gsavalik.envir.ee/geoserver/ps/ows?service=WFS&version=2.0.0&request=GetFeature&count=1&typename=ps:ProtectedSite

Hope this helps and all the best,
Tõnis


Kontakt ljacedo (<[hidden email]>) kirjutas kuupäeval K, 5.
detsember 2018 kell 19:18:

>
> Hello,
>
> Please help:
>
> I´m trying to do the same think you have done, and Im getting the same
> error.
> I have check and dobule check my namespace to see if there is a problem and
> still I get the same error.
>
> Here is my namespace in ProtectedSite mapping file xml:
>         <namespaces>
>                 <Namespace>
>                         <prefix>ps</prefix>
>
> <uri>"http://inspire.ec.europa.eu/schemas/ps/4.0"</uri>
>                 </Namespace>
>                 <Namespace>
>                         <prefix>base</prefix>
>
> <uri>"http://inspire.ec.europa.eu/schemas/base/3.3"</uri>
>                 </Namespace>
>                 <Namespace>
>                         <prefix>gn</prefix>
>
> <uri>"http://inspire.ec.europa.eu/schemas/gn/4.0"</uri>
>                 </Namespace>
>                 <Namespace>
>                         <prefix>qmd</prefix>
>                         <uri>"http://www.isotc211.org/2005/gmd"</uri>
>                 </Namespace>
>                 <Namespace>
>                         <prefix>gml</prefix>
>                         <uri>"http://www.opengis.net/gml/3.2"</uri>
>                 </Namespace>
>         </namespaces>
>
> This is the FeatureTypeMapping in ProtectedSite Mapping file:
>                 <FeatureTypeMapping>
>                         <sourceDataStore>bd_oracle</sourceDataStore>
>                         <sourceType>PROTECTEDSITE</sourceType>
>                         <targetElement>ps:ProtectedSite</targetElement>
>                         <attributeMappings>
>                                 <AttributeMapping>
>
> <targetAttribute>ps:legalFoundationDate</targetAttribute>
>                                         <sourceExpression>
>
> <OCQL>LEGALFOUNDATIONDATE</OCQL>
>                                         </sourceExpression>
>                                 </AttributeMapping>
>                         </attributeMappings>
>                 </FeatureTypeMapping>
>
> Also, Here is the targetTypes (I don't think this could be a problem)
>         <targetTypes>
>                 <FeatureType>
>                         <schemaUri>./ProtectedSites.xsd</schemaUri>
>                 </FeatureType>
>         </targetTypes>
>
> The error log shows as follow:
> 2018-12-04 14:16:38,201 INFO [org.geoserver] - Loaded store 'ProtectedSite',
> enabled
> 2018-12-04 14:16:38,201 INFO [org.geoserver] - Loaded data store
> 'ProtectedSite'
> 2018-12-04 14:17:22,839 WARN [data.complex] - No top level element found in
> schemas: {"http://inspire.ec.europa.eu/schemas/ps/4.0"}ProtectedSite
> 2018-12-04 14:17:22,839 WARN [complex.config] - Error creating app-schema
> data store for 'ps:ProtectedSite', caused by: No top level element found in
> schemas: {"http://inspire.ec.europa.eu/schemas/ps/4.0"}ProtectedSite
> 2018-12-04 14:17:22,842 WARN [org.geoserver] - Error connecting to
> 'ProtectedSite'. Disabling.
> 2018-12-04 14:17:22,842 INFO [org.geoserver] -
> java.io.IOException: java.util.NoSuchElementException: No top level element
> found in schemas:
> {"http://inspire.ec.europa.eu/schemas/ps/4.0"}ProtectedSite
>
> If you could give some guiden on this matter I would appreciate
>
> Thanks
> Luis Acedo


_______________________________________________
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


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users