Help with api call to delete elements

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with api call to delete elements

Jo Cook
Hi All,

Could someone help me with a working example of the api call to delete
metadata elements? I'm trying to insert/update/delete transfer option URLs
(with python, from a supplied csv). Insert and Update are working fine,
using the batchedit api and the url-host-relocator process, but I'm
struggling to get deletion to work. I'm trying
/api/0.1/records/{metadataUuid}/editor/elements (in Geonetwork 3.4.x).

Record UUID is clear (obviously)

Ref: This is supposed to be an array apparently, so I've tried variations
on [<gmd:onLine><gmd:CI_OnlineResource><gmd:linkage><gmd:URL>
https://foobar.com</gmd:URL>
</gmd:linkage><gmd:protocol><gco:CharacterString>https</gco:CharacterString>
</gmd:protocol> <gmd:name> <gco:CharacterString>bob</gco:CharacterString>
</gmd:name> <gmd:description> <gco:CharacterString>bob's new site
7</gco:CharacterString> </gmd:description>
</gmd:CI_OnlineResource></gmd:onLine>]

Parent: I've
tried /gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/

I just get a 404 not found error as a response when I use the api.

Could someone show me a working set of parameters please?

Many thanks

Jo
--
*Jo Cook*
t:+44 7930 524 155/twitter:@archaeogeek
Please note that currently I do not work on Friday afternoons. For urgent
responses at that time, please visit support.astuntechnology.com or phone
our office on 01372 744009

--
-- 
*Sign up to our mailing list
<https://astuntechnology.com/company/#email-updates> for updates on news,
products, conferences, events and training*
*
*

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



iShare - enterprise geographic
intelligence platform <https://astuntechnology.com/ishare/>
GeoServer,
PostGIS and QGIS training <https://astuntechnology.com/services/#training>

Helpdesk and customer portal
<http://support.astuntechnology.com/support/login>




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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Help with api call to delete elements

Jose Garcia
Hi Jo

A bit late, but hope can be useful. I would not use the API
/api/0.1/records/{metadataUuid}/editor/elements, that is intended to be
used internally by the metadata editor. In case you use it, requires to
start an edit session so you can get the metadata with all *geonet:element*
stuff that contain an indentifier for each element in a *ref* attribute.
That value(s) is what expects the API method.

A different way to deal with this, in case you have a fixed number of
elements to delete can be to create a batch process, where you handle the
delete of the element(s). If you need to deal with different elements,
maybe can be send a parameter indicating the element to delete and handle
the delete depending on the parameter value in the xslt code.

Regards,
Jose García


On Wed, Nov 14, 2018 at 4:33 PM Jo Cook <[hidden email]> wrote:

> Hi All,
>
> Could someone help me with a working example of the api call to delete
> metadata elements? I'm trying to insert/update/delete transfer option URLs
> (with python, from a supplied csv). Insert and Update are working fine,
> using the batchedit api and the url-host-relocator process, but I'm
> struggling to get deletion to work. I'm trying
> /api/0.1/records/{metadataUuid}/editor/elements (in Geonetwork 3.4.x).
>
> Record UUID is clear (obviously)
>
> Ref: This is supposed to be an array apparently, so I've tried variations
> on [<gmd:onLine><gmd:CI_OnlineResource><gmd:linkage><gmd:URL>
> https://foobar.com</gmd:URL>
>
> </gmd:linkage><gmd:protocol><gco:CharacterString>https</gco:CharacterString>
> </gmd:protocol> <gmd:name> <gco:CharacterString>bob</gco:CharacterString>
> </gmd:name> <gmd:description> <gco:CharacterString>bob's new site
> 7</gco:CharacterString> </gmd:description>
> </gmd:CI_OnlineResource></gmd:onLine>]
>
> Parent: I've
> tried
> /gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/
>
> I just get a 404 not found error as a response when I use the api.
>
> Could someone show me a working set of parameters please?
>
> Many thanks
>
> Jo
> --
> *Jo Cook*
> t:+44 7930 524 155/twitter:@archaeogeek
> Please note that currently I do not work on Friday afternoons. For urgent
> responses at that time, please visit support.astuntechnology.com or phone
> our office on 01372 744009
>
> --
> --
> *Sign up to our mailing list
> <https://astuntechnology.com/company/#email-updates> for updates on news,
> products, conferences, events and training*
> *
> *
>
> Astun Technology Ltd, The
> Coach House, 17 West Street, Epsom, Surrey, KT18 7RL, UK
> t:+44 1372 744
> 009 w: astuntechnology.com <http://astuntechnology.com/
> > twitter:@astuntech
> <https://twitter.com/astuntech>
>
>
>
> iShare - enterprise geographic
> intelligence platform <https://astuntechnology.com/ishare/>
> GeoServer,
> PostGIS and QGIS training <https://astuntechnology.com/services/#training>
>
> Helpdesk and customer portal
> <http://support.astuntechnology.com/support/login>
>
>
>
>
> 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
> [hidden email]
> 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/>Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv>
<https://twitter.com/geocat_bv>
<https://plus.google.com/u/1/+GeocatNetbv/posts>Please consider the
environment before printing this email.*

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork