Re: Complex Feature: Duplicate default namespace declaration.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Complex Feature: Duplicate default namespace declaration.

dirk.thalheim
Dear list,

I finally found the solution for my problem. The Feature mapping also needs the Href mapping. Both columns fk and href need to be filled in the database (where href is filled with '#' + GML-ID). I guess in my tests at least one criteria was missing.

Anyhow, the error message is not really helpful and beaks the XML-validity - Ok, I guess this is due to streaming. For me the message 'Duplicate default namespace declaration. at [row,col {unknown-source}]: [1,310]' feels more like an unexpected behavior (maybe a bug?).

Kind regards,

Dirk Thalheim
_____________________________________
Department GI 5
Federal Agency for Cartography and Geodesy (BKG)

Karl-Rothe-Str. 10 - 14, 04105 Leipzig  
phone: +49 (0)341 5634 311
personal email: [hidden email]
department email: [hidden email]
internet: http://www.bkg.bund.de

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

Von: Thalheim, Dirk
Gesendet: Donnerstag, 20. April 2017 15:51
An: '[hidden email]' <[hidden email]>
Betreff: Complex Feature: Duplicate default namespace declaration.

Dear list,

I'm trying to implement the INSPIRE LandCover Theme.  Currently I'm having troubles creating the relationship between LandCoverDataset and LandCoverUnit. Basically I'm using following mapping:

    ...
    <FeatureTypeMapping name="lcv:LandCoverDataset" table="lcv.landcoverdataset">
        <FIDMapping prefix="LANDCOVERDATASET_">
            <Column name="localid" type="string" />
            <UUIDGenerator />
        </FIDMapping>
        ...
        <Complex path="lcv:member">
            <Join table="lcv.landcoverdataset_member" fromColumns="localid" toColumns="parentfk"/>
            <Feature path=".">
                <Join table="lcv.landcoverunit" fromColumns="fk" toColumns="localid" />
                <!-- Href mapping="href" /-->
            </Feature>
        </Complex>
    </FeatureTypeMapping>
   
     <FeatureTypeMapping name="lcv:LandCoverUnit" table="lcv.landcoverunit">
        <FIDMapping prefix="LANDCOVERUNIT_">
            <Column name="localid" type="string" />
            <UUIDGenerator />
        </FIDMapping>
        ...
    </FeatureTypeMapping>
    ...

I created a test dataset with items, that have a relation between lcv.landcoverdataset_member and lcv.landcoverunit. But when I'm requesting that data over WFS (...?service=WFS&request=GetFeature&VERSION=2.0.0&TYPENAMES=LandCoverDataset) I'm receiving following erroneous output:
<?xml version='1.0' encoding='UTF-8'?>
<wfs:FeatureCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://inspire.ec.europa.eu/schemas/lcv/4.0 http://lsvpostcat0.bkg:8080/inspire/services/wfs_clc10?SERVICE=WFS&amp;VERSION=2.0.0&amp;REQUEST=DescribeFeatureType&amp;OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&amp;TYPENAME=lcv:LandCoverDataset&amp;NAMESPACES=xmlns(lcv,http%3A%2F%2Finspire.ec.europa.eu%2Fschemas%2Flcv%2F4.0)" xmlns:wfs="http://www.opengis.net/wfs/2.0" timeStamp="2017-04-20T13:26:17Z" xmlns:gml="http://www.opengis.net/gml/3.2" numberMatched="1" numberReturned="1">
  <wfs:member>
    <lcv:LandCoverDataset xmlns:lcv="http://inspire.ec.europa.eu/schemas/lcv/4.0" gml:id="LANDCOVERDATASET_1">
      <gml:identifier codeSpace="http://bkg.bund.de/clc10">1</gml:identifier>
      <lcv:inspireId>
        <base:Identifier xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3">
          <base:localId>1</base:localId>
          <base:namespace>http://bkg.bund.de/clc10</base:namespace>
          <base:versionId xsi:nil="true" nilReason="other:unpopulated"/>
        </base:Identifier>
      </lcv:inspireId>
      <lcv:beginLifespanVersion nil="true"/>
      <lcv:name>test</lcv:name>
      <lcv:validFrom nil="true"/>
      <lcv:validTo nil="true"/>
      <lcv:member/>
      <ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd" version="2.0.0">
        <ows:Exception exceptionCode="NoApplicableCode">
          <ows:ExceptionText>Duplicate default namespace declaration.
