example Denormalize

typeside Ty = literal {
	external_types
		String -> "java.lang.String"
	external_parsers
		String -> "x => x"
}

schema NormalizedSchema = literal : Ty {
	entities
		Male
		Female
	foreign_keys
		mother : Male -> Female
  	attributes
  		female_name : Female -> String
  		male_name : Male -> String
}

instance NormalizedData = literal : NormalizedSchema {
	generators
		Al Bob Charlie : Male
		Ellie Fran : Female
	equations
		Al.male_name = Albert
		Al.mother = Ellie

		Bob.male_name = George
		Bob.mother = Ellie

		Charlie.male_name = Charles
		Charlie.mother = Fran

		Ellie.female_name = Elaine
		Fran.female_name = Francine
}

schema DeNormalizedSchema = literal : Ty {
	imports
		NormalizedSchema
	attributes
		mother_name : Male -> String
  	observation_equations
  		forall m:Male. mother_name(m) = female_name(mother(m))
}

instance DeNormalizedData = literal : DeNormalizedSchema {
	imports
		NormalizedData
}
Keywords:

typeside_literal
instance_literal
schema_literal

Options:




instance NormalizedData

Female
IDfemale_name
0Elaine
1Francine
Male
IDmale_namemother
2Albert0
3George0
4Charles1


instance DeNormalizedData

Female
IDfemale_name
0Elaine
1Francine
Male
IDmale_namemother_namemother
2AlbertElaine0
3GeorgeElaine0
4CharlesFrancine1