Linkage.aql 721 Bytes
Newer Older
Ryan Wisnesky's avatar
Ryan Wisnesky committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//Record Linkage

schema S = literal : sql {
	entities
		Element
	attributes
		name1 name2 : Element -> String	
		num1 num2 : Element -> String
}

instance I = literal : S {
	generators
		e1 e2 e3 x y z d : Element
	equations
		e1.name1 = "H"   e1.num1 = "1"
		e2.name1 = "He"  e2.num1 = "2"
		e3.name1 = "Li"  e3.num1 = "3"
		x.name2 = "Hydrogen"  x.num2 = "1"
		y.name2 = "Helium"    y.num2 = "2"
		z.name2 = "Lithium"   z.num2 = "3"
		d.name2 = "Beryllium" d.num2 = "4"	
}

instance J = quotient_query I {
	entity Element -> {from a:Element b:Element where a.num1 = b.num2}
}
Ryan Wisnesky's avatar
Ryan Wisnesky committed
27
28
29
30
31
32
33


instance J2 = quotient_query I {
	entity Element -> {from a:Element b:Element where a.num1 = b.num2}
	options
	quotient_use_chase = false
}