[GeoNetwork-users] Issues with invalid content being automatically added to records

Hi List,

Using Geonetwork 3.0.5, I have found a problem when validating records
against our revised Gemini 2.2 schema (
https://github.com/AstunTechnology/iso19139.gemini22_GN3). I am seeing XSD
validation errors, which in the log files show up as:

<geonet:error>
    <geonet:typeOfError>ERROR</geonet:typeOfError>
    <geonet:errorNumber>1</geonet:errorNumber>
    <geonet:message>cvc-complex-type.2.4.a: Invalid content was found
starting with element 'gmx:Anchor'. One of '{"
http://www.isotc211.org/2005/gco&quot;:CharacterString\}' is expected. (Element:
gmx:Anchor with parent element: gmd:code)</geonet:message>

<geonet:xpath>gmd:identificationInfo/gmd:MD_DataIdentification/gmd:descriptiveKeywords[1]/gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gmx:Anchor</geonet:xpath>
  </geonet:error>

I have noticed, by comparing records before and after validation that the
gmd:identifier element is being added to the record automatically by
geonetwork at some point. It is not present in the records initially. If
the element is removed, then the record validates successfully. However, it
is then re-added. I haven't quite figured out if it is re-added when you
switch from view to view (eg from INSPIRE to XML view) or whether it's
re-added when you save a record, or when you validate.

I have tried commenting out the sections referring to this in
config-editor.xml but that doesn't seem to help.

This seems to only happen to keywords from the inspire themes thesaurus,
and it happens whether the keyword existed in the record before it was
imported into geonetwork, or whether it's added during editing.

In Geonetwork 2.10 I would have modified update-fixed-info.xsl to fix this
problem but I can't figure out which file causes this element to be added.
I also don't know whether the best fix is to remove the identifier section
at all (which still seems to be valid for INSPIRE, as far as I can tell) or
fix the XSD error some other way,

I am also seeing the error reported here:
https://github.com/geonetwork/util-gemet/issues/1 but I don't know if
that's a related problem or something separate.

Can anyone help?

Thanks

Jo

--
*Jo Cook*
t:+44 7930 524 155/twitter:@archaeogeek

--
--
Astun Technology Ltd, The Coach House, 17 West Street, Epsom, Surrey, KT18
7RL, UK
t:+44 1372 744 009 w: astuntechnology.com twitter:@astuntech
<https://twitter.com/astuntech&gt;

iShare - enterprise geographic intelligence platform
<https://astuntechnology.com/ishare/&gt;
GeoServer, PostGIS and QGIS training
<https://astuntechnology.com/services/#training&gt;
Helpdesk and customer portal
<http://support.astuntechnology.com/support/login&gt;

Company registration no. 5410695. Registered in England and Wales.
Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no.
864201149.

Hi Jo

I see this:
https://github.com/geonetwork/core-geonetwork/blob/3.0.x/schemas/iso19139/src/main/plugin/iso19139/layout/config-editor.xml#L488-L490,
have you commented that code?

Please check if the metadata schemaLocation defines the gmx namespace? I
think by default is not defined and probably that causes the issue. Please
check if the header contains the following in the *schemaLocation* field:

  http://www.isotc211.org/2005/gmx/gmx.xsd

If this is added in the xml header, the validation I guess should be fine.

Regards,
Jose García

On Thu, Jul 28, 2016 at 1:59 PM, Jo Cook <jocook@anonymised.com> wrote:

Hi List,

Using Geonetwork 3.0.5, I have found a problem when validating records
against our revised Gemini 2.2 schema (
https://github.com/AstunTechnology/iso19139.gemini22_GN3). I am seeing XSD
validation errors, which in the log files show up as:

<geonet:error>
    <geonet:typeOfError>ERROR</geonet:typeOfError>
    <geonet:errorNumber>1</geonet:errorNumber>
    <geonet:message>cvc-complex-type.2.4.a: Invalid content was found
starting with element 'gmx:Anchor'. One of '{"
http://www.isotc211.org/2005/gco&quot;:CharacterString\}' is expected. (Element:
gmx:Anchor with parent element: gmd:code)</geonet:message>

<geonet:xpath>gmd:identificationInfo/gmd:MD_DataIdentification/gmd:
descriptiveKeywords[1]/gmd:MD_Keywords/gmd:thesaurusName/
gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/
gmd:code/gmx:Anchor</geonet:xpath>
  </geonet:error>

