Skip to content

Instantly share code, notes, and snippets.

@benwbrum
Created May 25, 2016 16:28
Show Gist options
  • Select an option

  • Save benwbrum/3706f9dbbdc71a8a809d18fd86928cdd to your computer and use it in GitHub Desktop.

Select an option

Save benwbrum/3706f9dbbdc71a8a809d18fd86928cdd to your computer and use it in GitHub Desktop.
Examples of the FreeXXX2 data model
// here is a specific record which will be returned for FreeCEN 2 searches
//
// irb(main):005:0> print JSON.pretty_unparse(JSON.parse(SearchRecord.last.to_json))
{
"_id": "5729f15fe93790843021d1c6",
"annotation_ids": null,
"asset_id": null,
"chapman_code": "ABD",
"freecen_individual_id": "5729f15de93790843021cfdb",
"freereg1_csv_entry_id": null,
"location_names": [
"New Pitsligo"
],
"place_id": "57297e4ae937908a55000110",
"record_type": "1861",
"search_dates": [
"1857-*-*"
],
"search_names": [
{
"_id": "5729f15fe93790843021d1c7",
"first_name": "james",
"gender": "m",
"last_name": "fraser",
"origin": "transcript",
"role": null,
"type": "p"
}
],
"search_soundex": [
{
"first_name": "J520",
"last_name": "F626",
"type": "p"
}
],
"transcript_dates": [
"1857-*-*"
],
"transcript_names": [
{
"first_name": "James",
"last_name": "FRASER",
"type": "primary"
}
]
// Here is the freecen individual -- the freecen-specific record recording
// the transcribed person.
//
// Unlike FreeREG, the project-specific entries we display are not the same
// as the records ingested from the offline transcripts Partly this is
// because the uploaded VLD files are so horrible; partly because the VLD
// files are not actually the CSV files the transcribers create, but mainly
// because FreeCEN tracks both dwellings and individuals -- a more complex
// data model than found in parish register entries
//irb(main):006:0> print JSON.pretty_unparse(JSON.parse(SearchRecord.last.freecen_individual.to_json))
{
"_id": "5729f15de93790843021cfdb",
"age": "4",
"age_unit": "y",
"birth_county": null,
"birth_place": null,
"birth_place_flag": "-",
"detail_flag": "-",
"disability": null,
"forenames": "James",
"freecen1_vld_entry_id": "5729f15de93790843021cebe",
"freecen_dwelling_id": "5729f15de93790843021cfd5",
"individual_flag": "-",
"language": null,
"marital_status": "U",
"name_flag": "-",
"notes": null,
"occupation": "Visitor",
"occupation_flag": "-",
"relationship": "Grnson",
"sequence_in_household": 6,
"sex": "M",
"surname": "FRASER",
"verbatim_birth_county": "ABD",
"verbatim_birth_place": "Strichen"
}
// here is the dwelling that individual lives in, which is also used in displaying records
//irb(main):007:0> print JSON.pretty_unparse(JSON.parse(SearchRecord.last.freecen_individual.freecen_dwelling.to_json))
{
"_id": "5729f15de93790843021cfd5",
"civil_parish": "Strichen",
"deleted_flag": null,
"dwelling_number": 46,
"ecclesiastical_parish": "New Pitsligo",
"enumeration_district": "7",
"folio_number": "0",
"freecen1_vld_file_id": "5729f15de93790843021cdcf",
"freecen_piece_id": "57297e4ae937908a550000f3",
"house_number": null,
"house_or_street_name": "Whitehill",
"page_number": 11,
"place_id": "57297e4ae937908a55000110",
"schedule_number": "13",
"uninhabited_flag": "-",
"unoccupied_notes": "4 rooms"
}
// in Freecen, individuals are displayed in the context of their dwelling. Dwellings
// may contain no inhabitants or hundreds. Here are the individuals within this dwelling:
// irb(main):008:0> print JSON.pretty_unparse(JSON.parse(SearchRecord.last.freecen_individual.freecen_dwelling.freecen_individuals.to_json))
[
{
"_id": "5729f15de93790843021cfd6",
"age": "68",
"age_unit": "y",
"birth_county": null,
"birth_place": null,
"birth_place_flag": "-",
"detail_flag": "-",
"disability": null,
"forenames": "William",
"freecen1_vld_entry_id": "5729f15de93790843021ceb9",
"freecen_dwelling_id": "5729f15de93790843021cfd5",
"individual_flag": "-",
"language": null,
"marital_status": "M",
"name_flag": "-",
"notes": "4 rooms",
"occupation": "Crofter 15 Acres",
"occupation_flag": "-",
"relationship": "Head",
"sequence_in_household": 1,
"sex": "M",
"surname": "BROWN",
"verbatim_birth_county": "ABD",
"verbatim_birth_place": "Strichen"
},
{
"_id": "5729f15de93790843021cfd7",
"age": "66",
"age_unit": "y",
"birth_county": null,
"birth_place": null,
"birth_place_flag": "-",
"detail_flag": "-",
"disability": null,
"forenames": "Ann",
"freecen1_vld_entry_id": "5729f15de93790843021ceba",
"freecen_dwelling_id": "5729f15de93790843021cfd5",
"individual_flag": "-",
"language": null,
"marital_status": "M",
"name_flag": "-",
"notes": null,
"occupation": "Crofter's Wife",
"occupation_flag": "-",
"relationship": "Wife",
"sequence_in_household": 2,
"sex": "F",
"surname": "BROWN",
"verbatim_birth_county": "ABD",
"verbatim_birth_place": "Strichen"
},
{
"_id": "5729f15de93790843021cfd8",
"age": "11",
"age_unit": "y",
"birth_county": null,
"birth_place": null,
"birth_place_flag": "-",
"detail_flag": "-",
"disability": null,
"forenames": "Ann",
"freecen1_vld_entry_id": "5729f15de93790843021cebb",
"freecen_dwelling_id": "5729f15de93790843021cfd5",
"individual_flag": "-",
"language": null,
"marital_status": "U",
"name_flag": "-",
"notes": null,
"occupation": "Servant",
"occupation_flag": "-",
"relationship": "Grndau",
"sequence_in_household": 3,
"sex": "F",
"surname": "WALKER",
"verbatim_birth_county": "ABD",
"verbatim_birth_place": "Strichen"
},
{
"_id": "5729f15de93790843021cfd9",
"age": "6",
"age_unit": "y",
"birth_county": null,
"birth_place": null,
"birth_place_flag": "-",
"detail_flag": "-",
"disability": null,
"forenames": "Mary",
"freecen1_vld_entry_id": "5729f15de93790843021cebc",
"freecen_dwelling_id": "5729f15de93790843021cfd5",
"individual_flag": "-",
"language": null,
"marital_status": "U",
"name_flag": "-",
"notes": null,
"occupation": "Visitor",
"occupation_flag": "-",
"relationship": "Grndau",
"sequence_in_household": 4,
"sex": "F",
"surname": "ELRICK",
"verbatim_birth_county": "ABD",
"verbatim_birth_place": "Strichen"
},
{
"_id": "5729f15de93790843021cfda",
"age": "34",
"age_unit": "y",
"birth_county": null,
"birth_place": null,
"birth_place_flag": "-",
"detail_flag": "-",
"disability": null,
"forenames": "James",
"freecen1_vld_entry_id": "5729f15de93790843021cebd",
"freecen_dwelling_id": "5729f15de93790843021cfd5",
"individual_flag": "-",
"language": null,
"marital_status": "U",
"name_flag": "-",
"notes": null,
"occupation": "Agricultural Labourer",
"occupation_flag": "-",
"relationship": "Son",
"sequence_in_household": 5,
"sex": "M",
"surname": "BROWN",
"verbatim_birth_county": "ABD",
"verbatim_birth_place": "Fraserburgh"
},
{
"_id": "5729f15de93790843021cfdb",
"age": "4",
"age_unit": "y",
"birth_county": null,
"birth_place": null,
"birth_place_flag": "-",
"detail_flag": "-",
"disability": null,
"forenames": "James",
"freecen1_vld_entry_id": "5729f15de93790843021cebe",
"freecen_dwelling_id": "5729f15de93790843021cfd5",
"individual_flag": "-",
"language": null,
"marital_status": "U",
"name_flag": "-",
"notes": null,
"occupation": "Visitor",
"occupation_flag": "-",
"relationship": "Grnson",
"sequence_in_household": 6,
"sex": "M",
"surname": "FRASER",
"verbatim_birth_county": "ABD",
"verbatim_birth_place": "Strichen"
}
]
// here is the parsed VLD entry for the individual above. It is simply a
// parsed version of the fields in the VLD file, used to create individual
// dwelling records
{
"_id": "5729f15de93790843021cebe",
"age": "4",
"age_unit": "y",
"birth_county": null,
"birth_place": null,
"birth_place_flag": "-",
"civil_parish": "Strichen",
"deleted_flag": null,
"detail_flag": "-",
"disability": null,
"dwelling_number": 46,
"ecclesiastical_parish": "New Pitsligo",
"enumeration_district": "7",
"folio_number": "0",
"forenames": "James",
"freecen1_vld_file_id": "5729f15de93790843021cdcf",
"house_number": null,
"house_or_street_name": "Whitehill",
"individual_flag": "-",
"language": null,
"marital_status": "U",
"name_flag": "-",
"notes": null,
"occupation": "Visitor",
"occupation_flag": "-",
"page_number": 11,
"relationship": "Grnson",
"schedule_number": "13",
"sequence_in_household": 6,
"sex": "M",
"surname": "FRASER",
"uninhabited_flag": "-",
"unoccupied_notes": null,
"verbatim_birth_county": "ABD",
"verbatim_birth_place": "Strichen"
}
// finally, the freecen1_vld_file record:
// irb(main):010:0> print JSON.pretty_unparse(JSON.parse(SearchRecord.last.freecen_individual.freecen1_vld_entry.freecen1_vld_file.to_json))
{
"_id": "5729f15de93790843021cdcf",
"census_type": "RS",
"dir_name": "ABD",
"file_name": "RS615227.VLD",
"full_year": "1861",
"piece": 227,
"raw_year": "3",
"sctpar": "15",
"series": "SCT"
}
/////////////////////////////////////////////
// FreeREG 2
/////////////////////////////////////////////
// search record for a baptism:
// 2.1.5 :003 > print JSON.pretty_unparse(JSON.parse(SearchRecord.first.to_json))
{
"_id": "5745b6f5a020ddf561000002",
"annotation_ids": null,
"asset_id": null,
"chapman_code": "MDX",
"digest": "O6oQ5kBEeCjo2olFsTDHvg==",
"file_line_number": 1,
"freereg1_csv_entry_id": "5745b6f5a020ddf561000001",
"line_id": "k9bliss22.MDXCOVBA.CSV.1",
"location_names": [
"Covent Garden (St Paul)",
" [Transcript]"
],
"place_id": "53cd496aeca9ebee4f0066bc",
"record_type": "ba",
"search_dates": [
"1752-09-15"
],
"search_names": [
{
"_id": "5745b6f5a020ddf561000003",
"first_name": "anne",
"gender": "f",
"last_name": "hardy",
"origin": "transcript",
"role": "ba",
"type": "p"
},
{
"_id": "5745b6f5a020ddf561000004",
"first_name": "james",
"gender": "m",
"last_name": "hardy",
"origin": "transcript",
"role": "f",
"type": "f"
},
{
"_id": "5745b6f5a020ddf561000005",
"first_name": "anne",
"gender": "f",
"last_name": "hardy",
"origin": "transcript",
"role": "m",
"type": "f"
}
],
"search_record_version": "",
"search_soundex": [
{
"first_name": "A500",
"last_name": "H630",
"type": "p"
},
{
"first_name": "J520",
"last_name": "H630",
"type": "f"
},
{
"first_name": "A500",
"last_name": "H630",
"type": "f"
}
],
"transcript_dates": [
"15 Sep 1752"
],
"transcript_names": [
{
"role": "ba",
"type": "primary",
"first_name": "Anne",
"last_name": "HARDY"
},
{
"role": "f",
"type": "other",
"first_name": "James",
"last_name": "HARDY"
},
{
"role": "m",
"type": "other",
"first_name": "Anne",
"last_name": "HARDY"
}
]
}
// freereg1 csv entry corresponding to a row in the baptism CSV file:
// 2.1.5 :004 > print JSON.pretty_unparse(JSON.parse(SearchRecord.first.freereg1_csv_entry.to_json))
{
"_id": "5745b6f5a020ddf561000001",
"baptism_date": "15 Sep 1752",
"birth_date": null,
"bride_abode": null,
"bride_age": null,
"bride_condition": null,
"bride_father_forename": null,
"bride_father_occupation": null,
"bride_father_surname": null,
"bride_forename": null,
"bride_occupation": null,
"bride_parish": null,
"bride_surname": null,
"burial_date": null,
"burial_person_abode": null,
"burial_person_forename": null,
"burial_person_surname": null,
"c_at": "2016-05-25T14:30:13Z",
"chapman_code": "MDX",
"church_name": "St Paul",
"county": "MDX",
"error_flag": "false",
"father_forename": "James",
"father_occupation": null,
"father_surname": "HARDY",
"female_relative_forename": null,
"file_line_number": 1,
"film": null,
"film_number": null,
"freereg1_csv_file_id": "5463baa8e9379027823e9709",
"groom_abode": null,
"groom_age": null,
"groom_condition": null,
"groom_father_forename": null,
"groom_father_occupation": null,
"groom_father_surname": null,
"groom_forename": null,
"groom_occupation": null,
"groom_parish": null,
"groom_surname": null,
"line_id": "k9bliss22.MDXCOVBA.CSV.1",
"location": "MDXCoventGardenStPaulTRba",
"male_relative_forename": null,
"marriage_date": null,
"mother_forename": "Anne",
"mother_surname": null,
"notes": null,
"notes_from_transcriber": null,
"person_abode": null,
"person_age": null,
"person_forename": "Anne",
"person_sex": "F",
"place": "Covent Garden",
"place_name": "Covent Garden",
"record_digest": "YDj6lq1YEQPaQZVlu7vftA==",
"record_type": "ba",
"register": null,
"register_entry_number": null,
"register_type": "TR",
"relationship": null,
"relative_surname": null,
"u_at": "2016-05-25T14:30:13Z",
"witness1_forename": null,
"witness1_surname": null,
"witness2_forename": null,
"witness2_surname": null,
"year": "1752"
}
// freereg1_csv_file containing the record:
// 2.1.5 :005 > print JSON.pretty_unparse(JSON.parse(SearchRecord.first.freereg1_csv_entry.freereg1_csv_file.to_json))
{
"_id": "5463baa8e9379027823e9709",
"action": null,
"alternate_register_name": "St Paul TR",
"chapman_code": null,
"characterset": "Windows-1252",
"church_name": "St Paul",
"country": null,
"county": "MDX",
"created_at": "2014-11-12T19:53:12Z",
"credit_email": "[email protected]",
"credit_name": "James Harper",
"csvfile": null,
"datemax": "1773",
"datemin": "1752",
"daterange": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
229,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"def": false,
"digest": "6e09b5957aa28b4e6cefe2949fe663df",
"error": 0,
"file_name": "MDXCOVBA.CSV",
"first_comment": "Published Transcript by the Harleian Society",
"lds": "no",
"locked_by_coordinator": false,
"locked_by_transcriber": false,
"modification_date": "07 May 2014",
"place": "Covent Garden",
"place_name": null,
"processed": true,
"processed_date": "2016-05-25T14:30:15+00:00",
"record_type": "ba",
"records": "230",
"register_id": "54082497eca9eb0248c9cb61",
"register_type": "TR",
"search_record_version": null,
"second_comment": null,
"software_version": null,
"transcriber_email": "[email protected]",
"transcriber_name": "James Harper",
"transcriber_syndicate": "Middlesex",
"transcription_date": "03-Jun-2011",
"updated_at": "2016-05-25T14:30:20Z",
"uploaded_date": "2016-05-14T13:19:59+00:00",
"userid": "k9bliss22",
"userid_detail_id": "5462b425e937907d70000611",
"userid_lower_case": "k9bliss22"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment