Database Reference
In-Depth Information
:has-header true)
?GEOID ?SUMLEV ?STATE _ _ _ _ _
?NAME ?spop100 ?shu100 _ _ ?sp035001 _)
(->long ?spop100 :> ?POP100)
(->long ?shu100 :> ?HU100)
(->long ?sp035001 :> ?P035001)))
2.
We also need to read in the race data ile:
(def race-data
(<- [?GEOID ?SUMLEV ?STATE
?NAME ?POP100 ?HU100 ?P003001 ?P003002
?P003003 ?P003004 ?P003005 ?P003006 ?P003007
?P003008]
((hfs-text-delim race-file :has-header true)
?GEOID ?SUMLEV ?STATE _ _ _ _ _
?NAME ?spop100 ?shu100 _ _
?sp003001 _ ?sp003002 _ ?sp003003 _
?sp003004 _ ?sp003005 _ ?sp003006 _
?sp003007 _ ?sp003008 _)
(->long ?spop100 :> ?POP100)
(->long ?shu100 :> ?HU100)
(->long ?sp003001 :> ?P003001)
(->long ?sp003002 :> ?P003002)
(->long ?sp003003 :> ?P003003)
(->long ?sp003004 :> ?P003004)
(->long ?sp003005 :> ?P003005)
(->long ?sp003006 :> ?P003006)
(->long ?sp003007 :> ?P003007)
(->long ?sp003008 :> ?P003008)))
3.
We'll use the preceding queries to build a query that joins them on the ?GEOID ield.
It will also rename some of the ields:
(def census-joined
(<- [?name ?pop100 ?hu100 ?families
?white ?black ?indian ?asian ?hawaiian ?other
?multiple]
(family-data ?geoid _ _
?name ?pop100 ?hu100 ?families)
(race-data ?geoid _ _ _ _ _ _
?white ?black ?indian ?asian
?hawaiian ?other ?multiple)))
 
Search WWH ::




Custom Search