I have noticed, by comparing records before and after validation that the
gmd:identifier element is being added to the record automatically by
geonetwork at some point. It is not present in the records initially. If
the element is removed, then the record validates successfully. However, it
is then re-added. I haven't quite figured out if it is re-added when you
switch from view to view (eg from INSPIRE to XML view) or whether it's
re-added when you save a record, or when you validate.

I have tried commenting out the sections referring to this in
config-editor.xml but that doesn't seem to help.

This seems to only happen to keywords from the inspire themes thesaurus,
and it happens whether the keyword existed in the record before it was
imported into geonetwork, or whether it's added during editing.

In Geonetwork 2.10 I would have modified update-fixed-info.xsl to fix this
problem but I can't figure out which file causes this element to be added.
I also don't know whether the best fix is to remove the identifier section
at all (which still seems to be valid for INSPIRE, as far as I can tell) or
fix the XSD error some other way,

I am also seeing the error reported here:
https://github.com/geonetwork/util-gemet/issues/1 but I don't know if
that's a related problem or something separate.

Can anyone help?

Thanks

Jo

--
*Jo Cook*
t:+44 7930 524 155/twitter:@archaeogeek

--
--
Astun Technology Ltd, The Coach House, 17 West Street, Epsom, Surrey, KT18
7RL, UK
t:+44 1372 744 009 w: astuntechnology.com twitter:@astuntech
<https://twitter.com/astuntech&gt;

iShare - enterprise geographic intelligence platform
<https://astuntechnology.com/ishare/&gt;
GeoServer, PostGIS and QGIS training
<https://astuntechnology.com/services/#training&gt;
Helpdesk and customer portal
<http://support.astuntechnology.com/support/login&gt;

Company registration no. 5410695. Registered in England and Wales.
Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no.
864201149.
------------------------------------------------------------
------------------
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/
projects/geonetwork

--

*Vriendelijke groeten / Kind regards,Jose García
<http://www.geocat.net/&gt;Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv&gt;
<https://twitter.com/geocat_bv&gt;
<https://plus.google.com/u/1/+GeocatNetbv/posts&gt;Please consider the
environment before printing this email.*

Hi Jose,

We are seeing the problem in records in our new schema plugin for Gemini
2.2, so would I need to comment out those lines in both Gemini 2.2 and
iso19139? Also should I be looking in the headers for individual records
for the gmx schema declaration?

Thanks

Jo

On Fri, Aug 19, 2016 at 2:22 PM, Jose Garcia <jose.garcia@anonymised.com> wrote:

Hi Jo

I see this: https://github.com/geonetwork/core-geonetwork/blob/3.0.x/
schemas/iso19139/src/main/plugin/iso19139/layout/config-
editor.xml#L488-L490, have you commented that code?

Please check if the metadata schemaLocation defines the gmx namespace? I
think by default is not defined and probably that causes the issue. Please
check if the header contains the following in the *schemaLocation* field:

  http://www.isotc211.org/2005/gmx http://www.isotc211.org/2005/g
mx/gmx.xsd

If this is added in the xml header, the validation I guess should be fine.

Regards,
Jose García

On Thu, Jul 28, 2016 at 1:59 PM, Jo Cook <jocook@anonymised.com>
wrote:

Hi List,

