example Pushout

typeside Type = literal {
	external_types
		dom -> "java.lang.Object"
	external_parsers
		dom -> "x => x"
}

#####################################/

schema Span = literal : Type {
	entities
		A B C
 	foreign_keys
		f: A -> B
		g: A -> C
	attributes
		C_att : C -> dom
		B_att : B -> dom
}

schema Square = literal : Type {
	imports
		Span
	entities
		D
 	foreign_keys
		f2: B -> D
		g2: C -> D
	path_equations
		A.f.f2=A.g.g2
	attributes
		D_attB : D -> dom
		D_attC : D -> dom
}

instance J = literal : Span {
	generators
		a : A
		b1 b2 : B
		c1 c2 : C
	equations
		b1.B_att = "b1"@dom
		b2.B_att = "b2"@dom
		c1.C_att = "c1"@dom
		c2.C_att = "c2"@dom
		a.f = b1
		a.g = c1
}

##################################################
#pushouts, using queries

query pushout = literal : Square -> Span {


entity	B -> {from b:B
		 attributes B_att -> b.f2.D_attB}

entity	C -> {from c:C
		 attributes C_att -> c.g2.D_attC}

entity	A -> {from a:A
			foreign_keys
			f -> {b -> a.f}
			g -> {c -> a.g}}

}

instance I = coeval pushout J

transform t = unit_query pushout J
Keywords:

typeside_literal
schema_literal
coeval
instance_literal
query_literal
unit_query

Options:




instance J

A
IDfg
013
B
IDB_att
1b1
2b2
C
IDC_att
3c1
4c2


instance I

A
IDfg
013
B
IDB_attf2
1?05
2?16
C
IDC_attg2
3?25
4?37
D
IDD_attBD_attC
5b1c1
6b2?4
7?5c2