eblondel / geometa

R tools to write, read & validate geographic metadata (OGC/ISO 19110, 19115, 19119, 19136 and 19139)
https://github.com/eblondel/geometa/wiki
Other
44 stars 5 forks source link

geometa 0.7 / always ISO 19139 XML compliance: NO + readISO19139(url) geonetwork issue #190

Closed yvanlebras closed 1 year ago

yvanlebras commented 2 years ago

Hi Emmanuel!

Hope all is ok on your side! I am testing geometa as we want to propose a Galaxy tool to validate ISO 19115 xml documents and propose metadata translations. For now, @Marie59 created a conda recipe for geometa so it will be easier to install and use it in any OS and for any kind of environment! Newt step is to look at create a Galaxy tool using this recipe. So, I finally take some times to make some tests before proposing a relevant Galaxy tool !

I was testing on several geonetwork ISO files, and notably a Wilfried one, I think from here http://147.100.164.43:8080/geonetwork/srv/api/records/pyrenees

Here is my code:

library("geometa")
library("ncdf4")
require(XML)
xml <- xmlParse("~pyrenees.xml")
#read XML as ISOMetadata object!
md <- ISOMetadata$new(xml = xml)
# validate iso and inspire (need apikey)
library("httr")
md$encode()

Here is the result:

