Commit 606dfd50 authored by Fabien Amarger's avatar Fabien Amarger
Browse files

fix(schema): Do not support multiple heritage, use the first super class

parent 7238fcef1eb1
......@@ -115,8 +115,7 @@
f"Error: class {class_uri} and {entitytype_fragment_to_uri[class_fragment]} "
"use the same fragment"
)
schema.add_entity_type(EntityType(class_fragment))
entity_schema = schema._entities[class_fragment]
entity_schema = schema.add_entity_type(EntityType(class_fragment))
entitytype_fragment_to_uri[class_fragment] = class_uri
superior_classes = []
for _, _, superior_class_uri in owl_model.triples(
......@@ -128,7 +127,12 @@
if superior_class_fragment is not None:
superior_classes.append(superior_class_fragment)
if superior_classes:
entity_schema._specialized_type = ", ".join(superior_classes)
print(
f"Warning: multi heritage is not support yet. {class_fragment} will speizialize ",
f"{superior_classes[0]} and {superior_classes[1::]} ",
"specialization will be ignored",
)
entity_schema._specialized_type = superior_classes[0]
# 2. fetch all datatype properties
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment