All Downloads are FREE. Search and download functionalities are using the official Maven repository.

genSQL.university_test.json Maven / Gradle / Ivy

[
	{
	  "class": "University",
	  "attributes": [
		{
		  "name": "name",
		  "type": "String",
		  "constraints": [
			"unique",
			"notnull"
		  ]
		},
		{
		  "name": "doe",
		  "type": "Date",
		  "constraints": [
			"notnull"
		  ]
		}
	  ],
	  "ends": [
		{
		  "name": "programs",
		  "target": "Program",
		  "opp": "university",
		  "mult": "*"
		}
	  ]
	},
	{
	  "class": "Student",
	  "attributes": [
		{
		  "name": "code",
		  "type": "String",
		  "constraints": [
			"unique",
			"notnull"
		  ]
		},
		{
		  "name": "firstname",
		  "type": "String",
		  "constraints": [
			"notnull"
		  ]
		},
		{
		  "name": "midname",
		  "type": "String"
		},
		{
		  "name": "lastname",
		  "type": "String",
		  "constraints": [
			"notnull"
		  ]
		},
		{
		  "name": "gender",
		  "type": "String",
		  "constraints": [
			"notnull"
		  ]
		},
		{
		  "name": "birthplace",
		  "type": "String",
		  "constraints": [
			"notnull"
		  ]
		},
		{
		  "name": "dob",
		  "type": "Date",
		  "constraints": [
			"notnull"
		  ]
		}
	  ],
	  "ends": [
		{
		  "name": "enrolls",
		  "target": "Enrollment",
		  "opp": "student",
		  "mult": "*"
		},
		{
		  "name": "records",
		  "target": "Record",
		  "opp": "student",
		  "mult": "*"
		}
	  ]
	},
	{
	  "class": "Program",
	  "attributes": [
		{
		  "name": "code",
		  "type": "String",
		  "constraints": [
			"unique",
			"notnull"
		  ]
		},
		{
		  "name": "name",
		  "type": "String"
		}
	  ],
	  "ends": [
		{
		  "name": "enrolls",
		  "target": "Enrollment",
		  "opp": "program",
		  "mult": "*"
		},
		{
		  "name": "modules",
		  "target": "Module",
		  "opp": "program",
		  "mult": "*"
		},
		{
		  "name": "university",
		  "target": "University",
		  "opp": "programs",
		  "mult": "1"
		}
	  ]
	},
	{
	  "class": "Enrollment",
	  "attributes": [
		{
		  "name": "starts",
		  "type": "Date",
		  "constraints": [
			"notnull"
		  ]
		},
		{
		  "name": "ends",
		  "type": "Date"
		}
	  ],
	  "ends": [
		{
		  "name": "program",
		  "target": "Program",
		  "opp": "enrolls",
		  "mult": "1"
		},
		{
		  "name": "student",
		  "target": "Student",
		  "opp": "enrolls",
		  "mult": "1"
		}
	  ]
	},
	{
	  "class": "Module",
	  "attributes": [
		{
		  "name": "code",
		  "type": "String",
		  "constraints": [
			"unique",
			"notnull"
		  ]
		},
		{
		  "name": "name",
		  "type": "String"
		}
	  ],
	  "ends": [
		{
		  "name": "program",
		  "target": "Program",
		  "opp": "modules",
		  "mult": "1"
		},
		{
		  "name": "module_periods",
		  "target": "Module_Period",
		  "opp": "module",
		  "mult": "*"
		},
		{
		  "name": "module_group",
		  "target": "Module_Group",
		  "opp": "modules",
		  "mult": "1"
		}
	  ]
	},
	{
	  "class": "Module_Group",
	  "attributes": [
		{
		  "name": "group_name",
		  "type": "String"
		},
		{
		  "name": "code",
		  "type": "String",
		  "constraints": [
			"unique",
			"notnull"
		  ]
		}
	  ],
	  "ends": [
		{
		  "name": "modules",
		  "target": "Module",
		  "opp": "module_group",
		  "mult": "*"
		}
	  ]
	},
	{
	  "class": "Session",
	  "attributes": [
		{
		  "name": "date",
		  "type": "Date"
		},
		{
		  "name": "starts",
		  "type": "Time"
		},
		{
		  "name": "ends",
		  "type": "Time"
		}
	  ],
	  "ends": [
		{
		  "name": "room",
		  "target": "Room",
		  "opp": "sessions",
		  "mult": "1"
		},
		{
		  "name": "module_period",
		  "target": "Module_Period",
		  "opp": "sessions",
		  "mult": "1"
		},
		{
		  "name": "records",
		  "target": "Record",
		  "opp": "sessions",
		  "mult": "*"
		}
	  ]
	},
	{
	  "class": "Room",
	  "attributes": [
		{
		  "name": "name",
		  "type": "String"
		},
		{
		  "name": "par",
		  "type": "Integer"
		}
	  ],
	  "ends": [
		{
		  "name": "sessions",
		  "target": "Session",
		  "opp": "room",
		  "mult": "*"
		},
		{
		  "name": "exams",
		  "target": "Exam",
		  "opp": "rooms",
		  "mult": "*"
		}
	  ]
	},
	{
	  "class": "Record",
	  "attributes": [
		{
		  "name": "status",
		  "type": "String"
		}
	  ],
	  "ends": [
		{
		  "name": "student",
		  "target": "Student",
		  "opp": "records",
		  "mult": "1"
		},
		{
		  "name": "sessions",
		  "target": "Session",
		  "opp": "records",
		  "mult": "*"
		},
		{
		  "name": "reg_exams",
		  "target": "Registration_Exam",
		  "opp": "record",
		  "mult": "*"
		},
		{
		  "name": "module_period",
		  "target": "Module_Period",
		  "opp": "records",
		  "mult": "1"
		}
	  ]
	},
	{
	  "class": "Period",
	  "attributes": [
		{
		  "name": "name",
		  "type": "String"
		},
		{
		  "name": "starts",
		  "type": "Date",
		  "constraints": [
			"notnull"
		  ]
		},
		{
		  "name": "ends",
		  "type": "Date",
		  "constraints": [
			"notnull"
		  ]
		}
	  ],
	  "ends": [
		{
		  "name": "module_periods",
		  "target": "Module_Period",
		  "opp": "period",
		  "mult": "*"
		}
	  ]
	},
	{
	  "class": "Module_Period",
	  "attributes": [
		{
		  "name": "starts",
		  "type": "Date",
		  "constraints": [
			"notnull"
		  ]
		},
		{
		  "name": "ends",
		  "type": "Date",
		  "constraints": [
			"notnull"
		  ]
		}
	  ],
	  "ends": [
		{
		  "name": "period",
		  "target": "Period",
		  "opp": "module_periods",
		  "mult": "1"
		},
		{
		  "name": "module",
		  "target": "Module",
		  "opp": "module_periods",
		  "mult": "1"
		},
		{
		  "name": "records",
		  "target": "Record",
		  "opp": "module_period",
		  "mult": "*"
		},
		{
		  "name": "exam",
		  "target": "Exam",
		  "opp": "module_period",
		  "mult": "1"
		},
		{
		  "name": "sessions",
		  "target": "Session",
		  "opp": "module_period",
		  "mult": "*"
		}
	  ]
	},
	{
	  "class": "Exam",
	  "attributes": [
		{
		  "name": "date",
		  "type": "Date",
		  "constraints": [
			"notnull"
		  ]
		},
		{
		  "name": "starts",
		  "type": "Time"
		},
		{
		  "name": "ends",
		  "type": "Time"
		},
		{
		  "name": "deadline",
		  "type": "Datetime"
		}
	  ],
	  "ends": [
		{
		  "name": "reg_exams",
		  "target": "Registration_Exam",
		  "opp": "exam",
		  "mult": "*"
		},
		{
		  "name": "module_period",
		  "target": "Module_Period",
		  "opp": "exam",
		  "mult": "1"
		},
		{
		  "name": "rooms",
		  "target": "Room",
		  "opp": "exams",
		  "mult": "*"
		}
	  ]
	},
	{
	  "class": "Registration_Exam",
	  "attributes": [
		{
		  "name": "date",
		  "type": "Date"
		},
		{
		  "name": "time",
		  "type": "Time"
		},
		{
		  "name": "status",
		  "type": "Boolean"
		}
	  ],
	  "ends": [
		{
		  "name": "record",
		  "target": "Record",
		  "opp": "reg_exams",
		  "mult": "1"
		},
		{
		  "name": "exam",
		  "target": "Exam",
		  "opp": "reg_exams",
		  "mult": "1"
		}
	  ]
	},
	{
	  "invariants": [
		{
		  "label": "not_null_registration_date",
		  "ocl": "Registration_Exam.allInstances()->forAll(r|not(r.date.oclIsUndefined()))"
		},
		{
		  "label": "not_null_registration_time",
		  "ocl": "Registration_Exam.allInstances()->forAll(r|not(r.time.oclIsUndefined()))"
		},
		{
		  "label": "not_null_registration_status",
		  "ocl": "Registration_Exam.allInstances()->forAll(r|not(r.status.oclIsUndefined()))"
		},
		{
		  "label": "not_null_registration_exam",
		  "ocl": "Registration_Exam.allInstances()->forAll(r|not(r.exam.oclIsUndefined()))"
		},
		{
		  "label": "not_null_registration_student",
		  "ocl": "Registration_Exam.allInstances()->forAll(r|not(r.student.oclIsUndefined()))"
		},
		{
		  "label": "valid_registration_date",
		  "ocl": "Registration_Exam.allInstances()->forAll(r|r.date > r.exam.module.starts and r.date < r.exam.deadline)"
		}
	  ]
	},
	{
	  "invariants": [
		{
		  "label": "not_null_exam_starts_time",
		  "ocl": "Exam.allInstances()->forAll(e|not(e.starts.oclIsUndefined()))"
		},
		{
		  "label": "not_null_exam_ends_time",
		  "ocl": "Exam.allInstances()->forAll(e|not(e.ends.oclIsUndefined()))"
		},
		{
		  "label": "valid_exam_time",
		  "ocl": "Exam.allInstances()->forAll(e|e.ends > e.starts)"
		},
		{
		  "label": "not_null_exam_date",
		  "ocl": "Exam.allInstances()->forAll(e|not(e.date.oclIsUndefined()))"
		},
		{
		  "label": "valid_exam_date",
		  "ocl": "Exam.allInstances()->forAll(e|e.date => e.module.starts and e.date <= e.module.ends"
		},
		{
		  "label": "not_null_module",
		  "ocl": "Exam.allInstances()->forAll(e|not(e.module.oclIsUndefined()))"
		},
		{
		  "label": "not_overlapping_exams_module",
		  "ocl": "Exam.allInstances()->forAll(e1, e2|(e1 <> e2 and e1.module = e2.module and e1.date = e2.date) implies ((e1.ends < e2.starts) or (e2.ends < e1.starts)))"
		},
		{
		  "label": "not_null_deadline",
		  "ocl": "Exam.allInstances()->forAll(e|not(e.deadline.oclIsUndefined()))"
		},
		{
		  "label": "valid_deadline",
		  "ocl": "Exam.allInstances()->forAll(e|e.deadline > e.module.starts and @DATE(e.deadline) <= e.date and @TIME(e.deadline) <= e.starts)"
		}
	  ]
	},
	{
	  "invariants": [
		{
		  "label": "unique_program_code",
		  "ocl": "Program.allInstances()->isUnique(code)"
		},
		{
		  "label": "unique_program_name",
		  "ocl": "Program.allInstances()->isUnique(name)"
		}
	  ]
	},
	{
	  "invariants": [
		{
		  "label": "unique_program_intake",
		  "ocl": "Program_InTake.allInstances()->forAll(i1, i2|i1 <> i2 implies (i1.year <> i2.year OR i1.program <> i2.program))"
		}
	  ]
	},
	{
	  "invariants": [
		{
		  "label": "unique_student_code",
		  "ocl": "Student.allInstances()->unique(code)"
		},
		{
		  "label": "valid_dob",
		  "ocl": "Student.allInstances()->forAll(s|s.dob < @CURDATE())"
		}
	  ]
	},
	{
	  "invariants": [
		{
		  "label": "unique_module_code",
		  "ocl": "Module.allInstances()->isUnique(code)"
		},
		{
		  "label": "unique_module_name",
		  "ocl": "Program.allInstances()->collect(p|p.modules->isUnique(name))"
		}
	  ]
	},
	{
	  "invariants": [
		{
		  "label": "unique_period_name",
		  "ocl": "Period.allInstances()->isUnique(name)"
		},
		{
		  "label": "valid_period",
		  "ocl": "Period.allInstances()->forAll(p|p.starts <= p.periods.ends)"
		},
		{
		  "label": "not_overlapping_periods",
		  "ocl": "Period.allInstances()->forAll(p1, p2|(p1 <> p2) implies ((p1.ends < p2.starts) or (p2.ends < p1.starts))"
		}
	  ]
	},
	{
	  "invariants": [
		{
		  "label": "valid_module_period_dates",
		  "ocl": "Module_period.allInstances()->forAll(m|m.period.starts <= m.starts and m.period.ends >= m.ends)"
		}
	  ]
	}
  ]




© 2015 - 2025 Weber Informatics LLC | Privacy Policy