From 8da775caa423ddeebe68b42620d84f44946abdfd Mon Sep 17 00:00:00 2001 From: Paul van Genuchten Date: Fri, 6 Feb 2026 16:05:19 +0100 Subject: [PATCH] prevent failing on missing @type, use type instead --- pygeometa/schemas/schema_org/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pygeometa/schemas/schema_org/__init__.py b/pygeometa/schemas/schema_org/__init__.py index 9b6e73e..63db36e 100644 --- a/pygeometa/schemas/schema_org/__init__.py +++ b/pygeometa/schemas/schema_org/__init__.py @@ -233,14 +233,12 @@ def import_(self, metadata: str) -> dict: if isinstance(ct2, str): contact['individualname'] = ct2 elif ct2: - contact['individualname'] = ct2.get('name', '') - if 'url' in ct2: contact['url'] = ct2.get('url', '') - - if ct2['@type'] == 'Organization': + if ct2.get('@type', ct2.get('type', '')).lower() == 'organization': # noqa contact['organization'] = ct2.get('name', '') - + else: + contact['individualname'] = ct2.get('name', '') if 'address' in ct2: contact['address'] = ct2['address'].get('streetAddress') # noqa contact['city'] = ct2['address'].get('addressLocality') # noqa