[geometa][WARN] Element '{http://www.isotc211.org/2005/gco}DateTime': This element is not expected. Expected is one of ( {http://www.isotc211.org/2005/gco}CharacterString, {http://www.isotc211.org/2005/gmd}CI_RoleCode, {http://www.isotc211.org/2005/gmd}CI_PresentationFormCode, {http://www.isotc211.org/2005/gmd}CI_OnLineFunctionCode, {http://www.isotc211.org/2005/gmd}CI_DateTypeCode, {http://www.isotc211.org/2005/gmd}MD_PixelOrientationCode, {http://www.isotc211.org/2005/gmd}MD_TopologyLevelCode, {http://www.isotc211.org/2005/gmd}MD_GeometricObjectTypeCode, {http://www.isotc211.org/2005/gmd}MD_CellGeometryCode, {http://www.isotc211.org/2005/gmd}MD_DimensionNameTypeCode ) at line 128. 
[geometa][WARN] Object 'ISOMetadata' is INVALID according to ISO 19139 XML schemas! 
<gmd:MD_Metadata xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gfc="http://www.isotc211.org/2005/gfc" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gmi="http://www.isotc211.org/2005/gmi" xmlns:gmx="http://www.isotc211.org/2005/gmx" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmlcov="http://www.opengis.net/gmlcov/1.0" xmlns:gmlrgrid="http://www.opengis.net/gml/3.3/rgrid" xmlns:swe="http://www.opengis.net/swe/2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <gmd:fileIdentifier>
    <gco:CharacterString>pyrenees</gco:CharacterString>
  </gmd:fileIdentifier>
  <gmd:language>
    <gmd:LanguageCode codeList="http://www.loc.gov/standards/iso639-2/" codeListValue="fre" codeSpace="ISO 639-2">French</gmd:LanguageCode>
  </gmd:language>
  <gmd:characterSet>
    <gmd:MD_CharacterSetCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_CharacterSetCode" codeListValue="utf8">utf8</gmd:MD_CharacterSetCode>
  </gmd:characterSet>
  <gmd:hierarchyLevel>
    <gmd:MD_ScopeCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MX_ScopeCode" codeListValue="dataset" codeSpace="ISOTC211/19115">dataset</gmd:MD_ScopeCode>
  </gmd:hierarchyLevel>
  <gmd:contact>
    <gmd:CI_ResponsibleParty>
      <gmd:individualName>
        <gco:CharacterString>Wilfried Heintz</gco:CharacterString>
      </gmd:individualName>
      <gmd:organisationName>
        <gco:CharacterString>INRAE, UMR DYNAFOR</gco:CharacterString>
      </gmd:organisationName>
      <gmd:positionName>
        <gco:CharacterString>Engineer</gco:CharacterString>
      </gmd:positionName>
      <gmd:contactInfo>
        <gmd:CI_Contact>
          <gmd:phone>
            <gmd:CI_Telephone>
              <gmd:voice>
                <gco:CharacterString>(+33)561285516</gco:CharacterString>
              </gmd:voice>
              <gmd:facsimile gco:nilReason="missing"/>
            </gmd:CI_Telephone>
          </gmd:phone>
          <gmd:address>
            <gmd:CI_Address>
              <gmd:deliveryPoint>
                <gco:CharacterString>24 chemin de Borde Rouge CS 52627</gco:CharacterString>
              </gmd:deliveryPoint>
              <gmd:city>
                <gco:CharacterString>Castanet-Tolosan</gco:CharacterString>
              </gmd:city>
              <gmd:postalCode>
                <gco:CharacterString>31326</gco:CharacterString>
              </gmd:postalCode>
              <gmd:country>
                <gco:CharacterString>France</gco:CharacterString>
              </gmd:country>
              <gmd:electronicMailAddress>
                <gco:CharacterString>wilfried.heintz@inrae.fr</gco:CharacterString>
              </gmd:electronicMailAddress>
            </gmd:CI_Address>
          </gmd:address>
          <gmd:onlineResource>
            <gmd:CI_OnlineResource>
              <gmd:linkage gco:nilReason="missing"/>
              <gmd:name gco:nilReason="missing"/>
            </gmd:CI_OnlineResource>
          </gmd:onlineResource>
        </gmd:CI_Contact>
      </gmd:contactInfo>
      <gmd:role>
        <gmd:CI_RoleCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact" codeSpace="ISOTC211/19115">pointOfContact</gmd:CI_RoleCode>
      </gmd:role>
    </gmd:CI_ResponsibleParty>
  </gmd:contact>
  <gmd:dateStamp>
    <gco:DateTime>2020-03-26T15:47:03</gco:DateTime>
  </gmd:dateStamp>
  <gmd:metadataStandardName>
    <gco:CharacterString>ISO 19115:2003/19139</gco:CharacterString>
  </gmd:metadataStandardName>
  <gmd:metadataStandardVersion>
    <gco:CharacterString>1.0</gco:CharacterString>
  </gmd:metadataStandardVersion>
  <gmd:dataSetURI>
    <gco:CharacterString>pyrenees</gco:CharacterString>
  </gmd:dataSetURI>
  <gmd:spatialRepresentationInfo>
    <gmd:MD_VectorSpatialRepresentation>
      <gmd:topologyLevel>
        <gmd:MD_TopologyLevelCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_TopologyLevelCode" codeListValue="geometryOnly" codeSpace="ISOTC211/19115">geometryOnly</gmd:MD_TopologyLevelCode>
      </gmd:topologyLevel>
      <gmd:geometricObjects>
        <gmd:MD_GeometricObjects>
          <gmd:geometricObjectType>
            <gmd:MD_GeometricObjectTypeCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_GeometricObjectTypeCode" codeListValue="surface" codeSpace="ISOTC211/19115">surface</gmd:MD_GeometricObjectTypeCode>
          </gmd:geometricObjectType>
          <gmd:geometricObjectCount>
            <gco:Integer>91380</gco:Integer>
          </gmd:geometricObjectCount>
        </gmd:MD_GeometricObjects>
      </gmd:geometricObjects>
    </gmd:MD_VectorSpatialRepresentation>
  </gmd:spatialRepresentationInfo>
  <gmd:referenceSystemInfo>
    <gmd:MD_ReferenceSystem>
      <gmd:referenceSystemIdentifier>
        <gmd:RS_Identifier>
          <gmd:code>
            <gco:CharacterString>2154</gco:CharacterString>
          </gmd:code>
          <gmd:codeSpace>
            <gco:CharacterString>EPSG</gco:CharacterString>
          </gmd:codeSpace>
        </gmd:RS_Identifier>
      </gmd:referenceSystemIdentifier>
    </gmd:MD_ReferenceSystem>
  </gmd:referenceSystemInfo>
  <gmd:identificationInfo>
    <gmd:MD_DataIdentification>
      <gmd:citation>
        <gmd:CI_Citation>
          <gmd:title>
            <gco:CharacterString>Forêts anciennes des Pyrénées</gco:CharacterString>
          </gmd:title>
          <gmd:date>
            <gmd:CI_Date>
              <gmd:date>
                <gco:Date>2012-01-27</gco:Date>
              </gmd:date>
              <gmd:dateType>
                <gmd:CI_DateTypeCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_DateTypeCode" codeListValue="creation" codeSpace="ISOTC211/19115">creation</gmd:CI_DateTypeCode>
              </gmd:dateType>
            </gmd:CI_Date>
          </gmd:date>
          <gmd:edition>
            <gco:DateTime>2020-03-26T15:03:07</gco:DateTime>
          </gmd:edition>
          <gmd:editionDate>
            <gco:DateTime>2020-03-26T15:47:07</gco:DateTime>
          </gmd:editionDate>
          <gmd:identifier>
            <gmd:MD_Identifier>
              <gmd:code>
                <gco:CharacterString>pyrenees</gco:CharacterString>
              </gmd:code>
            </gmd:MD_Identifier>
          </gmd:identifier>
          <gmd:citedResponsibleParty>
            <gmd:CI_ResponsibleParty>
              <gmd:individualName>
                <gco:CharacterString>Laurent Larrieu</gco:CharacterString>
              </gmd:individualName>
              <gmd:organisationName>
                <gco:CharacterString>INRAE</gco:CharacterString>
              </gmd:organisationName>
              <gmd:positionName>
                <gco:CharacterString>Engineer</gco:CharacterString>
              </gmd:positionName>
              <gmd:contactInfo>
                <gmd:CI_Contact>
                  <gmd:phone>
                    <gmd:CI_Telephone>
                      <gmd:voice>
                        <gco:CharacterString>(+33)</gco:CharacterString>
                      </gmd:voice>
                      <gmd:facsimile gco:nilReason="missing"/>
                    </gmd:CI_Telephone>
                  </gmd:phone>
                  <gmd:address>
                    <gmd:CI_Address>
                      <gmd:deliveryPoint>
                        <gco:CharacterString>rue</gco:CharacterString>
                      </gmd:deliveryPoint>
                      <gmd:city>
                        <gco:CharacterString>ville</gco:CharacterString>
                      </gmd:city>
                      <gmd:postalCode>
                        <gco:CharacterString>0</gco:CharacterString>
                      </gmd:postalCode>
                      <gmd:country>
                        <gco:CharacterString>France</gco:CharacterString>
                      </gmd:country>
                      <gmd:electronicMailAddress>
                        <gco:CharacterString>laurent.larrieu@inrae.fr</gco:CharacterString>
                      </gmd:electronicMailAddress>
                    </gmd:CI_Address>
                  </gmd:address>
                  <gmd:onlineResource>
                    <gmd:CI_OnlineResource>
                      <gmd:linkage gco:nilReason="missing"/>
                      <gmd:name gco:nilReason="missing"/>
                    </gmd:CI_OnlineResource>
                  </gmd:onlineResource>
                </gmd:CI_Contact>
              </gmd:contactInfo>
              <gmd:role>
                <gmd:CI_RoleCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_RoleCode" codeListValue="owner" codeSpace="ISOTC211/19115">owner</gmd:CI_RoleCode>
              </gmd:role>
            </gmd:CI_ResponsibleParty>
          </gmd:citedResponsibleParty>
          <gmd:citedResponsibleParty>
            <gmd:CI_ResponsibleParty>
              <gmd:individualName>
                <gco:CharacterString>Wilfried Heintz</gco:CharacterString>
              </gmd:individualName>
              <gmd:organisationName>
                <gco:CharacterString>INRAE, UMR DYNAFOR</gco:CharacterString>
              </gmd:organisationName>
              <gmd:positionName>
                <gco:CharacterString>Engineer</gco:CharacterString>
              </gmd:positionName>
              <gmd:contactInfo>
                <gmd:CI_Contact>
                  <gmd:phone>
                    <gmd:CI_Telephone>
                      <gmd:voice>
                        <gco:CharacterString>(+33)561285516</gco:CharacterString>
                      </gmd:voice>
                      <gmd:facsimile gco:nilReason="missing"/>
                    </gmd:CI_Telephone>
                  </gmd:phone>
                  <gmd:address>
                    <gmd:CI_Address>
                      <gmd:deliveryPoint>
                        <gco:CharacterString>24 chemin de Borde Rouge CS 52627</gco:CharacterString>
                      </gmd:deliveryPoint>
                      <gmd:city>
                        <gco:CharacterString>Castanet-Tolosan</gco:CharacterString>
                      </gmd:city>
                      <gmd:postalCode>
                        <gco:CharacterString>31326</gco:CharacterString>
                      </gmd:postalCode>
                      <gmd:country>
                        <gco:CharacterString>France</gco:CharacterString>
                      </gmd:country>
                      <gmd:electronicMailAddress>
                        <gco:CharacterString>wilfried.heintz@inrae.fr</gco:CharacterString>
                      </gmd:electronicMailAddress>
                    </gmd:CI_Address>
                  </gmd:address>
                  <gmd:onlineResource>
                    <gmd:CI_OnlineResource>
                      <gmd:linkage gco:nilReason="missing"/>
                      <gmd:name gco:nilReason="missing"/>
                    </gmd:CI_OnlineResource>
                  </gmd:onlineResource>
                </gmd:CI_Contact>
              </gmd:contactInfo>
              <gmd:role>
                <gmd:CI_RoleCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_RoleCode" codeListValue="owner" codeSpace="ISOTC211/19115">owner</gmd:CI_RoleCode>
              </gmd:role>
            </gmd:CI_ResponsibleParty>
          </gmd:citedResponsibleParty>
          <gmd:presentationForm>
            <gmd:CI_PresentationFormCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_PresentationFormCode" codeListValue="mapDigital" codeSpace="ISOTC211/19115">mapDigital</gmd:CI_PresentationFormCode>
          </gmd:presentationForm>
        </gmd:CI_Citation>
      </gmd:citation>
      <gmd:abstract>
        <gco:CharacterString>Cartographie de l'occupation ancienne du sol du massif des Pyrénées réalisée à partir de la digitalisation des minutes de cartes d'Etat Major. (2012-04-01)</gco:CharacterString>
      </gmd:abstract>
      <gmd:pointOfContact>
        <gmd:CI_ResponsibleParty>
          <gmd:individualName>
            <gco:CharacterString>Wilfried Heintz</gco:CharacterString>
          </gmd:individualName>
          <gmd:organisationName>
            <gco:CharacterString>INRAE, UMR DYNAFOR</gco:CharacterString>
          </gmd:organisationName>
          <gmd:positionName>
            <gco:CharacterString>Engineer</gco:CharacterString>
          </gmd:positionName>
          <gmd:contactInfo>
            <gmd:CI_Contact>
              <gmd:phone>
                <gmd:CI_Telephone>
                  <gmd:voice>
                    <gco:CharacterString>(+33)561285516</gco:CharacterString>
                  </gmd:voice>
                  <gmd:facsimile gco:nilReason="missing"/>
                </gmd:CI_Telephone>
              </gmd:phone>
              <gmd:address>
                <gmd:CI_Address>
                  <gmd:deliveryPoint>
                    <gco:CharacterString>24 chemin de Borde Rouge CS 52627</gco:CharacterString>
                  </gmd:deliveryPoint>
                  <gmd:city>
                    <gco:CharacterString>Castanet-Tolosan</gco:CharacterString>
                  </gmd:city>
                  <gmd:postalCode>
                    <gco:CharacterString>31326</gco:CharacterString>
                  </gmd:postalCode>
                  <gmd:country>
                    <gco:CharacterString>France</gco:CharacterString>
                  </gmd:country>
                  <gmd:electronicMailAddress>
                    <gco:CharacterString>wilfried.heintz@inrae.fr</gco:CharacterString>
                  </gmd:electronicMailAddress>
                </gmd:CI_Address>
              </gmd:address>
              <gmd:onlineResource>
                <gmd:CI_OnlineResource>
                  <gmd:linkage gco:nilReason="missing"/>
                  <gmd:name gco:nilReason="missing"/>
                </gmd:CI_OnlineResource>
              </gmd:onlineResource>
            </gmd:CI_Contact>
          </gmd:contactInfo>
          <gmd:role>
            <gmd:CI_RoleCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_RoleCode" codeListValue="metadata" codeSpace="ISOTC211/19115">metadata</gmd:CI_RoleCode>
          </gmd:role>
        </gmd:CI_ResponsibleParty>
      </gmd:pointOfContact>
      <gmd:pointOfContact>
        <gmd:CI_ResponsibleParty>
          <gmd:individualName>
            <gco:CharacterString>Laurent Larrieu</gco:CharacterString>
          </gmd:individualName>
          <gmd:organisationName>
            <gco:CharacterString>INRAE</gco:CharacterString>
          </gmd:organisationName>
          <gmd:positionName>
            <gco:CharacterString>Engineer</gco:CharacterString>
          </gmd:positionName>
          <gmd:contactInfo>
            <gmd:CI_Contact>
              <gmd:phone>
                <gmd:CI_Telephone>
                  <gmd:voice>
                    <gco:CharacterString>(+33)</gco:CharacterString>
                  </gmd:voice>
                  <gmd:facsimile gco:nilReason="missing"/>
                </gmd:CI_Telephone>
              </gmd:phone>
              <gmd:address>
                <gmd:CI_Address>
                  <gmd:deliveryPoint>
                    <gco:CharacterString>rue</gco:CharacterString>
                  </gmd:deliveryPoint>
                  <gmd:city>
                    <gco:CharacterString>ville</gco:CharacterString>
                  </gmd:city>
                  <gmd:postalCode>
                    <gco:CharacterString>0</gco:CharacterString>
                  </gmd:postalCode>
                  <gmd:country>
                    <gco:CharacterString>France</gco:CharacterString>
                  </gmd:country>
                  <gmd:electronicMailAddress>
                    <gco:CharacterString>laurent.larrieu@inrae.fr</gco:CharacterString>
                  </gmd:electronicMailAddress>
                </gmd:CI_Address>
              </gmd:address>
              <gmd:onlineResource>
                <gmd:CI_OnlineResource>
                  <gmd:linkage gco:nilReason="missing"/>
                  <gmd:name gco:nilReason="missing"/>
                </gmd:CI_OnlineResource>
              </gmd:onlineResource>
            </gmd:CI_Contact>
          </gmd:contactInfo>
          <gmd:role>
            <gmd:CI_RoleCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_RoleCode" codeListValue="owner" codeSpace="ISOTC211/19115">owner</gmd:CI_RoleCode>
          </gmd:role>
        </gmd:CI_ResponsibleParty>
      </gmd:pointOfContact>
      <gmd:pointOfContact>
        <gmd:CI_ResponsibleParty>
          <gmd:individualName>
            <gco:CharacterString>Wilfried Heintz</gco:CharacterString>
          </gmd:individualName>
          <gmd:organisationName>
            <gco:CharacterString>INRAE, UMR DYNAFOR</gco:CharacterString>
          </gmd:organisationName>
          <gmd:positionName>
            <gco:CharacterString>Engineer</gco:CharacterString>
          </gmd:positionName>
          <gmd:contactInfo>
            <gmd:CI_Contact>
              <gmd:phone>
                <gmd:CI_Telephone>
                  <gmd:voice>
                    <gco:CharacterString>(+33)561285516</gco:CharacterString>
                  </gmd:voice>
                  <gmd:facsimile gco:nilReason="missing"/>
                </gmd:CI_Telephone>
              </gmd:phone>
              <gmd:address>
                <gmd:CI_Address>
                  <gmd:deliveryPoint>
                    <gco:CharacterString>24 chemin de Borde Rouge CS 52627</gco:CharacterString>
                  </gmd:deliveryPoint>
                  <gmd:city>
                    <gco:CharacterString>Castanet-Tolosan</gco:CharacterString>
                  </gmd:city>
                  <gmd:postalCode>
                    <gco:CharacterString>31326</gco:CharacterString>
                  </gmd:postalCode>
                  <gmd:country>
                    <gco:CharacterString>France</gco:CharacterString>
                  </gmd:country>
                  <gmd:electronicMailAddress>
                    <gco:CharacterString>wilfried.heintz@inrae.fr</gco:CharacterString>
                  </gmd:electronicMailAddress>
                </gmd:CI_Address>
              </gmd:address>
              <gmd:onlineResource>
                <gmd:CI_OnlineResource>
                  <gmd:linkage gco:nilReason="missing"/>
                  <gmd:name gco:nilReason="missing"/>
                </gmd:CI_OnlineResource>
              </gmd:onlineResource>
            </gmd:CI_Contact>
          </gmd:contactInfo>
          <gmd:role>
            <gmd:CI_RoleCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_RoleCode" codeListValue="owner" codeSpace="ISOTC211/19115">owner</gmd:CI_RoleCode>
          </gmd:role>
        </gmd:CI_ResponsibleParty>
      </gmd:pointOfContact>
      <gmd:pointOfContact>
        <gmd:CI_ResponsibleParty>
          <gmd:individualName>
            <gco:CharacterString>Wilfried Heintz</gco:CharacterString>
          </gmd:individualName>
          <gmd:organisationName>
            <gco:CharacterString>INRAE, UMR DYNAFOR</gco:CharacterString>
          </gmd:organisationName>
          <gmd:positionName>
            <gco:CharacterString>Engineer</gco:CharacterString>
          </gmd:positionName>
          <gmd:contactInfo>
            <gmd:CI_Contact>
              <gmd:phone>
                <gmd:CI_Telephone>
                  <gmd:voice>
                    <gco:CharacterString>(+33)561285516</gco:CharacterString>
                  </gmd:voice>
                  <gmd:facsimile gco:nilReason="missing"/>
                </gmd:CI_Telephone>
              </gmd:phone>
              <gmd:address>
                <gmd:CI_Address>
                  <gmd:deliveryPoint>
                    <gco:CharacterString>24 chemin de Borde Rouge CS 52627</gco:CharacterString>
                  </gmd:deliveryPoint>
                  <gmd:city>
                    <gco:CharacterString>Castanet-Tolosan</gco:CharacterString>
                  </gmd:city>
                  <gmd:postalCode>
                    <gco:CharacterString>31326</gco:CharacterString>
                  </gmd:postalCode>
                  <gmd:country>
                    <gco:CharacterString>France</gco:CharacterString>
                  </gmd:country>
                  <gmd:electronicMailAddress>
                    <gco:CharacterString>wilfried.heintz@inrae.fr</gco:CharacterString>
                  </gmd:electronicMailAddress>
                </gmd:CI_Address>
              </gmd:address>
              <gmd:onlineResource>
                <gmd:CI_OnlineResource>
                  <gmd:linkage gco:nilReason="missing"/>
                  <gmd:name gco:nilReason="missing"/>
                </gmd:CI_OnlineResource>
              </gmd:onlineResource>
            </gmd:CI_Contact>
          </gmd:contactInfo>
          <gmd:role>
            <gmd:CI_RoleCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact" codeSpace="ISOTC211/19115">pointOfContact</gmd:CI_RoleCode>
          </gmd:role>
        </gmd:CI_ResponsibleParty>
      </gmd:pointOfContact>
      <gmd:resourceMaintenance>
        <gmd:MD_MaintenanceInformation>
          <gmd:maintenanceAndUpdateFrequency>
            <gmd:MD_MaintenanceFrequencyCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_MaintenanceFrequencyCode" codeListValue="asNeeded" codeSpace="ISOTC211/19115">asNeeded</gmd:MD_MaintenanceFrequencyCode>
          </gmd:maintenanceAndUpdateFrequency>
        </gmd:MD_MaintenanceInformation>
      </gmd:resourceMaintenance>
      <gmd:graphicOverview>
        <gmd:MD_BrowseGraphic>
          <gmd:fileName>
            <gco:CharacterString>https://dynids.toulouse.inra.fr:8444/geoserver/forets_anciennes/ows?service=WMS&amp;version=1.1.0&amp;request=GetMap&amp;layers=pyrenees&amp;bbox=311090.112199999,6137120.9254,714654,6269615&amp;width=600&amp;height=300&amp;srs=EPSG:2154&amp;format=image/png</gco:CharacterString>
          </gmd:fileName>
          <gmd:fileDescription>
            <gco:CharacterString>pyrenees</gco:CharacterString>
          </gmd:fileDescription>
        </gmd:MD_BrowseGraphic>
      </gmd:graphicOverview>
      <gmd:graphicOverview>
        <gmd:MD_BrowseGraphic>
          <gmd:fileName>
            <gco:CharacterString>http://wheintz.github.io/assets/img/Dynafor.jpg</gco:CharacterString>
          </gmd:fileName>
          <gmd:fileDescription>
            <gco:CharacterString>Logo</gco:CharacterString>
          </gmd:fileDescription>
        </gmd:MD_BrowseGraphic>
      </gmd:graphicOverview>
      <gmd:descriptiveKeywords>
        <gmd:MD_Keywords>
          <gmd:keyword>
            <gco:CharacterString>Occupation du sol</gco:CharacterString>
          </gmd:keyword>
          <gmd:keyword>
            <gco:CharacterString>Forêts anciennes</gco:CharacterString>
          </gmd:keyword>
          <gmd:keyword>
            <gco:CharacterString>Digitalisation</gco:CharacterString>
          </gmd:keyword>
          <gmd:keyword>
            <gco:CharacterString>Pyrénées</gco:CharacterString>
          </gmd:keyword>
          <gmd:keyword>
            <gco:CharacterString>Minutes d'Etat Major</gco:CharacterString>
          </gmd:keyword>
          <gmd:type>
            <gmd:MD_KeywordTypeCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_KeywordTypeCode" codeListValue="theme" codeSpace="ISOTC211/19115">theme</gmd:MD_KeywordTypeCode>
          </gmd:type>
          <gmd:thesaurusName>
            <gmd:CI_Citation>
              <gmd:title>
                <gco:CharacterString>GENERAL</gco:CharacterString>
              </gmd:title>
              <gmd:date>
                <gmd:CI_Date>
                  <gmd:date>
                    <gco:Date>2020-03-26</gco:Date>
                  </gmd:date>
                  <gmd:dateType>
                    <gmd:CI_DateTypeCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_DateTypeCode" codeListValue="lastRevision" codeSpace="ISOTC211/19115">lastRevision</gmd:CI_DateTypeCode>
                  </gmd:dateType>
                </gmd:CI_Date>
              </gmd:date>
            </gmd:CI_Citation>
          </gmd:thesaurusName>
        </gmd:MD_Keywords>
      </gmd:descriptiveKeywords>
      <gmd:resourceConstraints>
        <gmd:MD_LegalConstraints>
          <gmd:useLimitation>
            <gco:CharacterString>Licence CC-By</gco:CharacterString>
          </gmd:useLimitation>
          <gmd:useConstraints>
            <gmd:MD_RestrictionCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_RestrictionCode" codeListValue="license" codeSpace="ISOTC211/19115">license</gmd:MD_RestrictionCode>
          </gmd:useConstraints>
        </gmd:MD_LegalConstraints>
      </gmd:resourceConstraints>
      <gmd:spatialRepresentationType>
        <gmd:MD_SpatialRepresentationTypeCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_SpatialRepresentationTypeCode" codeListValue="vector">vector</gmd:MD_SpatialRepresentationTypeCode>
      </gmd:spatialRepresentationType>
      <gmd:language>
        <gmd:LanguageCode codeList="http://www.loc.gov/standards/iso639-2/" codeListValue="fre" codeSpace="ISO 639-2">French</gmd:LanguageCode>
      </gmd:language>
      <gmd:characterSet>
        <gmd:MD_CharacterSetCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_CharacterSetCode" codeListValue="utf8">utf8</gmd:MD_CharacterSetCode>
      </gmd:characterSet>
      <gmd:extent>
        <gmd:EX_Extent>
          <gmd:geographicElement>
            <gmd:EX_GeographicBoundingBox>
              <gmd:westBoundLongitude>
                <gco:Decimal>311090.112199999</gco:Decimal>
              </gmd:westBoundLongitude>
              <gmd:eastBoundLongitude>
                <gco:Decimal>714654.00</gco:Decimal>
              </gmd:eastBoundLongitude>
              <gmd:southBoundLatitude>
                <gco:Decimal>6137120.9254</gco:Decimal>
              </gmd:southBoundLatitude>
              <gmd:northBoundLatitude>
                <gco:Decimal>6269615.00</gco:Decimal>
              </gmd:northBoundLatitude>
            </gmd:EX_GeographicBoundingBox>
          </gmd:geographicElement>
          <gmd:temporalElement>
            <gmd:EX_TemporalExtent>
              <gmd:extent>
                <gml:TimePeriod gml:id="P41Y">
                  <gml:beginPosition>1840</gml:beginPosition>
                  <gml:endPosition>1880</gml:endPosition>
                </gml:TimePeriod>
              </gmd:extent>
            </gmd:EX_TemporalExtent>
          </gmd:temporalElement>
        </gmd:EX_Extent>
      </gmd:extent>
      <gmd:supplementalInformation gco:nilReason="missing"/>
    </gmd:MD_DataIdentification>
  </gmd:identificationInfo>
  <gmd:distributionInfo>
    <gmd:MD_Distribution>
      <gmd:transferOptions>
        <gmd:MD_DigitalTransferOptions>
          <gmd:onLine>
            <gmd:CI_OnlineResource>
              <gmd:linkage>
                <gmd:URL>https://prodinra.inra.fr/record/386328</gmd:URL>
              </gmd:linkage>
              <gmd:protocol>
                <gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
              </gmd:protocol>
              <gmd:name>
                <gco:CharacterString>publication</gco:CharacterString>
              </gmd:name>
              <gmd:description>
                <gco:CharacterString>Cartographie des forêts anciennes de France - Objectifs bilan et perspectives</gco:CharacterString>
              </gmd:description>
            </gmd:CI_OnlineResource>
          </gmd:onLine>
          <gmd:onLine>
            <gmd:CI_OnlineResource>
              <gmd:linkage>
                <gmd:URL>https://prodinra.inra.fr/record/185677</gmd:URL>
              </gmd:linkage>
              <gmd:protocol>
                <gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
              </gmd:protocol>
              <gmd:name>
                <gco:CharacterString>publication</gco:CharacterString>
              </gmd:name>
              <gmd:description>
                <gco:CharacterString>Digitalisation et géoréférencement des cartes minutes de l'état major du Parc National des Pyrénées pour une analyse des forêts anciennes</gco:CharacterString>
              </gmd:description>
            </gmd:CI_OnlineResource>
          </gmd:onLine>
          <gmd:onLine>
            <gmd:CI_OnlineResource>
              <gmd:linkage>
                <gmd:URL>https://dynids.toulouse.inra.fr:8444/geoserver/forets_anciennes/ows?service=WMS</gmd:URL>
              </gmd:linkage>
              <gmd:protocol>
                <gco:CharacterString>OGC:WMS-1.1.0-http-get-map</gco:CharacterString>
              </gmd:protocol>
              <gmd:name>
                <gco:CharacterString>pyrenees</gco:CharacterString>
              </gmd:name>
              <gmd:description>
                <gco:CharacterString>Forêts anciennes des Pyrénées</gco:CharacterString>
              </gmd:description>
            </gmd:CI_OnlineResource>
          </gmd:onLine>
          <gmd:onLine>
            <gmd:CI_OnlineResource>
              <gmd:linkage>
                <gmd:URL>https://dynids.toulouse.inra.fr:8444/geoserver/forets_anciennes/ows?service=WFS&amp;request=GetFeature&amp;version=1.0.0&amp;typeName=pyrenees</gmd:URL>
              </gmd:linkage>
              <gmd:protocol>
                <gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
              </gmd:protocol>
              <gmd:name>
                <gco:CharacterString>pyrenees</gco:CharacterString>
              </gmd:name>
              <gmd:description>
                <gco:CharacterString>Forêts anciennes des Pyrénées - GIS Data Download (GML)</gco:CharacterString>
              </gmd:description>
            </gmd:CI_OnlineResource>
          </gmd:onLine>
          <gmd:onLine>
            <gmd:CI_OnlineResource>
              <gmd:linkage>
                <gmd:URL>https://dynids.toulouse.inra.fr:8444/geoserver/forets_anciennes/ows?service=WFS&amp;request=GetFeature&amp;version=1.0.0&amp;typeName=pyrenees&amp;outputFormat=json</gmd:URL>
              </gmd:linkage>
              <gmd:protocol>
                <gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
              </gmd:protocol>
              <gmd:name>
                <gco:CharacterString>pyrenees</gco:CharacterString>
              </gmd:name>
              <gmd:description>
                <gco:CharacterString>Forêts anciennes des Pyrénées - GIS Data Download (GeoJSON)</gco:CharacterString>
              </gmd:description>
            </gmd:CI_OnlineResource>
          </gmd:onLine>
          <gmd:onLine>
            <gmd:CI_OnlineResource>
              <gmd:linkage>
                <gmd:URL>https://dynids.toulouse.inra.fr:8444/geoserver/forets_anciennes/ows?service=WFS&amp;request=GetFeature&amp;version=1.0.0&amp;typeName=pyrenees&amp;outputFormat=SHAPE-ZIP</gmd:URL>
              </gmd:linkage>
              <gmd:protocol>
                <gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
              </gmd:protocol>
              <gmd:name>
                <gco:CharacterString>pyrenees</gco:CharacterString>
              </gmd:name>
              <gmd:description>
                <gco:CharacterString>Forêts anciennes des Pyrénées - GIS Data Download (ESRI Shapefile)</gco:CharacterString>
              </gmd:description>
            </gmd:CI_OnlineResource>
          </gmd:onLine>
        </gmd:MD_DigitalTransferOptions>
      </gmd:transferOptions>
    </gmd:MD_Distribution>
  </gmd:distributionInfo>
  <gmd:dataQualityInfo>
    <gmd:DQ_DataQuality>
      <gmd:scope>
        <gmd:DQ_Scope>
          <gmd:level>
            <gmd:MD_ScopeCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MX_ScopeCode" codeListValue="dataset" codeSpace="ISOTC211/19115">dataset</gmd:MD_ScopeCode>
          </gmd:level>
        </gmd:DQ_Scope>
      </gmd:scope>
      <gmd:lineage>
        <gmd:LI_Lineage>
          <gmd:statement>
            <gco:CharacterString>La réalisation de cette carte en 2013 sur l’ensemble du massif pyrénéen a nécessité l’exploitation de 33 dalles minutes d’Etat-Major et un travail manuel de géoréferencement et vectorisation des polygones d'occupation des sols. Nous ne pouvons donc pas garantir les 100% de bien classés.</gco:CharacterString>
          </gmd:statement>
        </gmd:LI_Lineage>
      </gmd:lineage>
    </gmd:DQ_DataQuality>
  </gmd:dataQualityInfo>
  <!--Metadata Creation date/time: 2022-06-13T23:16:18-->
  <!--ISO 19139 XML generated by geometa R package - Version 0.7-->
  <!--ISO 19139 XML compliance: NO-->
  <!--geometa R package information:    Contact: Emmanuel Blondel emmanuel.blondel1@gmail.com   URL: https://github.com/eblondel/geometa/wiki   BugReports: https://github.com/eblondel/geometa/issues-->
</gmd:MD_Metadata> 

Not sure I am making things the good way and I am a geometa newbie, so maybe this is ""normal"" that ISO compliance is not ok... Or maybe I made something wrong....

Don't hesitate to say! ;)

Have a nice week, Yvan

eblondel commented 2 years ago

@yvanlebras This metadata sheet is not valid. You should liaise with @wheintz he may want to update it. First error mentioned when doing validation relates to the citation 'edition', This should be a string. This metadata had been generated with geoflow in the past, where the edition was set with a datetime object, not valid for ISO/OGC schemas. The current code prevents this setting as.character when using setEdition. However, decoding an existing XML will not coerce the date to character, it sees a gco:DateTime, so it converts it to the equivalent R binding (POSIXt).

yvanlebras commented 2 years ago

Thank You so much Emmanuel for your rapid and detailled feedback! So the ISO is not valid! "Ah ba bravo Wilfried ;)" Will come back to him. A particular point is that I am testing several metadata documents, from several geonetwork catalogs, and for now, no one is valid... It appears to me that this is strange, but maybe this can be explained by several reasons... One interrogation I have is that on the PNDB side, we can't upload EML metadata documents if they are not valid... And, on geonetwork, it appears you can upload metadata document not valid regarding ISO19139 spec ? Sorry if this is "just" something I discover because I am a GIS newbie ;) AND Thank you for geometa, really easy to use ! Looking forward to create a related Galaxy tools so we can exacute these tests on batch mode quite easily (I don't think we can execute geometa ISO compliance test on URL from ISO xlm docs isn't it?)!

eblondel commented 2 years ago

I precise that it was not valid because of an issue in geometa in the past ;-) in the geoflow action dedicated to ISO 19115 production.

In Geonetwork, validation is weird. I validate ISO 19115/19139 in geometa using XSD schema definitions. In geonetwork as well, but they don't use the same version of the XSD schemas specifications. I should probably look into that and compare schema uses, but I didn't have time to dig into that.

With geometa, you can use readISO19139 function that accept a file or url, and next test if they are valid, but indeed you will have to read the XML doing that.

yvanlebras commented 2 years ago

OK, we have time to dig into that as this is our job ;) I will keep you informed!