Using Geonetwork 3.0.5, I have found a problem when validating records
against our revised Gemini 2.2 schema (
https://github.com/AstunTechnology/iso19139.gemini22_GN3). I am seeing
XSD
validation errors, which in the log files show up as:

<geonet:error>
    <geonet:typeOfError>ERROR</geonet:typeOfError>
    <geonet:errorNumber>1</geonet:errorNumber>
    <geonet:message>cvc-complex-type.2.4.a: Invalid content was found
starting with element 'gmx:Anchor'. One of '{"
http://www.isotc211.org/2005/gco&quot;:CharacterString\}' is expected.
(Element:
gmx:Anchor with parent element: gmd:code)</geonet:message>

<geonet:xpath>gmd:identificationInfo/gmd:MD_DataIdentificati
on/gmd:descriptiveKeywords[1]/gmd:MD_Keywords/gmd:
thesaurusName/gmd:CI_Citation/gmd:identifier/gmd:MD_
Identifier/gmd:code/gmx:Anchor</geonet:xpath>
  </geonet:error>

I have noticed, by comparing records before and after validation that the
gmd:identifier element is being added to the record automatically by
geonetwork at some point. It is not present in the records initially. If
the element is removed, then the record validates successfully. However,
it
is then re-added. I haven't quite figured out if it is re-added when you
switch from view to view (eg from INSPIRE to XML view) or whether it's
re-added when you save a record, or when you validate.

I have tried commenting out the sections referring to this in
config-editor.xml but that doesn't seem to help.

This seems to only happen to keywords from the inspire themes thesaurus,
and it happens whether the keyword existed in the record before it was
imported into geonetwork, or whether it's added during editing.

In Geonetwork 2.10 I would have modified update-fixed-info.xsl to fix this
problem but I can't figure out which file causes this element to be added.
I also don't know whether the best fix is to remove the identifier section
at all (which still seems to be valid for INSPIRE, as far as I can tell)
or
fix the XSD error some other way,

I am also seeing the error reported here:
https://github.com/geonetwork/util-gemet/issues/1 but I don't know if
that's a related problem or something separate.

Can anyone help?

Thanks

Jo

--
*Jo Cook*
t:+44 7930 524 155/twitter:@archaeogeek

--
--
Astun Technology Ltd, The Coach House, 17 West Street, Epsom, Surrey, KT18
7RL, UK
t:+44 1372 744 009 w: astuntechnology.com twitter:@astuntech
<https://twitter.com/astuntech&gt;

iShare - enterprise geographic intelligence platform
<https://astuntechnology.com/ishare/&gt;
GeoServer, PostGIS and QGIS training
<https://astuntechnology.com/services/#training&gt;
Helpdesk and customer portal
<http://support.astuntechnology.com/support/login&gt;

Company registration no. 5410695. Registered in England and Wales.
Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no.
864201149.
------------------------------------------------------------
------------------
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/project
s/geonetwork

--

*Vriendelijke groeten / Kind regards,Jose García
<http://www.geocat.net/&gt;Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv&gt;
<https://twitter.com/geocat_bv&gt;
<https://plus.google.com/u/1/+GeocatNetbv/posts&gt;Please consider the
environment before printing this email.*

--
*Jo Cook*
t:+44 7930 524 155/twitter:@archaeogeek

--
--
Astun Technology Ltd, The Coach House, 17 West Street, Epsom, Surrey, KT18
7RL, UK
t:+44 1372 744 009 w: astuntechnology.com twitter:@astuntech
<https://twitter.com/astuntech&gt;

iShare - enterprise geographic intelligence platform
<https://astuntechnology.com/ishare/&gt;
GeoServer, PostGIS and QGIS training
<https://astuntechnology.com/services/#training&gt;
Helpdesk and customer portal
<http://support.astuntechnology.com/support/login&gt;

Company registration no. 5410695. Registered in England and Wales.
Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no.
864201149.

Hi Jo

Before commenting out that lines, I would check in one of the metadata that
doesn't validate to confirm if the schemaLocation has the gmx namespace or
not. If it's not there, check in the Gemini 2.2 schema a similar line to
this:

https://github.com/geonetwork/core-geonetwork/blob/3.0.x/schemas/iso19139/src/main/plugin/iso19139/schema-ident.xml#L6

Probably, just adding the gmx namespace there will fix the issue.

Btw, is the Gemini 2.2 schema available online?

Regards,
Jose García

On Mon, Aug 22, 2016 at 3:08 PM, Jo Cook <jocook@anonymised.com> wrote:

Hi Jose,

We are seeing the problem in records in our new schema plugin for Gemini
2.2, so would I need to comment out those lines in both Gemini 2.2 and
iso19139? Also should I be looking in the headers for individual records
for the gmx schema declaration?

Thanks

Jo

On Fri, Aug 19, 2016 at 2:22 PM, Jose Garcia <jose.garcia@anonymised.com>
wrote:

Hi Jo

I see this: https://github.com/geonetwork/core-geonetwork/blob/3.0.x/sch
emas/iso19139/src/main/plugin/iso19139/layout/config-editor.xml#L488-L490,
have you commented that code?

Please check if the metadata schemaLocation defines the gmx namespace? I
think by default is not defined and probably that causes the issue. Please
check if the header contains the following in the *schemaLocation* field:

  http://www.isotc211.org/2005/gmx http://www.isotc211.org/2005/g
mx/gmx.xsd

If this is added in the xml header, the validation I guess should be fine.

Regards,
Jose García

On Thu, Jul 28, 2016 at 1:59 PM, Jo Cook <jocook@anonymised.com>
wrote:

Hi List,

Using Geonetwork 3.0.5, I have found a problem when validating records
against our revised Gemini 2.2 schema (
https://github.com/AstunTechnology/iso19139.gemini22_GN3). I am seeing
XSD
validation errors, which in the log files show up as:

<geonet:error>
    <geonet:typeOfError>ERROR</geonet:typeOfError>
    <geonet:errorNumber>1</geonet:errorNumber>
    <geonet:message>cvc-complex-type.2.4.a: Invalid content was found
starting with element 'gmx:Anchor'. One of '{"
http://www.isotc211.org/2005/gco&quot;:CharacterString\}' is expected.
(Element:
gmx:Anchor with parent element: gmd:code)</geonet:message>

<geonet:xpath>gmd:identificationInfo/gmd:MD_DataIdentificati
on/gmd:descriptiveKeywords[1]/gmd:MD_Keywords/gmd:thesaurusN
ame/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/
gmd:code/gmx:Anchor</geonet:xpath>
  </geonet:error>

I have noticed, by comparing records before and after validation that the
gmd:identifier element is being added to the record automatically by
geonetwork at some point. It is not present in the records initially. If
the element is removed, then the record validates successfully. However,
it
is then re-added. I haven't quite figured out if it is re-added when you
switch from view to view (eg from INSPIRE to XML view) or whether it's
re-added when you save a record, or when you validate.

I have tried commenting out the sections referring to this in
config-editor.xml but that doesn't seem to help.

This seems to only happen to keywords from the inspire themes thesaurus,
and it happens whether the keyword existed in the record before it was
imported into geonetwork, or whether it's added during editing.

In Geonetwork 2.10 I would have modified update-fixed-info.xsl to fix
this
problem but I can't figure out which file causes this element to be
added.
I also don't know whether the best fix is to remove the identifier
section
at all (which still seems to be valid for INSPIRE, as far as I can tell)
or
fix the XSD error some other way,

I am also seeing the error reported here:
https://github.com/geonetwork/util-gemet/issues/1 but I don't know if
that's a related problem or something separate.

Can anyone help?

Thanks

Jo

--
*Jo Cook*
t:+44 7930 524 155/twitter:@archaeogeek

--
--
Astun Technology Ltd, The Coach House, 17 West Street, Epsom, Surrey,
KT18
7RL, UK
t:+44 1372 744 009 w: astuntechnology.com twitter:@astuntech
<https://twitter.com/astuntech&gt;

iShare - enterprise geographic intelligence platform
<https://astuntechnology.com/ishare/&gt;
GeoServer, PostGIS and QGIS training
<https://astuntechnology.com/services/#training&gt;
Helpdesk and customer portal
<http://support.astuntechnology.com/support/login&gt;

Company registration no. 5410695. Registered in England and Wales.
Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no.
864201149.
------------------------------------------------------------
------------------
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/project
s/geonetwork

--

*Vriendelijke groeten / Kind regards,Jose García
<http://www.geocat.net/&gt;Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv&gt;
<https://twitter.com/geocat_bv&gt;
<https://plus.google.com/u/1/+GeocatNetbv/posts&gt;Please consider the
environment before printing this email.*

--
*Jo Cook*
t:+44 7930 524 155/twitter:@archaeogeek

--
Astun Technology Ltd, The Coach House, 17 West Street, Epsom, Surrey, KT18
7RL, UK
t:+44 1372 744 009 w: astuntechnology.com twitter:@astuntech
<https://twitter.com/astuntech&gt;

iShare - enterprise geographic intelligence platform
<https://astuntechnology.com/ishare/&gt;
GeoServer, PostGIS and QGIS training
<https://astuntechnology.com/services/#training&gt;
Helpdesk and customer portal
<http://support.astuntechnology.com/support/login&gt;

Company registration no. 5410695. Registered in England and Wales.
Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no.
864201149.

--

*Vriendelijke groeten / Kind regards,Jose García
<http://www.geocat.net/&gt;Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv&gt;
<https://twitter.com/geocat_bv&gt;
<https://plus.google.com/u/1/+GeocatNetbv/posts&gt;Please consider the
environment before printing this email.*