Examples of OGC API transactions using OGC API - Features - Part 4: Create, Replace, Update and Delete in the context of OGC API - Records metadata management.
# insert metadata
curl -v -H "Content-Type: application/geo+json" -XPOST http://localhost:8000/collections/metadata:main/items -d @foorecord.json
# update metadata
curl -v -H "Content-Type: application/geo+json" -XPUT http://localhost:8000/collections/metadata:main/items/foorecord -d @foorecord.json
# delete metadata
curl -v -XDELETE http://localhost:8000/collections/metadata:main/items/foorecord
import json
from owslib.ogcapi.records import Records
record_data = 'sample-record.json'
url = 'http://localhost:8000'
collection_id = 'metadata:main'
r = Records(url)
cat = r.collection(collection_id)
with open(record_data) as fh:
data = json.load(fh)
identifier = data['id']
r.collection_item_delete(collection_id, identifier)
# insert metadata
r.collection_item_create(collection_id, data)
# update metadata
r.collection_item_update(collection_id, identifier, data)
# delete metadata
r.collection_item_delete(collection_id, identifier)