Skip to content

Commit f86e920

Browse files
committed
Merge branch 'feature/related-items' into develop
2 parents c0eb0fd + 54e33f8 commit f86e920

42 files changed

Lines changed: 1769 additions & 1091 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/api/v1/endpoint_modules/gazetteer.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,10 @@ async def search_wof(
407407
ancestor_ids = list(
408408
set(
409409
[
410-
a["ancestor_id"]
410+
a.get("ancestor_id")
411411
for ancestors_list in ancestors_map.values()
412412
for a in ancestors_list
413+
if a.get("ancestor_id") is not None
413414
]
414415
)
415416
)
@@ -425,7 +426,9 @@ async def search_wof(
425426
# Add names to ancestors
426427
for _wok_id, ancestors_list in ancestors_map.items():
427428
for ancestor in ancestors_list:
428-
ancestor["name"] = ancestor_names_map.get(ancestor["ancestor_id"])
429+
ancestor_id = ancestor.get("ancestor_id")
430+
if ancestor_id is not None:
431+
ancestor["name"] = ancestor_names_map.get(ancestor_id)
429432

430433
# Fetch GeoJSON for all results in batch
431434
geojson_map = {}
@@ -443,8 +446,8 @@ async def search_wof(
443446

444447
# Group by wok_id, keeping only the first (best) one
445448
for geojson_record in geojson_records:
446-
wok_id = geojson_record["wok_id"]
447-
if wok_id not in geojson_map:
449+
wok_id = geojson_record.get("wok_id")
450+
if wok_id is not None and wok_id not in geojson_map:
448451
geojson_map[wok_id] = dict(geojson_record)
449452

450453
# Convert results to JSON:API format
@@ -484,7 +487,7 @@ async def search_wof(
484487
# Get GeoJSON for this place
485488
geojson_record = geojson_map.get(wok_id)
486489
geojson_data = None
487-
if geojson_record:
490+
if geojson_record and "body" in geojson_record:
488491
try:
489492
geojson_data = json.loads(geojson_record["body"])
490493
except (json.JSONDecodeError, TypeError):

app/api/v1/endpoint_modules/mcp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async def mcp_endpoint():
2121
"tools": [
2222
"search_resources",
2323
"get_resource",
24-
"get_resource_ogm",
24+
"get_resource_metadata",
2525
"list_resources",
2626
"get_suggestions",
2727
"get_resource_viewer",
@@ -46,7 +46,7 @@ async def mcp_endpoint():
4646
"Get a single GeoBTAA geospatial resource by ID with full "
4747
"metadata and UI enhancements"
4848
),
49-
"get_resource_ogm": (
49+
"get_resource_metadata": (
5050
"Get just the GeoBTAA Aardvark record for a resource by ID"
5151
),
5252
"list_resources": ("List all GeoBTAA geospatial resources with pagination"),

0 commit comments

Comments
 (0)