[GeoNetwork-users] Validation of metadata in batch import

Hi

I'm getting bizarre issues in a batch import if I select the validate
option:

*If I remove the metadata schemaLocation (using local xsd). I get this:*

   - cvc-elt.4.2: Cannot resolve 'DQ_DomainConsistency_Type' to a type
   definition for element 'gmd:DQ_DomainConsistency'. (Element:
   gmd:DQ_DomainConsistency with parent element: gmd:report)

   cvc-elt.4.2: Cannot resolve 'DQ_ConformanceResult_Type' to a type
   definition for element 'gmd:DQ_ConformanceResult'. (Element:
   gmd:DQ_ConformanceResult with parent element: gmd:result)

But the same metadata, in XMLSpy setting the schemaLocation to the
GeoNetwork schema folder validates properly. Honestly, I don't think XMLSpy
is hiding any error, looks some issue in GeoNetwork.

*If I keep the original schemaLocation in the metadata:*

xsi:schemaLocation="http://www.isotc211.org/2005/srv
http://schemas.opengis.net/iso/19139/20060504/srv/srv.xsd
http://www.isotc211.org/2005/gmd
http://schemas.opengis.net/iso/19139/20060504/gmd/gmd.xsd"

XMLSpy validates properly also.

GeoNetwork takes quite more time (due to remove xsd stuff I guess) and
reports a long list of issues. As a summary of the first ones:

schema_reference.4: Failed to read schema document
'../gts/temporalObjects.xsd', because 1) could not find the document; 2)
the document could not be read; 3) the root element of the document is not
<xsd:schema>. (Element: gmd:MD_Metadata with parent element: Unknown)

schema_reference.4: Failed to read schema document '
http://schemas.opengis.net/iso/19139/20060504/gsr/gsr.xsd’, because 1)
could not find the document; 2) the document could not be read; 3) the root
element of the document is not <xsd:schema>. (Element: gmd:MD_Metadata with
parent element: Unknown)

schema_reference.4: Failed to read schema document
'../gmd/metadataExtension.xsd', because 1) could not find the document; 2)
the document could not be read; 3) the root element of the document is not
<xsd:schema>. (Element: gmd:MD_Metadata with parent element: Unknown)

schema_reference.4: Failed to read schema document '../gmd/content.xsd',
because 1) could not find the document; 2) the document could not be read;
3) the root element of the document is not <xsd:schema>. (Element:
gmd:MD_Metadata with parent element: Unknown)

... (MORE ISSUES)

But what is more surprising, is that retrying again the import with
validation enabled, it outputs only this:

   - cvc-elt.4.2: Cannot resolve 'DQ_DomainConsistency_Type' to a type
   definition for element 'gmd:DQ_DomainConsistency'. (Element:
   gmd:DQ_DomainConsistency with parent element: gmd:report)

   cvc-elt.4.2: Cannot resolve 'DQ_ConformanceResult_Type' to a type
   definition for element 'gmd:DQ_ConformanceResult'. (Element:
   gmd:DQ_ConformanceResult with parent element: gmd:result)

Any idea why these differences and how to make the validation work properly
. Tested with 2.10.3 and 2.10.X branch code.

Regards,
Jose García

--

*GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on
GeoServer and GeoNetwork. Visit http://geocat.net/&gt; for
details. _________________________Jose GarcíaGeoCat bvVeenderweg 136721 WD
BennekomThe Netherlandshttp://GeoCat.net/>*

Hi

I think I get clear the issue. The original metadata has gmd as default
namespace with this:

<DQ_DomainConsistency xsi:type="DQ_DomainConsistency_Type">

when is imported by GeoNetwork, the gmd prefix is added to the element, but
not to the xsi:type:

<gmd:DQ_DomainConsistency xsi:type="DQ_DomainConsistency_Type">

