|
@@ -132,14 +132,16 @@ Element function get_full_model(model_id : String):
|
|
|
m = create_node()
|
|
|
all_links = allOutgoingAssociationInstances(core, model_id, "instanceOf")
|
|
|
|
|
|
- if (read_nr_out(all_links) != 1):
|
|
|
+ if (read_nr_out(all_links) > 1):
|
|
|
log("WARNING: multiple instanceOf relations were detected for this model; picking one at random!")
|
|
|
+ elif (read_nr_out(all_links) == 0):
|
|
|
+ log("ERROR: untyped model!")
|
|
|
|
|
|
choice = set_pop(allOutgoingAssociationInstances(core, model_id, "instanceOf"))
|
|
|
|
|
|
dict_add(m, "model", import_node(read_attribute(core, model_id, "location")))
|
|
|
dict_add(m, "type_mapping", read_attribute(core, choice, "type_mapping"))
|
|
|
- dict_add(m, "metamodel", import_node(read_attribute(core, choice, "location")))
|
|
|
+ dict_add(m, "metamodel", import_node(read_attribute(core, readAssociationDestination(core, choice), "location")))
|
|
|
|
|
|
return m!
|
|
|
|