graphMM.mvc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. include "primitives.alh"
  2. SimpleAttribute String {
  3. constraint = $
  4. String function constraint(value : Element):
  5. if (is_physical_string(value)):
  6. return "OK"!
  7. else:
  8. return "String has a non-string value"!
  9. $
  10. }
  11. SimpleAttribute Integer {
  12. constraint = $
  13. String function constraint(value : Element):
  14. if (is_physical_int(value)):
  15. return "OK"!
  16. else:
  17. return "Integer has a non-integer value"!
  18. $
  19. }
  20. SimpleAttribute Boolean {
  21. constraint = $
  22. String function constraint(value : Element):
  23. if (is_physical_boolean(value)):
  24. return "OK"!
  25. else:
  26. return "Boolean has a non-boolean value"!
  27. $
  28. }
  29. Class Model {
  30. name = "Model"
  31. descr : String
  32. is_example : Boolean
  33. }
  34. Class Node {
  35. name = "Node"
  36. typeID : String
  37. }
  38. Association Edge(Node, Node) {
  39. name = "Edge"
  40. directed : Boolean
  41. }
  42. Class Attribute {
  43. name = "Attribute"
  44. key : String
  45. value : String
  46. }
  47. Association NodeAttribute(Node, Attribute) {
  48. name = "NodeAttribute"
  49. }