eblondel / ows4R

R Interface for OGC Web-Services (OWS)

Home Page:https://eblondel.github.io/ows4R/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CSW Transaction (Update) Failed when Feature Catalogue Citation

mrouan opened this issue · comments

When a metadata have a Feature Catalogue Description associated
For example in XML

gmd:contentInfo
gmd:MD_FeatureCatalogueDescription
gmd:includedWithDataset/
<gmd:featureCatalogueCitation xmlns:xlink="http://www.w3.org/1999/xlink"
uuidref="055f393c-17a2-4288-b4df-0c6d33a0d769"
xlink:href="https://portail.indigeo.fr/geonetwork/srv/fre/csw?service=CSW&amp;request=GetRecordById&amp;version=2.0.2&amp;outputSchema=http://www.isotc211.org/2005/gmd&amp;elementSetName=full&amp;id=055f393c-17a2-4288-b4df-0c6d33a0d769"/>
</gmd:MD_FeatureCatalogueDescription>
</gmd:contentInfo>

The CSW updateRecord() method failed with error :

[ows4R][INFO] CSWClient - Transaction (Update) ...
list()
Failed to parse QName ':uuidref'
[geometa][WARN] Element '{http://www.opengis.net/gml}TimePeriod': This element is not expected. Expected is one of ( {http://www.opengis.net/gml/3.2}AbstractTimePrimitive, {http://www.opengis.net/gml/3.2}TimeInstant, {http://www.opengis.net/gml/3.2}TimePeriod, {http://www.opengis.net/gml/3.2}TimeNode, {http://www.opengis.net/gml/3.2}TimeEdge ) at line 366.
[geometa][WARN] Element '{http://www.isotc211.org/2005/gmd}featureCatalogueCitation', attribute ':uuidref': The attribute ':uuidref' is not allowed at line 400.
[geometa][WARN] Object 'ISOMetadata' is INVALID according to ISO 19139 XML schemas!
Failed to parse QName ':uuidref'
Opening and ending tag mismatch: hr line 7 and body
Opening and ending tag mismatch: body line 1 and html
Premature end of data in tag html line 1
Error: 1: Opening and ending tag mismatch: hr line 7 and body
2: Opening and ending tag mismatch: body line 1 and html
3: Premature end of data in tag html line 1

@mrouan can you send me the XML file you try to push?

can you describe how did you proceed with your test? Is it that you first read this xml using ows4R/geometa? and then you tried to push it to another catalogue?

I see a bug in geometa when reading the uuidref, and instead set :uuidref. I think it is related to that. Just to get confirmation of that, try to read your metadata with ows4R or directly with geometa:

md = readISO19139(url = "https://portail.indigeo.fr/geonetwork/srv/fre/xml.metadata.get?uuid=7d9ad2e5-afcc-4f53-9b62-ac48e67069fb")

If you inspect the metadata content info / feature catalogue attributes, you should get back the attribute name wrongly parsed:

names(md$contentInfo[[1]]$featureCatalogueCitation[[1]]$attrs)[1]

Then overwrite this attribute name to the correct one ``uuidref```, and try to re-do the insert with CSW transaction, normally it should work:

names(md$contentInfo[[1]]$featureCatalogueCitation[[1]]$attrs)[1] <- "uuidref"

Meanwhile i will look at geometa

Thanks

@mrouan i've fixed the issue in geometa. Could you re-install geometa and retry your code (with a new R session to inherit geometa changes in ows4R)?

fixed !

Great, if ows4R is useful for your work, feel free to star it