From bb5b4204fe337a6a3bf0fffe3e9fa585246bfa55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Cant=C3=B9?= Date: Fri, 26 Jul 2024 13:37:42 +0200 Subject: [PATCH] fix measurementsorfacts error --- metadata_catalogue/datasets/libs/darwincore/mapping.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata_catalogue/datasets/libs/darwincore/mapping.py b/metadata_catalogue/datasets/libs/darwincore/mapping.py index 97d9a56..83e171a 100644 --- a/metadata_catalogue/datasets/libs/darwincore/mapping.py +++ b/metadata_catalogue/datasets/libs/darwincore/mapping.py @@ -1,3 +1,4 @@ +import pathlib import re from bs4 import BeautifulSoup @@ -8,7 +9,7 @@ class SourceLayer: def __init__(self, node, base_path, extension=False) -> None: - self.type = node["rowType"].split("/")[-1].lower() + self.type = pathlib.Path(node.find("location").text).stem self.path = base_path / node.find("location").text if not self.path.is_file():