feat(schema): prohibit the creation of properties for concept types (#59)

This commit is contained in:
matthewhyx 2024-01-07 17:56:33 +08:00 committed by GitHub
parent e7317ef8b1
commit 03d19c4053
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")
)