From 0d069068702632f869d6263fc1fcd6893249e1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20B=C3=BCschelberger?= Date: Tue, 10 Dec 2024 11:53:13 +0100 Subject: [PATCH] temporary fix for custom properties --- dsms/knowledge/kitem.py | 6 ++++++ dsms/knowledge/utils.py | 2 +- setup.cfg | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dsms/knowledge/kitem.py b/dsms/knowledge/kitem.py index fe12e95..a1c43d5 100644 --- a/dsms/knowledge/kitem.py +++ b/dsms/knowledge/kitem.py @@ -58,6 +58,7 @@ _inspect_dataframe, _make_annotation_schema, _refresh_kitem, + _transform_from_flat_schema, ) from dsms.knowledge.sparql_interface.utils import _get_subgraph # isort:skip @@ -567,6 +568,11 @@ def validate_custom_properties(cls, self) -> "KItem": raise TypeError( f"Invalid type: {type(content)}" ) from error + # transform from flat dict. fix: replace with `_transform_from_flat_schema` + # content = _transform_from_flat_schema( + # content, self.ktype_id, from_context=True + # ) + content = _transform_from_flat_schema(content) was_in_buffer = self.id in self.context.buffers.updated self.custom_properties = self.ktype.webform(**content) # fix: find a better way to prehebit that properties are diff --git a/dsms/knowledge/utils.py b/dsms/knowledge/utils.py index 4bff81a..17a0a84 100644 --- a/dsms/knowledge/utils.py +++ b/dsms/knowledge/utils.py @@ -894,7 +894,7 @@ def _transform_custom_properties_schema( ktype_spec = _get_ktype(ktype_id) if ktype_spec: - webform = ktype_spec.get("webform") + webform = ktype_spec.webform else: webform = None diff --git a/setup.cfg b/setup.cfg index 151bc8d..573b124 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dsms_sdk -version = v2.1.0dev3 +version = v2.1.0dev4 description = Python SDK core-package for working with the Dataspace Management System (DSMS). long_description = file: README.md long_description_content_type = text/markdown