# # KEHOME/src/birth.icn # Richard H. McCullough Oct/5/2003 Jul/20/2009 Aug/15/2014 Mar/28/2015 ##### $include "mkr_parser.h" $include "keparam.h" # procedures #==========# # procedure_birth(rname,nvtab) ## automatic: 8 proposition/infon ## meaning: 2 proposition/infon # #r_birth is relation with # tmode = gdbm, relKey = "$1", # relLabel = (pid, sex, birthname, birthdate, birthplace, deathdate, deathplace, deathcause), # relType = (person, sex, birthname, time, space, time, space, cause), # automatic = ISA, # meaning = procedure_birth; ## meaning = { ## $1 isu person with pid = $1; ## $1 has sex = $2,has birthname = $3,has birthdate = $4,has birthplace = $5, ## has deathdate = $6,has deathplace = $7,has deathcause = $8; ## }; #r_death is relation with # tmode = gdbm, relKey = "$1", # relLabel = (pid; deathdate; deathplace; deathcause), # relType = (person; time; space; cause), # meaning = procedure_birth; ## meaning = { ## $1 has deathdate = $2,has deathplace = $3,has deathcause = $4; ## #at space = $3,time = $2 {$1 do die with deathcause = $4;}; ## }; invocable "procedure_birth" procedure procedure_birth(rname,nvtab) #===================================== local d1,d2,d3,d4,d5,d6,d7,d8 local p,q,cache case rname of { "r_birth": { # initialization #--------------# d1 := unparse(nvtab["$1"]) # $1 = pid d2 := unparse(nvtab["$2"]) # $2 = sex d3 := unparse(nvtab["$3"]) # $3 = birthname d4 := unparse(nvtab["$4"]) # $4 = birthdate d5 := unparse(nvtab["$5"]) # $5 = birthplace d6 := unparse(nvtab["$6"]) # $6 = deathdate d7 := unparse(nvtab["$7"]) # $7 = deathplace d8 := unparse(nvtab["$7"]) # $8 = deathcause # meaning #-------# q := new_concept(d1,"person") p := new_person(q,d2,d3,d4,d5) # new cache put_nv(q,NVPHRASE(["pid","=",q])) # $1 has pid=$1 put_nv(q,NVPHRASE(["sex","=",d2])) put_nv(q,NVPHRASE(["deathdate","=",d6])) put_nv(q,NVPHRASE(["deathplace","=",d7])) put_nv(q,NVPHRASE(["deathcause","=",d8])) } # end "r_birth" "r_death": { # initialization #--------------# d1 := unparse(nvtab["$1"]) # $1 = pid d2 := unparse(nvtab["$2"]) # $2 = deathdate d3 := unparse(nvtab["$3"]) # $3 = deathplace d4 := unparse(nvtab["$4"]) # $4 = deathcause # meaning #-------# q := new_concept(d1,"person") p := new_person(q) # new cache put_nv(q,NVPHRASE(["pid","=",q])) # $1 has pid=$1 put_nv(q,NVPHRASE(["deathdate","=",d2])) put_nv(q,NVPHRASE(["deathplace","=",d3])) put_nv(q,NVPHRASE(["deathcause","=",d4])) } # end "r_death" } # end case rname end #