Use collection layers and the ontology#

Collections can hold layers of records with revisions. An ontology maps concepts onto layer properties so you can query by concept.

Prerequisites#

  • A connected client (Use the Python client). Reads need services:read, changes need collections:manage, and publishing an ontology version needs ontology:publish.

  • MCP tools: collection_layers_list, collection_layer_read, ontology_get, ontology_search.

Collections and layers#

for collection in client.layers.collections().items:
    print(collection.id, collection.name)

layers = client.layers.list("coastal-survey")
layer = client.layers.get("coastal-survey", "vessels")
page = client.layers.records("coastal-survey", "vessels", limit=50)

Call

REST

create_collection(body)

POST /v1/catalog/collections

list(collection_id)

GET /v1/catalog/collections/{collection_id}/layers

register(body)

POST /v1/catalog/collections/{collection_id}/layers

records(collection_id, layer_id)

GET .../layers/{layer_id}/records

ingest(collection_id, layer_id, batch)

POST .../layers/{layer_id}/records

changes(collection_id, layer_id, after=0)

GET .../layers/{layer_id}/changes

Listings page with after and limit. A batch holds at most 100 records and can carry expected_watermark to reject concurrent writers.

Ontology#

from geonemo.client.layers import SemanticQuery

result = client.layers.search(
    SemanticQuery(ontology_version="coastal-v1", concept="Vessel")
)

Call

REST

propose(document)

POST /v1/ontology/versions

publish(version_id)

POST /v1/ontology/versions/{version_id}/publish

search(query)

POST /v1/ontology/search

Result#

Reads return typed pages and views. See Collection layers API.