#gedcom-relations file #Originally by Jos De Roo#Revised by Dan Goessling@prefix gc: <http://www.daml.org/2001/01/gedcom/gedcom#>.@prefix log: <http://www.w3.org/2000/10/swap/log#>.@prefix ex: <http://www.daml.org/2000/10/daml-ex#> .@prefix : <#>.:gender = gc:sex.#"If a child is a child in a family and  a parent is a spouse in the  family, #then the parent is a parent of the child."@forAll :child, :family, :parent. {:child gc:childIn :family. :parent gc:spouseIn :family} log:implies {:child gc:parent :parent}. # "If a child has parent and the parent is male, then then the childs's father is the parent."@forAll :child, :parent. {:child gc:parent :parent. :parent :gender :M} log:implies {:child gc:father :parent} .@forAll :child, :parent. {:child gc:parent :parent. :parent :gender :F} log:implies {:child gc:mother :parent}. @forAll :child, :parent. {:child gc:parent :parent} log:implies {:parent gc:child :child}. #"If a child of a parent is male, then the child is the son of the parent."@forAll :child, :parent. {:child gc:parent :parent. :child :gender :M} log:implies {:parent gc:son :child} . @forAll :child, :parent. {:child gc:parent :parent. :child :gender :F} log:implies {:parent gc:daughter :child}.#Rules about grandparents@forAll :child, :parent, :grandparent. {:child gc:parent :parent. :parent gc:parent :grandparent} log:implies {:child gc:grandparent :grandparent}.@forAll :child, :parent, :grandparent. {:child gc:grandparent :grandparent. :grandparent :gender :M} log:implies {:child gc:grandfather :grandparent}.@forAll :child, :parent, :grandparent. {:child gc:grandparent :grandparent. :grandparent :gender :F} log:implies {:child gc:grandmother :grandparent}.@forAll :child, :grandparent.{:child gc:grandparent :grandparent} log:implies {:grandparent gc:grandchild :child} .@forAll :child, :grandparent. {:child gc:grandparent :grandparent. :child :gender :M} log:implies {:grandparent gc:grandson :child}.@forAll :child, :grandparent. {:child gc:grandparent :grandparent. :child :gender :F} log:implies {:grandparent gc:granddaughter :child}.#Rules about siblings and brother and sisters#Thanks to DanCon#"If child1 is in a family, and child2 is in the family, and child1 is not child2, then child1 and child2 are siblings."@forAll :child1, :child2, :family. { :child1 gc:childIn :family. :child2 gc:childIn :family. :child1 log:notEqualTo :child2} log:implies { :child1 gc:sibling :child2}.@forAll :child1, :child2. {:child2 gc:sibling :child1} log:implies {:child1 gc:sibling :child2}.@forAll :child, :sibling. { :child gc:sibling :sibling. :sibling :gender :M } log:implies {:child gc:brother :sibling}. @forAll :child, :sibling. { :child gc:sibling :sibling. :sibling :gender :F } log:implies {:child gc:sister :sibling}.@forAll :child, :sister. {:child gc:sister :sister} log:implies {:child gc:sibling :sister}.#Husbands and wives. #The authors leave same-sex marriages as an exercise for the student.@forAll :spouse1, :spouse2, :family. {:spouse1 gc:spouseIn :family. :spouse2 gc:spouseIn :family. :spouse1 log:notEqualTo :spouse2} log:implies {:spouse1 gc:spouse :spouse2}.@forAll :spouse1, :spouse2. {:spouse2 gc:spouse :spouse1} log:implies {:spouse1 gc:spouse :spouse2}.@forAll :spouse, :husband. {:spouse gc:spouse :husband. :husband :gender :M} log:implies {:spouse gc:husband :husband}.@forAll :spouse, :wife. {:spouse gc:spouse :wife. :wife :gender :F} log:implies {:spouse gc:wife  :wife}.#Aunts and uncles@forAll :child, :uncle, :parent. {:child gc:parent :parent. :parent gc:brother :uncle} log:implies {:child gc:uncle :uncle}.@forAll :child, :uncle, :aunt. {:child gc:aunt  :aunt. :aunt gc:spouse :uncle} log:implies {:child gc:uncle :uncle}.@forAll :child, :aunt, :parent. {:child gc:parent :parent. :parent gc:sister :aunt} log:implies {:child gc:aunt :aunt}.@forAll :child, :uncle, :aunt. {:child gc:uncle :uncle. :uncle gc:spouse :aunt} log:implies {:child gc:aunt :aunt}.#Nieces and Nephews@forAll :sibling, :child, :parent. {:parent gc:daughter :child. :parent gc:sibling :sibling} log:implies {:sibling gc:niece :child}.@forAll :sibling, :child, :parent. {:parent gc:son :child. :parent gc:sibling :sibling} log:implies {:sibling gc:nephew :child}. #First Cousins@forAll :cousin1, :cousin2, :sibling1, :sibling2. {:cousin1 gc:parent :sibling1. :cousin2 gc:parent :sibling2. :sibling1 gc:sibling :sibling2} log:implies {:cousin1 gc:firstCousin :cousin2}.#Second Cousins (new from Dan G)@forAll :scousin1, :scousin2, :cousin1, :cousin2. {:scousin1 gc:parent :cousin1. :scousin2 gc:parent :cousin2. :cousin1 gc:firstCousin :cousin2} log:implies {:scousin1 gc:secondCousin :scousin2}. #ancestors@forAll :child, :parent. {:child gc:parent :parent} log:implies {:child gc:ancestor :parent}. @forAll :child, :parent, :ancestor. {:child gc:parent :parent. :parent gc:ancestor :ancestor} log:implies {:child gc:ancestor :ancestor}.@forAll :child, :ancestor. {:child gc:ancestor :ancestor} log:implies {:ancestor gc:descendent :child}.#generic cousin@forAll :descendent1, :descendent2, :sibling1, :sibling2. {:sibling1 gc:sibling :sibling2. :sibling1 gc:descendent :descendent1. :sibling2 gc:descendent :descendent2} log:implies {:descendent1 gc:cousin :descendent2} .
