mini_modify.rst 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. Model Modification Interface
  2. ============================
  3. Model operations are grouped into a separate category of operations, as they work at the model-level instead of the root-level.
  4. In the MvC, these operations can only be executed after a *model_modify* operation.
  5. We distinguish two modes of access: read/write, and read-only.
  6. Read-only commands are always available (given that the model itself can be opened in the MvC layer), whereas read/write operations are only optionally visible.
  7. Read-only
  8. ---------
  9. The first set of operations are the read-only operations.
  10. list
  11. ^^^^
  12. Get a list of all elements in the model.
  13. Ignores hidden elements (*i.e.*, name starts with __), as these are artefacts of other operations.
  14. list_full
  15. ^^^^^^^^^
  16. Get a full list of all elements in the model.
  17. nice_list
  18. ^^^^^^^^^
  19. Get a pretty-printed list of alle elements in the model, including the value of their attributes.
  20. types
  21. ^^^^^
  22. Get a list of all elements that can be instantiated in the metamodel.
  23. Ignores hidden elements of the metamodel.
  24. read
  25. ^^^^
  26. Get detailed information on a specific element.
  27. verify
  28. ^^^^^^
  29. Check if the model conforms to its resolved metamodel.
  30. exit
  31. ^^^^
  32. Exit the model modification interface.
  33. Read/Write
  34. ----------
  35. The second set of operations are the read/write operations, which are able to alter the model.
  36. Note that in the Modelverse, changes are immediately visible to other users as well.
  37. instantiate
  38. ^^^^^^^^^^^
  39. Instantiate an element of the metamodel.
  40. This only creates the raw element, without any of its slots filled in or any associations.
  41. Used for both nodes and edges (classes and associations).
  42. delete
  43. ^^^^^^
  44. Delete an element of the model.
  45. For nodes (classes), all related associations are removed as well.
  46. attr_add
  47. ^^^^^^^^
  48. Instantiate a new attribute for this element.
  49. attr_add_code
  50. ^^^^^^^^^^^^^
  51. Instantiate a new attribute for this element, using the code constructors for the value.
  52. attr_del
  53. ^^^^^^^^
  54. Remove an attribute value of this element.
  55. attr_modify
  56. ^^^^^^^^^^^
  57. Modify an existing attribute of this element.
  58. retype
  59. ^^^^^^
  60. Change the type of an element.
  61. upload
  62. ^^^^^^
  63. Overwrite the current model with an uploaded model through the model constructors.