/// <summary> /// Visits the fact. /// </summary> /// <param name="fact">The fact to visit.</param> public override void VisitFact(Gx.Conclusion.Fact fact) { if (fact.Id != null) { this.dictionary.Add(fact.Id, fact); } base.VisitFact(fact); }
public void TestExample() { Agent contributor = (Agent)new Agent().SetName("Jane Doe").SetEmail("*****@*****.**").SetId("A-1"); Agent repository = (Agent)new Agent().SetName("General Registry Office, Southport").SetId("A-2"); Attribution attribution = new Attribution().SetContributor(contributor).SetModified(DateTime.Parse("2014-03-07")); SourceDescription sourceDescription = (SourceDescription)new SourceDescription() .SetTitle("Birth Certificate of Emma Bocock, 23 July 1843, General Registry Office") .SetCitation(new SourceCitation().SetValue("England, birth certificate for Emma Bocock, born 23 July 1843; citing 1843 Birth in District and Sub-district of Ecclesall-Bierlow in the County of York, 303; General Registry Office, Southport.")) .SetResourceType(ResourceType.PhysicalArtifact) .SetCreated(DateTime.Parse("1843-07-27")) .SetRepository(repository) .SetId("S-1"); Fact birth = new Fact() .SetType(FactType.Birth) .SetDate(new DateInfo().SetOriginal("23 June 1843")) .SetPlace(new PlaceReference().SetOriginal("Broadfield Bar, Abbeydale Road, Ecclesall-Bierlow, York, England, United Kingdom")); Person emma = (Person)new Person().SetName("Emma Bocock").SetGender(GenderType.Female).SetFact(birth).SetExtracted(true).SetSource(sourceDescription).SetId("P-1"); Person father = (Person)new Person().SetName("William Bocock").SetFact(new Fact().SetType(FactType.Occupation).SetValue("Toll Collector")).SetExtracted(true).SetSource(sourceDescription).SetId("P-2"); Person mother = (Person)new Person().SetName("Sarah Bocock formerly Brough").SetExtracted(true).SetSource(sourceDescription).SetId("P-3"); Relationship fatherRelationship = new Relationship().SetType(RelationshipType.ParentChild).SetPerson1(father).SetPerson2(emma); Relationship motherRelationship = new Relationship().SetType(RelationshipType.ParentChild).SetPerson1(mother).SetPerson2(emma); Document analysis = (Document)new Document().SetText("...Jane Doe's analysis document...").SetId("D-1"); Person emmaConclusion = (Person)new Person().SetEvidence(emma).SetAnalysis(analysis).SetId("C-1"); Gx.Gedcomx gx = new Gx.Gedcomx() .SetAgent(contributor) .SetAgent(repository) .SetAttribution(attribution) .SetSourceDescription(sourceDescription) .SetPerson(emma) .SetPerson(father) .SetPerson(mother) .SetRelationship(fatherRelationship) .SetRelationship(motherRelationship) .SetDocument(analysis) .SetPerson(emmaConclusion); xmlSerializer.Deserialize<Gx.Gedcomx>(xmlSerializer.Serialize(gx)); jsonSerializer.Deserialize<Gx.Gedcomx>(jsonSerializer.Serialize(gx)); }
/** * Add a fact conclusion for the father. * * @param fact The fact conclusion to be added. */ public void AddFatherFact(Fact fact) { if (fact != null) { if (_fatherFacts == null) { _fatherFacts = new List<Fact>(); } _fatherFacts.Add(fact); } }
/** * Build out this relationship with a mother fact. * * @param fact The mother fact. * @return The mother fact. */ public ChildAndParentsRelationship SetMotherFact(Fact fact) { this.AddMotherFact(fact); return this; }
public void TestExample() { //Jane Doe, the researcher. Agent janeDoe = (Agent)new Agent().SetName("Jane Doe").SetEmail("*****@*****.**").SetId("A-1"); //Lin Yee Chung Cemetery Agent cemetery = (Agent)new Agent().SetName("Lin Yee Chung Cemetery").SetAddress(new Address().SetCity("Honolulu").SetStateOrProvince("Hawaii")).SetId("A-2"); //Hanyu Pinyin, the translator. Agent hanyuPinyin = (Agent)new Agent().SetName("HANYU Pinyin 王大年").SetEmail("*****@*****.**").SetId("A-3"); //The attribution for this research. Attribution researchAttribution = new Attribution().SetContributor(janeDoe).SetModified(DateTime.Parse("2014-03-27")); //The attribution for the translation. Attribution translationAttribution = new Attribution().SetContributor(hanyuPinyin).SetModified(DateTime.Parse("2014-03-27")); //The grave stone. SourceDescription gravestoneDescription = (SourceDescription)new SourceDescription() .SetTitle("Grave Marker of WONG Aloiau, Lin Yee Chung Cemetery, Honolulu, Oahu, Hawaii") .SetCitation(new SourceCitation().SetValue("WONG Aloiau gravestone, Lin Yee Chung Cemetery, Honolulu, Oahu, Hawaii; visited May 1975 by Jane Doe.")) .SetResourceType(ResourceType.PhysicalArtifact) .SetRepository(cemetery) .SetId("S-1"); //The image of the grave stone. SourceDescription gravestoneImageDescription = (SourceDescription)new SourceDescription() .SetTitle("Grave Marker of WONG Aloiau, Lin Yee Chung Cemetery, Honolulu, Oahu, Hawaii") .SetCitation(new SourceCitation().SetValue("WONG Aloiau gravestone (digital photograph), Lin Yee Chung Cemetery, Honolulu, Oahu, Hawaii; visited May 1975 by Jane Doe.")) .SetResourceType(ResourceType.DigitalArtifact) .SetSource(new SourceReference().SetDescription(gravestoneDescription)) .SetId("S-2"); //The transcription of the grave stone. Document transcription = (Document)new Document() .SetText("WONG ALOIAU\n" + "NOV. 22, 1848 – AUG. 3, 1920\n" + "中山 大字都 泮沙鄉\n" + "生 於 前 清 戊申 年 十一 月 廿二(日)子 時\n" + "終 於 民國 庚申 年 七月 十二 (日) 午 時\n" + "先考 諱 羅有 字 容康 王 府 君 之 墓") .SetSource(gravestoneImageDescription) .SetLang("zh") .SetId("D-1"); //The transcription described as a source. SourceDescription transcriptionDescription = (SourceDescription)new SourceDescription() .SetAbout("#" + transcription.Id) .SetTitle("Transcription of Grave Marker of WONG Aloiau, Lin Yee Chung Cemetery, Honolulu, Oahu, Hawaii") .SetCitation(new SourceCitation().SetValue("WONG Aloiau gravestone (transcription), Lin Yee Chung Cemetery, Honolulu, Oahu, Hawaii; visited May 1975 by Jane Doe.")) .SetResourceType(ResourceType.DigitalArtifact) .SetSource(new SourceReference().SetDescription(gravestoneImageDescription)) .SetId("S-3"); //The translation of the grave stone. Document translation = (Document)new Document() .SetText("WONG ALOIAU\n" + "NOV. 22, 1848 – AUG. 3, 1920 [lunar dates]\n" + "[Birthplace] [China, Guandong, ]Chung Shan, See Dai Doo, Pun Sha village\n" + "[Date of birth] Born at former Qing 1848 year 11th month 22nd day 23-1 hour.\n" + "[Life] ended at Republic of China year 1920 year 7th mo. 12th day 11-13 hour.\n" + "Deceased father avoid [mention of] Lo Yau also known as Young Hong Wong [noble]residence ruler’s grave.") .SetSource(transcriptionDescription) .SetId("D-2"); //The translation described as a source. SourceDescription translationDescription = (SourceDescription)new SourceDescription() .SetAbout("#" + translation.Id) .SetTitle("Translation of Grave Marker of WONG Aloiau, Lin Yee Chung Cemetery, Honolulu, Oahu, Hawaii") .SetCitation(new SourceCitation().SetValue("WONG Aloiau gravestone, Lin Yee Chung Cemetery, Honolulu, Oahu, Hawaii; visited May 1975 by Jane Doe. Translation by HANYU Pinyin 王大年.")) .SetAttribution(translationAttribution) .SetResourceType(ResourceType.DigitalArtifact) .SetSource(new SourceReference().SetDescription(transcriptionDescription)) .SetId("S-4"); //the birth. Fact birth = new Fact() .SetType(FactType.Birth) .SetDate(new DateInfo().SetOriginal("former Qing 1848 year 11th month 22nd day 23-1 hour").SetFormal("+1848-11-22")) .SetPlace(new PlaceReference().SetOriginal("Pun Sha Village, See Dai Doo, Chung Shan, Guangdong, China")); //the death. Fact death = new Fact() .SetType(FactType.Death) .SetDate(new DateInfo().SetOriginal("Republic of China year 1920 year 7th mo. 12th day 11-13 hour").SetFormal("+1920-08-03")); //the burial. Fact burial = new Fact() .SetType(FactType.Burial) .SetPlace(new PlaceReference().SetOriginal("Lin Yee Chung Cemetery, Honolulu, Oahu, Hawaii")); //the principal person Person aloiau = (Person)new Person().SetName("WONG Aloiau").SetGender(GenderType.Male).SetFact(birth).SetFact(death).SetFact(burial).SetExtracted(true).SetSource(translationDescription).SetId("P-1"); //the father of the principal (with an aka name). Person father = (Person)new Person().SetName("Lo Yau").SetName(new Name().SetType(NameType.AlsoKnownAs).SetNameForm(new NameForm().SetFullText("Young Hong Wong"))).SetExtracted(true).SetSource(translationDescription).SetId("P-2"); //the relationship. Relationship fatherRelationship = new Relationship().SetType(RelationshipType.ParentChild).SetPerson1(father).SetPerson2(aloiau); //Jane Doe's analysis. Document analysis = (Document)new Document().SetText("...Jane Doe's analysis document...").SetId("D-3"); //Jane Doe's conclusions about a person. Person aloiauConclusion = (Person)new Person().SetEvidence(aloiau).SetAnalysis(analysis).SetId("C-1"); Gx.Gedcomx gx = new Gx.Gedcomx() .SetAgent(janeDoe) .SetAgent(cemetery) .SetAgent(hanyuPinyin) .SetAttribution(researchAttribution) .SetSourceDescription(gravestoneDescription) .SetSourceDescription(gravestoneImageDescription) .SetDocument(transcription) .SetSourceDescription(transcriptionDescription) .SetDocument(translation) .SetSourceDescription(translationDescription) .SetPerson(aloiau) .SetPerson(father) .SetRelationship(fatherRelationship) .SetDocument(analysis) .SetPerson(aloiauConclusion); xmlSerializer.Deserialize<Gx.Gedcomx>(xmlSerializer.Serialize(gx)); jsonSerializer.Deserialize<Gx.Gedcomx>(jsonSerializer.Serialize(gx)); }
private Person CreateMartha(PlaceDescription birthPlace, PlaceDescription deathPlace) { Person person = new Person(); person.SetGender(new Gender(GenderType.Male)); Fact fact = new Fact(); fact.SetId("321"); fact.SetType(FactType.Birth); fact.SetDate(new DateInfo()); fact.Date.SetOriginal("June 2, 1731"); fact.Date.SetFormal("+1731-06-02"); fact.SetPlace(new PlaceReference()); fact.Place.SetOriginal(birthPlace.Names[0].Value.ToLower()); fact.Place.DescriptionRef = "#" + birthPlace.Id; person.AddFact(fact); fact = new Fact(); fact.SetId("654"); fact.SetType(FactType.Death); fact.SetDate(new DateInfo()); fact.Date.SetOriginal("May 22, 1802"); fact.Date.SetFormal("+1802-05-22"); fact.SetPlace(new PlaceReference()); fact.Place.SetOriginal(deathPlace.Names[0].Value.ToLower()); fact.Place.DescriptionRef = "#" + deathPlace.Id; person.AddFact(fact); List<Name> names = new List<Name>(); Name name = new Name(); NameForm nameForm = new NameForm(); nameForm.SetFullText("Martha Dandridge Custis"); List<NamePart> parts = new List<NamePart>(); NamePart part = new NamePart(); part.SetType(NamePartType.Given); part.SetValue("Martha Dandridge"); parts.Add(part); part = new NamePart(); part.SetType(NamePartType.Surname); part.SetValue("Custis"); parts.Add(part); nameForm.Parts = parts; name.SetNameForm(nameForm); name.SetId("987"); names.Add(name); person.Names = names; person.SetId("CCC-CCCC"); return person; }
/// <summary> /// Visits the fact. /// </summary> /// <param name="fact">The fact to visit.</param> public virtual void VisitFact(Fact fact) { this.contextStack.Push(fact); VisitConclusion(fact); if (fact.Date != null) { VisitDate(fact.Date); } if (fact.Place != null) { VisitPlaceReference(fact.Place); } if (fact.Fields != null) { foreach (Field field in fact.Fields) { VisitField(field); } } this.contextStack.Pop(); }
/// <summary> /// Add a fact conclusion. /// </summary> /// <param name="fact">The fact conclusion to be added.</param> public void AddFact(Fact fact) { if (fact != null) { if (Facts == null) { Facts = new List<Fact>(); } Facts.Add(fact); } }
/** * Build out this relationship with a fact. * @param fact The fact. * @return this */ public Relationship SetFact(Fact fact) { AddFact(fact); return this; }
/** * Build out this person with a fact. * * @param fact The fact. * @return this. */ public Person SetFact(Fact fact) { AddFact(fact); return this; }
public override void VisitFact(Fact fact) { BindIfNeeded(fact); base.VisitFact(fact); }
public void TestExample() { //Jane Doe, the researcher. Agent janeDoe = (Agent)new Agent().SetName("Jane Doe").SetEmail("*****@*****.**").SetId("A-1"); //Lin Yee Chung Cemetery Agent fhl = (Agent)new Agent().SetName("Family History Library").SetAddress(new Address().SetCity("Salt Lake City").SetStateOrProvince("Utah")).SetId("A-2"); //The attribution for this research. Attribution researchAttribution = new Attribution().SetContributor(janeDoe).SetModified(DateTime.Parse("2014-04-25")); //The parish register. SourceDescription recordDescription = (SourceDescription)new SourceDescription() .SetTitle("Marriage entry for Samuel Ham and Elizabeth Spiller, Parish Register, Wilton, Somerset, England") .SetDescription("Marriage entry for Samuel Ham and Elizabeth in a copy of the registers of the baptisms, marriages, and burials at the church of St. George in the parish of Wilton : adjoining Taunton, in the county of Somerset from A.D. 1558 to A.D. 1837.") .SetCitation(new SourceCitation().SetValue("Joseph Houghton Spencer, transcriber, Church of England, Parish Church of Wilton (Somerset). <cite>A copy of the registers of the baptisms, marriages, and burials at the church of St. George in the parish of Wilton : adjoining Taunton, in the county of Somerset from A.D. 1558 to A.D. 1837</cite>; Marriage entry for Samuel Ham and Elizabeth Spiller (3 November 1828), (Taunton: Barnicott, 1890), p. 224, No. 86.")) .SetResourceType(ResourceType.PhysicalArtifact) .SetRepository(fhl) .SetId("S-1"); //The transcription of the grave stone. Document transcription = (Document)new Document() .SetType(DocumentType.Transcription) .SetText("Samuel Ham of the parish of Honiton and Elizabeth Spiller\n" + "were married this 3rd day of November 1828 by David Smith\n" + "Stone, Pl Curate,\n" + "In the Presence of\n" + "Jno Pain.\n" + "R.G. Halls. Peggy Hammet.\n" + "No. 86.") .SetSource(recordDescription) .SetLang("en") .SetId("D-1"); //The transcription described as a source. SourceDescription transcriptionDescription = (SourceDescription)new SourceDescription() .SetAbout("#" + transcription.Id) .SetTitle("Transcription of marriage entry for Samuel Ham and Elizabeth Spiller, Parish Register, Wilton, Somerset, England") .SetDescription("Transcription of marriage entry for Samuel Ham and Elizabeth in a copy of the registers of the baptisms, marriages, and burials at the church of St. George in the parish of Wilton : adjoining Taunton, in the county of Somerset from A.D. 1558 to A.D. 1837.") .SetCitation(new SourceCitation().SetValue("Joseph Houghton Spencer, transcriber, Church of England, Parish Church of Wilton (Somerset). <cite>A copy of the registers of the baptisms, marriages, and burials at the church of St. George in the parish of Wilton : adjoining Taunton, in the county of Somerset from A.D. 1558 to A.D. 1837</cite>; Marriage entry for Samuel Ham and Elizabeth Spiller (3 November 1828), (Taunton: Barnicott, 1890), p. 224, No. 86.")) .SetResourceType(ResourceType.DigitalArtifact) .SetSource(new SourceReference().SetDescription(recordDescription)) .SetId("S-2"); //the marriage fact. Fact marriage = new Fact() .SetType(FactType.Marriage) .SetDate(new DateInfo().SetOriginal("3 November 1828").SetFormal("+1828-11-03")) .SetPlace(new PlaceReference().SetOriginal("Wilton St George, Wilton, Somerset, England")); //the groom's residence. Fact samsResidence = new Fact() .SetType(FactType.Residence) .SetDate(new DateInfo().SetOriginal("3 November 1828").SetFormal("+1828-11-03")) .SetPlace(new PlaceReference().SetOriginal("parish of Honiton, Devon, England")); //the groom's residence. Fact lizsResidence = new Fact() .SetType(FactType.Residence) .SetDate(new DateInfo().SetOriginal("3 November 1828").SetFormal("+1828-11-03")) .SetPlace(new PlaceReference().SetOriginal("parish of Wilton, Somerset, England")); //the groom Person sam = (Person)new Person().SetName("Samuel Ham").SetGender(GenderType.Male).SetFact(samsResidence).SetExtracted(true).SetSource(transcriptionDescription).SetId("P-1"); //the bride. Person liz = (Person)new Person().SetName("Elizabeth Spiller").SetGender(GenderType.Female).SetFact(lizsResidence).SetExtracted(true).SetSource(transcriptionDescription).SetId("P-2"); //witnesses Person witness1 = (Person)new Person().SetName("Jno. Pain").SetExtracted(true).SetSource(transcriptionDescription).SetId("P-3"); Person witness2 = (Person)new Person().SetName("R.G. Halls").SetExtracted(true).SetSource(transcriptionDescription).SetId("P-4"); Person witness3 = (Person)new Person().SetName("Peggy Hammet").SetExtracted(true).SetSource(transcriptionDescription).SetId("P-5"); //officiator Person officiator = (Person)new Person().SetName("David Smith Stone").SetExtracted(true).SetSource(transcriptionDescription).SetId("P-6"); //the relationship. Relationship marriageRelationship = (Relationship)new Relationship().SetType(RelationshipType.Couple).SetPerson1(sam).SetPerson2(liz).SetFact(marriage).SetExtracted(true); //the marriage event Event marriageEvent = (Event)new Event(EventType.Marriage) .SetDate(new DateInfo().SetOriginal("3 November 1828").SetFormal("+1828-11-03")) .SetPlace(new PlaceReference().SetOriginal("Wilton St George, Wilton, Somerset, England")) .SetRole(new EventRole().SetPerson(sam).SetType(EventRoleType.Principal)) .SetRole(new EventRole().SetPerson(liz).SetType(EventRoleType.Principal)) .SetRole(new EventRole().SetPerson(witness1).SetType(EventRoleType.Witness)) .SetRole(new EventRole().SetPerson(witness2).SetType(EventRoleType.Witness)) .SetRole(new EventRole().SetPerson(witness3).SetType(EventRoleType.Witness)) .SetRole(new EventRole().SetPerson(officiator).SetType(EventRoleType.Official)) .SetExtracted(true) .SetId("E-1"); //Jane Doe's analysis. Document analysis = (Document)new Document().SetText("...Jane Doe's analysis document...").SetId("D-2"); //Jane Doe's conclusions about a person. Person samConclusion = (Person)new Person().SetEvidence(sam).SetAnalysis(analysis).SetId("C-1"); Gx.Gedcomx gx = new Gx.Gedcomx() .SetAgent(janeDoe) .SetAgent(fhl) .SetAttribution(researchAttribution) .SetSourceDescription(recordDescription) .SetDocument(transcription) .SetSourceDescription(transcriptionDescription) .SetPerson(sam) .SetPerson(liz) .SetPerson(witness1) .SetPerson(witness2) .SetPerson(witness3) .SetPerson(officiator) .SetRelationship(marriageRelationship) .SetEvent(marriageEvent) .SetDocument(analysis) .SetPerson(samConclusion); xmlSerializer.Deserialize<Gx.Gedcomx>(xmlSerializer.Serialize(gx)); jsonSerializer.Deserialize<Gx.Gedcomx>(jsonSerializer.Serialize(gx)); }
private Person CreateGeorge(PlaceDescription birthPlace, PlaceDescription deathPlace) { Person person = new Person(); person.SetGender(new Gender(GenderType.Male)); Fact fact = new Fact(); fact.SetId("123"); fact.SetType(FactType.Birth); fact.SetDate(new DateInfo()); fact.Date.SetOriginal("February 22, 1732"); fact.Date.SetFormal("+1732-02-22"); fact.SetPlace(new PlaceReference()); fact.Place.SetOriginal(birthPlace.Names[0].Value.ToLower()); fact.Place.DescriptionRef = "#" + birthPlace.Id; person.AddFact(fact); fact = new Fact(); fact.SetId("456"); fact.SetType(FactType.Death); fact.SetDate(new DateInfo()); fact.Date.SetOriginal("December 14, 1799"); fact.Date.SetFormal("+1799-12-14T22:00:00"); fact.SetPlace(new PlaceReference()); fact.Place.SetOriginal(deathPlace.Names[0].Value.ToLower()); fact.Place.DescriptionRef = "#" + deathPlace.Id; person.AddFact(fact); List<Name> names = new List<Name>(); Name name = new Name(); NameForm nameForm = new NameForm(); nameForm.SetFullText("George Washington"); List<NamePart> parts = new List<NamePart>(); NamePart part = new NamePart(); part.SetType(NamePartType.Given); part.SetValue("George"); parts.Add(part); part = new NamePart(); part.SetType(NamePartType.Surname); part.SetValue("Washington"); parts.Add(part); nameForm.Parts = parts; name.SetNameForm(nameForm); name.SetId("789"); names.Add(name); person.Names = names; person.SetId("BBB-BBBB"); return person; }
private Relationship CreateMarriage(Person george, Person martha) { Relationship relationship = new Relationship(); relationship.SetId("DDD-DDDD"); relationship.SetPerson1(new ResourceReference("#" + george.Id)); relationship.SetPerson2(new ResourceReference("#" + martha.Id)); Fact marriage = new Fact(); marriage.SetDate(new DateInfo()); marriage.Date.SetOriginal("January 6, 1759"); marriage.Date.SetFormal("+01-06-1759"); marriage.SetPlace(new PlaceReference()); marriage.Place.SetOriginal("White House Plantation"); relationship.SetFact(marriage); return relationship; }
/** * Add a fact conclusion for the mother. * * @param fact The fact conclusion to be added. */ public void AddMotherFact(Fact fact) { if (fact != null) { if (_motherFacts == null) { _motherFacts = new List<Fact>(); } _motherFacts.Add(fact); } }
/** * Build out this person with a fact. * * @param fact The fact. * @return this. */ public Person SetFact(Fact fact) { AddFact(fact); return(this); }
public virtual void VisitFact(Fact fact) { this.contextStack.Push(fact); VisitConclusion(fact); DateInfo date = fact.Date; if (date != null) { date.Accept(this); } PlaceReference place = fact.Place; if (place != null) { place.Accept(this); } List<Field> fields = fact.Fields; if (fields != null) { foreach (Field field in fields) { field.Accept(this); } } this.contextStack.Pop(); }
/** * Build out this relationship with a fact. * @param fact The fact. * @return this */ public Relationship SetFact(Fact fact) { AddFact(fact); return(this); }