Thank you again for this amazing package and your help!!!!

yvanlebras commented 2 years ago

For readISO19139, normally something like readISO19139(url="http://indores-tmp.in2p3.fr/geonetwork/srv/api/records/112ebeea-e79c-422c-8a43-a5a8323b446b/formatters/xml?approved=true") is ok?

I have an error message trying on this geonetwork page http://indores-tmp.in2p3.fr/geonetwork/srv/fre/catalog.search#/metadata/112ebeea-e79c-422c-8a43-a5a8323b446b :

Error: XML content does not seem to be XML: '/gmd",
  "@xmlns:gml": "http://www.opengis.net/gml/3.2",
  "@xmlns:gts": "http://www.isotc211.org/2005/gts",
  "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
  "@xsi:schemaLocation": "http://www.isotc211.org/2005/gmd http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd",
  "gmd:fileIdentifier": {"gco:CharacterString":   {
    "@xmlns:gco": "http://www.isotc211.org/2005/gco",
    "#text": "112ebeea-e79c-422c-8a43-a5a8323b446b"
  }},
  "gmd:language": {"gco:CharacterString":   {
    "@xmlns:gco": "http://www.isotc211.org/2005/gco",
    "#text": "fre"
  }},
  "gmd:characterSet": {"gmd:MD_CharacterSetCode":   {
    "@codeList": "http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_CharacterSetCode",
    "@codeListValue": "utf8"
  }},
  "gmd:hierarchyLevel": {"gmd:MD_ScopeCode":   {
    "@codeList": "http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_ScopeCode",
    "@codeListValue": "dataset"
eblondel commented 2 years ago

Hum, on that, geometa can't do anything because it doesn't support JSON-LD format for ISO 19115-3. Indeed you will have to look at the XML format: http://indores-tmp.in2p3.fr/geonetwork/srv/api/records/112ebeea-e79c-422c-8a43-a5a8323b446b/formatters/xml?approved=true

eblondel commented 2 years ago

But indeed it fails, probably a matter of accept content type... weird behavior from Geonetwork that given the xml formatter should (at least) align download format. I've juste pushed a change in readISO19139 to force text/xml as Accept header. Can you reinstall and try?

jusana commented 2 years ago

more likely !!

yvanlebras commented 2 years ago

I just updated geometa, to 0-6-6 version... and the same error... but maybe this is not the last version, with your push ? I made install.packages("geometa")

eblondel commented 2 years ago

no, you should install from github, using remotes package:

remotes::install_github("eblondel/geometa")

yvanlebras commented 2 years ago

.. I am testing with install_github("eblondel/geometa")

yvanlebras commented 2 years ago

to have last version

yvanlebras commented 2 years ago

same and apparently I have the last version of geometa:

> library("geometa")
> readISO19139(url="http://indores-tmp.in2p3.fr/geonetwork/srv/api/records/112ebeea-e79c-422c-8a43-a5a8323b446b/formatters/xml?approved=true")
Error: XML content does not seem to be XML: '/gmd",
  "@xmlns:gml": "http://www.opengis.net/gml/3.2",
  "@xmlns:gts": "http://www.isotc211.org/2005/gts",
  "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
  "@xsi:schemaLocation": "http://www.isotc211.org/2005/gmd http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd",
  "gmd:fileIdentifier": {"gco:CharacterString":   {
    "@xmlns:gco": "http://www.isotc211.org/2005/gco",
    "#text": "112ebeea-e79c-422c-8a43-a5a8323b446b"
  }},
  "gmd:language": {"gco:CharacterString":   {
    "@xmlns:gco": "http://www.isotc211.org/2005/gco",
    "#text": "fre"
  }},
  "gmd:characterSet": {"gmd:MD_CharacterSetCode":   {
    "@codeList": "http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_CharacterSetCode",
    "@codeListValue": "utf8"
  }},
  "gmd:hierarchyLevel": {"gmd:MD_ScopeCode":   {
    "@codeList": "http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_ScopeCode",
    "@codeListValue": "dataset"
> #install.packages("ncdf4")
> remotes::install_github("eblondel/geometa")
Skipping install of 'geometa' from a github remote, the SHA1 (10e8a1e0) has not changed since last install.
  Use `force = TRUE` to force installation
eblondel commented 2 years ago

Ok reintall, it should work with application/xml, but apparently with GN it doesn't with text/xml

yvanlebras commented 2 years ago

reinstalled, but same error sorry... Will look at it in the upcoming days! No urgence!! THANK YOU So much Emmanuel!!!!! HAve a nice night ;)

eblondel commented 2 years ago

That sounds a issue of cache. If you use Rstudio, make sure to restart session, and renstall geometa after. This code works for me:

md = readISO19139(url = "http://indores-tmp.in2p3.fr/geonetwork/srv/api/records/112ebeea-e79c-422c-8a43-a5a8323b446b/formatters/xml?approved=true")

yvanlebras commented 2 years ago

Of course ;) restart RStudio or Windows allows the command to be executed! Thank you so much!!!!

yvanlebras commented 2 years ago

So, I can use: md <- readISO19139(url="http://indores-tmp.in2p3.fr/geonetwork/srv/api/records/112ebeea-e79c-422c-8a43-a5a8323b446b/formatters/xml?approved=true") as

xml <- xmlParse("~/1_PNDB/0_USe_cases/ISO2EML_indores/112ebeea-e79c-422c-8a43-a5a8323b446b.xml")
md <- ISOMetadata$new(xml = xml)

before executing md¤encode to know if the ISO are valid or not that's it ? And the fact that the result is NO can be because of the ISO schema not supported by geometa (ISO 19115-3) ?

eblondel commented 2 years ago

No really, ISO 19115-3 is backward compatible with ISO 19115-1 and 19115-2; but here the Geonetwork XML formatter seems to deliver you an ISO 19115-1 given the schemas that are referenced. First issue of validity in your example is the absence of metadata contact. This can be seen when you try to validate the record:

md <- readISO19139(url="http://indores-tmp.in2p3.fr/geonetwork/srv/api/records/112ebeea-e79c-422c-8a43-a5a8323b446b/formatters/xml?approved=true")
md$validate()

Output: Element '{http://www.isotc211.org/2005/gmd}dateStamp': This element is not expected. Expected is one of ( {http://www.isotc211.org/2005/gmd}hierarchyLevel, {http://www.isotc211.org/2005/gmd}hierarchyLevelName, {http://www.isotc211.org/2005/gmd}contact ) at line 14. This is the raw output of the XML validator, and i admit it's hard to decode. But here, you have to look at the latest element mentioned: contact. It is missing in your metadata. A valid metadata should have put it as tag with "missing" attribute.

To look at other validity issues (the more serious ones), you can just put a NA to the contact: md$contact <- NA. A note apart on this: We might have asked geometa to this for us, but... by principle, geometa doesn't alter the metadata representation of your XML. If no contact is specified, it remains an empty list in the md object.

Next if you try to validate again, here it's serious:

md$validate()

Output:

Element '{http://www.isotc211.org/2005/gmd}referenceSystemInfo', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The type definition '{http://www.isotc211.org/2005/gmd}PT_FreeText_PropertyType', specified by xsi:type, is blocked or not validly derived from the type definition of the element declaration at line 24. 
[geometa][WARN] Element 'text': This element is not expected. Expected is ( {http://www.isotc211.org/2005/gmd}MD_ReferenceSystem ) at line 25. 
[geometa][WARN] Element 'text': This element is not expected. Expected is ( {http://www.isotc211.org/2005/gmd}CI_Citation ) at line 41. 
[geometa][WARN] Element '{http://www.isotc211.org/2005/gmd}status', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The type definition '{http://www.isotc211.org/2005/gmd}PT_FreeText_PropertyType', specified by xsi:type, is blocked or not validly derived from the type definition of the element declaration at line 84. 
[geometa][WARN] Element 'text': This element is not expected. Expected is ( {http://www.isotc211.org/2005/gmd}MD_ProgressCode ) at line 85. 
[geometa][WARN] Element '{http://www.isotc211.org/2005/gmd}resourceMaintenance', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The type definition '{http://www.isotc211.org/2005/gmd}PT_FreeText_PropertyType', specified by xsi:type, is blocked or not validly derived from the type definition of the element declaration at line 197. 
[geometa][WARN] Element 'text': This element is not expected. Expected is ( {http://www.isotc211.org/2005/gmd}MD_MaintenanceInformation ) at line 198. 
[geometa][WARN] Element '{http://www.isotc211.org/2005/gmd}spatialRepresentationType', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The type definition '{http://www.isotc211.org/2005/gmd}PT_FreeText_PropertyType', specified by xsi:type, is blocked or not validly derived from the type definition of the element declaration at line 330. 
[geometa][WARN] Element 'text': This element is not expected. Expected is ( {http://www.isotc211.org/2005/gmd}MD_SpatialRepresentationTypeCode ) at line 331. 
[geometa][WARN] Element '{http://www.isotc211.org/2005/gmd}spatialResolution', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The type definition '{http://www.isotc211.org/2005/gmd}PT_FreeText_PropertyType', specified by xsi:type, is blocked or not validly derived from the type definition of the element declaration at line 334. 
[geometa][WARN] Element 'text': This element is not expected. Expected is ( {http://www.isotc211.org/2005/gmd}MD_Resolution ) at line 335. 
[geometa][WARN] Element '{http://www.isotc211.org/2005/gmd}topicCategory', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The type definition '{http://www.isotc211.org/2005/gmd}PT_FreeText_PropertyType', specified by xsi:type, is blocked or not validly derived from the type definition of the element declaration at line 355. 
[geometa][WARN] Element 'text': This element is not expected. Expected is ( {http://www.isotc211.org/2005/gmd}MD_TopicCategoryCode ) at line 356. 
[geometa][WARN] Element '{http://www.isotc211.org/2005/gmd}extent', attribute '{http://www.w3.org/2001/XMLSchema-instance}type': The type definition '{http://www.isotc211.org/2005/gmd}PT_FreeText_PropertyType', specified by xsi:type, is blocked or not validly derived from the type definition of the element declaration at line 359. 
[geometa][WARN] Element 'text': This element is not expected. Expected is ( {http://www.isotc211.org/2005/gmd}EX_Extent ) at line 360. 
[geometa][WARN] Element 'text': This element is not expected. Expected is ( {http://www.isotc211.org/2005/gmd}MD_Distribution ) at line 387. 
[geometa][WARN] Element '{http://www.isotc211.org/2005/gmd}lineage': This element is not expected. Expected is ( {http://www.isotc211.org/2005/gmd}scope ) at line 426. 

Most of the errors here deal with an invalid XML (more than invalid ISO 19115), due to quote inserted in in the XML representation. Example:

<gmd:referenceSystemInfo>
"
<gmd:MD_ReferenceSystem>
"
<gmd:referenceSystemIdentifier>
"
<gmd:RS_Identifier>
<gmd:code>
<gco:CharacterString>WGS 84</gco:CharacterString>
</gmd:code>
</gmd:RS_Identifier>
"
</gmd:referenceSystemIdentifier>
"
</gmd:MD_ReferenceSystem>
"
</gmd:referenceSystemInfo>

I'm not sure if Geonetwork had been permissive and validated this kind of XML, if it is an issue of formatter, or a bad manual metadata editing in GN that led to get these quotes, but it's clearly not delivering a valid XML. These quotes should not be there, and geometa will logically interpret them as "text" xml elements, hence validity errors.

yvanlebras commented 2 years ago

Ouhahouhou! THANK YOU so much! So intructive message! So we "just" have to consider the last part of the latest element mentionned! Really usefull ;) Additionnaly, when we have such output, this is "just" the first warning/error who is mentionned, not all !!! So if we fix it, and try to re-validate, we will see potentially others warning/Errors ! AMAZING !!! Thank you so much!

Ok, so there is serious issues there, I will try others documents to better see if this is "just" due to an isolate problem or something worse.... THANK YOU SO MUUUUUCCCCH Emmanuel !!!

Concerning

No really, ISO 19115-3 is backward compatible with ISO 19115-1 and 19115-2; but here the Geonetwork XML formatter seems to deliver you an ISO 19115-1 given the schemas that are referenced.

This means the geonetwork I am testing is doing that for all documents and that no one ISO document from this geonetwork will be validate or I am missing something ? (Sorry I try to evaluate if I can see potential "document oriented issues" vs "geonetwork X wide ones").

jusana commented 2 years ago

Of course ;) restart RStudio or Windows allows the command to be executed! Thank you so much!!!!

never had problems with pip install package -U ;)

eblondel commented 2 years ago

@yvanlebras The formatter is fine to deliver you a ISO19115-1 . What is not normal and you should investigate is the issue of quotes. You may have a look to various metadata (maybe in various catalogues) to see if the XML formatter delivers always these quoted XML tags, or if this is specific to some of your metadata (and maybe the result of a human error). I don't know. In case you think there is a systemic issue with the Geonetwork XML formatter, you should liaise with GN team and open a ticket (if it's not open already).

jusana commented 2 years ago

Hello all, Except this quote issue (maybe due to deliver an empty string), what about the lack of the "contact" tag as it is compulsory (no minOccurs and in a sequence) ? If the data is missing in the source, does GN generate an invalid xml ?

eblondel commented 2 years ago

You may want to check the GN parameters, under Attributs nil reason; if this can be activated (never tried). I suggest you contact GN support for this. geometa is primarily designed to produce XML, and allows to set all fields/tags to make the XML valid, even if there are missing in content (with nil reason = missing). In that vase we set a NA.

The geometa action set-up in geoflow (see https://github.com/eblondel/geoflow/blob/master/inst/actions/geometa_create_iso_19115.R) gives a turn-key function to produce a complete valid ISO 19139 XML metadata (and then set properly NAs where needed).