Esempio n. 1
0
        protected internal override void Embed(ExtensibleData conclusion)
        {
            var value = (Conclusion)conclusion;

            this._lang        = this._lang == null ? value._lang : this._lang;
            this._confidence  = this._confidence == null ? value._confidence : this._confidence;
            this._attribution = this._attribution == null ? value._attribution : this._attribution;
            this._analysis    = this._analysis == null ? value._analysis : this._analysis;
            if (value._notes != null)
            {
                this._notes = this._notes == null ? new List <Note>() : this._notes;
                this._notes.AddRange(value._notes);
            }
            if (value._sources != null)
            {
                this._sources = this._sources == null ? new List <SourceReference>() : this._sources;
                this._sources.AddRange(value._sources);
            }
            base.Embed(conclusion);
        }
 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));
 }
Esempio n. 3
0
 /**
  * Build this out with an attribution.
  * @param attribution The attribution.
  * @return this.
  */
 public Gedcomx SetAttribution(Attribution attribution)
 {
     Attribution = attribution;
     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));
        }
 /**
  * Build up this discussion reference with attribution.
  *
  * @param attribution The attribution.
  * @return this.
  */
 public DiscussionReference SetAttribution(Attribution attribution)
 {
     Attribution = attribution;
     return this;
 }
Esempio n. 6
0
 /**
  * Build out this collection with attribution.
  * @param attribution The attribution.
  * @return this.
  */
 public Collection SetAttribution(Attribution attribution)
 {
     Attribution = attribution;
     return this;
 }
Esempio n. 7
0
 /**
  * Build up this note with attribution.
  *
  * @param attribution The attribution.
  * @return this.
  */
 public Note SetAttribution(Attribution attribution)
 {
     this.Attribution = attribution;
     return(this);
 }
 /**
  * Build up this source reference with attribution.
  *
  * @param attribution The attribution.
  * @return this.
  */
 public SourceReference SetAttribution(Attribution attribution)
 {
     Attribution = attribution;
     return this;
 }
Esempio n. 9
0
 /**
  * Build up this conclusion with attribution.
  *
  * @param attribution The attribution.
  * @return this.
  */
 public Conclusion SetAttribution(Attribution attribution)
 {
     SetAttribution(attribution);
     return this;
 }
Esempio n. 10
0
 protected internal override void Embed(ExtensibleData conclusion)
 {
     var value = (Conclusion)conclusion;
     this._lang = this._lang == null ? value._lang : this._lang;
     this._confidence = this._confidence == null ? value._confidence : this._confidence;
     this._attribution = this._attribution == null ? value._attribution : this._attribution;
     this._analysis = this._analysis == null ? value._analysis : this._analysis;
     if (value._notes != null)
     {
         this._notes = this._notes == null ? new List<Note>() : this._notes;
         this._notes.AddRange(value._notes);
     }
     if (value._sources != null)
     {
         this._sources = this._sources == null ? new List<SourceReference>() : this._sources;
         this._sources.AddRange(value._sources);
     }
     base.Embed(conclusion);
 }
Esempio n. 11
0
 /**
  * Build up this note with attribution.
  *
  * @param attribution The attribution.
  * @return this.
  */
 public Note SetAttribution(Attribution attribution)
 {
     this.Attribution = attribution;
     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 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));
        }
Esempio n. 13
0
 /**
  * Build up this evidence reference with an attribution.
  *
  * @param attribution The attribution.
  * @return this.
  */
 public EvidenceReference SetAttribution(Attribution attribution)
 {
     this.Attribution = attribution;
     return(this);
 }
 /**
  * Build out this source description with attribution.
  * @param attribution The attribution.
  * @return this.
  */
 public SourceDescription SetAttribution(Attribution attribution)
 {
     Attribution = attribution;
     return this;
 }
Esempio n. 15
0
 /**
  * Build up this discussion reference with attribution.
  *
  * @param attribution The attribution.
  * @return this.
  */
 public DiscussionReference SetAttribution(Attribution attribution)
 {
     Attribution = attribution;
     return(this);
 }
 /**
  * Build up this evidence reference with an attribution.
  *
  * @param attribution The attribution.
  * @return this.
  */
 public EvidenceReference SetAttribution(Attribution attribution)
 {
     this.Attribution = attribution;
     return this;
 }
Esempio n. 17
0
 /**
  * Build out this collection with attribution.
  * @param attribution The attribution.
  * @return this.
  */
 public Collection SetAttribution(Attribution attribution)
 {
     Attribution = attribution;
     return(this);
 }