From 03d19c4053f3f362cec8ce0d415ff10f96bb8cd8 Mon Sep 17 00:00:00 2001 From: matthewhyx <152243220+matthewhyx@users.noreply.github.com> Date: Sun, 7 Jan 2024 17:56:33 +0800 Subject: [PATCH] feat(schema): prohibit the creation of properties for concept types (#59) --- python/knext/knext/client/marklang/schema_ml.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/knext/knext/client/marklang/schema_ml.py b/python/knext/knext/client/marklang/schema_ml.py index 1cf30976..25c180ae 100644 --- a/python/knext/knext/client/marklang/schema_ml.py +++ b/python/knext/knext/client/marklang/schema_ml.py @@ -349,8 +349,11 @@ class SPGSchemaMarkLang: elif type_meta == "properties": assert self.parsing_register[RegisterUnit.Type].spg_type_enum not in [ - SpgTypeEnum.Standard - ], self.error_msg("Standard type does not allow defining properties.") + SpgTypeEnum.Standard, + SpgTypeEnum.Concept, + ], self.error_msg( + "Standard/concept type does not allow defining properties." + ) self.save_register( RegisterUnit.Property, Property(name="_", object_type_name="Thing") )