I was validating the original xml in XML and worked fine, but if validating
the metadata that ends in GeoNetwork (with the batch import without
validation) I get the same errors in XMLSpy:

   - cvc-elt.4.2: Cannot resolve 'DQ_DomainConsistency_Type' to a type
   definition for element 'gmd:DQ_DomainConsistency'. (Element:
   gmd:DQ_DomainConsistency with parent element: gmd:report)

   cvc-elt.4.2: Cannot resolve 'DQ_ConformanceResult_Type' to a type
   definition for element 'gmd:DQ_ConformanceResult'. (Element:
   gmd:DQ_ConformanceResult with parent element: gmd:result)

I guess the xsi:type should be updated in the XML Import process.

Regards,
Jose García

On Mon, Nov 10, 2014 at 12:42 PM, Jose Garcia <jose.garcia@anonymised.com>
wrote:

Hi

I'm getting bizarre issues in a batch import if I select the validate
option:

*If I remove the metadata schemaLocation (using local xsd). I get this:*

   - cvc-elt.4.2: Cannot resolve 'DQ_DomainConsistency_Type' to a type
   definition for element 'gmd:DQ_DomainConsistency'. (Element:
   gmd:DQ_DomainConsistency with parent element: gmd:report)

   cvc-elt.4.2: Cannot resolve 'DQ_ConformanceResult_Type' to a type
   definition for element 'gmd:DQ_ConformanceResult'. (Element:
   gmd:DQ_ConformanceResult with parent element: gmd:result)

But the same metadata, in XMLSpy setting the schemaLocation to the
GeoNetwork schema folder validates properly. Honestly, I don't think XMLSpy
is hiding any error, looks some issue in GeoNetwork.

*If I keep the original schemaLocation in the metadata:*

xsi:schemaLocation="http://www.isotc211.org/2005/srv
http://schemas.opengis.net/iso/19139/20060504/srv/srv.xsd
http://www.isotc211.org/2005/gmd
http://schemas.opengis.net/iso/19139/20060504/gmd/gmd.xsd&quot;

XMLSpy validates properly also.

GeoNetwork takes quite more time (due to remove xsd stuff I guess) and
reports a long list of issues. As a summary of the first ones:

schema_reference.4: Failed to read schema document
'../gts/temporalObjects.xsd', because 1) could not find the document; 2)
the document could not be read; 3) the root element of the document is not
<xsd:schema>. (Element: gmd:MD_Metadata with parent element: Unknown)

schema_reference.4: Failed to read schema document '
http://schemas.opengis.net/iso/19139/20060504/gsr/gsr.xsd’, because 1)
could not find the document; 2) the document could not be read; 3) the root
element of the document is not <xsd:schema>. (Element: gmd:MD_Metadata with
parent element: Unknown)

schema_reference.4: Failed to read schema document
'../gmd/metadataExtension.xsd', because 1) could not find the document; 2)
the document could not be read; 3) the root element of the document is not
<xsd:schema>. (Element: gmd:MD_Metadata with parent element: Unknown)

schema_reference.4: Failed to read schema document '../gmd/content.xsd',
because 1) could not find the document; 2) the document could not be read;
3) the root element of the document is not <xsd:schema>. (Element:
gmd:MD_Metadata with parent element: Unknown)

... (MORE ISSUES)

But what is more surprising, is that retrying again the import with
validation enabled, it outputs only this:

   - cvc-elt.4.2: Cannot resolve 'DQ_DomainConsistency_Type' to a type
   definition for element 'gmd:DQ_DomainConsistency'. (Element:
   gmd:DQ_DomainConsistency with parent element: gmd:report)

   cvc-elt.4.2: Cannot resolve 'DQ_ConformanceResult_Type' to a type
   definition for element 'gmd:DQ_ConformanceResult'. (Element:
   gmd:DQ_ConformanceResult with parent element: gmd:result)

Any idea why these differences and how to make the validation work
properly . Tested with 2.10.3 and 2.10.X branch code.

Regards,
Jose García

--

*GeoCat Bridge for ArcGIS allows instant publishing of data and metadata
on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 136721 WD BennekomThe
Netherlandshttp://GeoCat.net/>*

--

*GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on
GeoServer and GeoNetwork. Visit http://geocat.net/&gt; for
details. _________________________Jose GarcíaGeoCat bvVeenderweg 136721 WD
BennekomThe Netherlandshttp://GeoCat.net/>*