at [row,col {unknown-source}]: [1,310]</ows:ExceptionText>
        </ows:Exception>
      </ows:ExceptionReport>

This seems to be related with the RESOLVEDEPTH parameter. When it's missing or set to 0 I'm receiving the error. Increasing the value (...?service=WFS&request=GetFeature&VERSION=2.0.0&TYPENAMES=LandCoverDataset&Resolvedepth=1) produces no error:
<?xml version='1.0' encoding='UTF-8'?>
<wfs:FeatureCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://inspire.ec.europa.eu/schemas/lcv/4.0 http://lsvpostcat0.bkg:8080/inspire/services/wfs_clc10?SERVICE=WFS&amp;VERSION=2.0.0&amp;REQUEST=DescribeFeatureType&amp;OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&amp;TYPENAME=lcv:LandCoverDataset&amp;NAMESPACES=xmlns(lcv,http%3A%2F%2Finspire.ec.europa.eu%2Fschemas%2Flcv%2F4.0)" xmlns:wfs="http://www.opengis.net/wfs/2.0" timeStamp="2017-04-20T13:43:48Z" xmlns:gml="http://www.opengis.net/gml/3.2" numberMatched="1" numberReturned="1">
  <wfs:member>
    <lcv:LandCoverDataset xmlns:lcv="http://inspire.ec.europa.eu/schemas/lcv/4.0" gml:id="LANDCOVERDATASET_1">
      <gml:identifier codeSpace="http://bkg.bund.de/clc10">1</gml:identifier>
      <lcv:inspireId>
        <base:Identifier xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3">
          <base:localId>1</base:localId>
          <base:namespace>http://bkg.bund.de/clc10</base:namespace>
          <base:versionId xsi:nil="true" nilReason="other:unpopulated"/>
        </base:Identifier>
      </lcv:inspireId>
      <lcv:beginLifespanVersion nil="true"/>
      <lcv:name>test</lcv:name>
      <lcv:validFrom nil="true"/>
      <lcv:validTo nil="true"/>
      <lcv:member>
        <!--Inlined feature 'LANDCOVERUNIT_1'-->
        <lcv:LandCoverUnit gml:id="LANDCOVERUNIT_1">
          <gml:identifier codeSpace="http://bkg.bund.de/clc10">1</gml:identifier>
          <lcv:inspireId>
            <base:Identifier xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3">
              <base:localId>1</base:localId>
              <base:namespace>http://bkg.bund.de/clc10</base:namespace>
              <base:versionId xsi:nil="true" nilReason="other:unpopulated"/>
            </base:Identifier>
          </lcv:inspireId>
          <lcv:beginLifespanVersion nil="true"/>
        </lcv:LandCoverUnit>
      </lcv:member>
    </lcv:LandCoverDataset>
  </wfs:member>
</wfs:FeatureCollection>

I also tried to create the relation with following mapping and a href value for the test dataset with '#LANDCOVERUNIT_...'
            <Feature path=".">
                <Href mapping="href" />
            </Feature>

But this produced the same error. When changing the href value to an invalid reference/URL it creates the gml as expected. But with this the reference is not working.

Is this a bug or am I missing something? I'm using deegree-core-db-3.4-RC3.

Kind regards,

Dirk Thalheim
_____________________________________
Department GI 5
Federal Agency for Cartography and Geodesy (BKG)

Karl-Rothe-Str. 10 - 14, 04105 Leipzig  
phone: +49 (0)341 5634 311
personal email: [hidden email]
department email: [hidden email]
internet: http://www.bkg.bund.de




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
deegree-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/deegree-users