Package org.gedcomx.conclusion

Examples of org.gedcomx.conclusion.Fact


    assertEquals(person2.getResource().toString(), CommonMapper.getPersonReference(person2Id));

    if (factCount > 0) {
      assertNotNull(relationship.getFacts());
      assertEquals(relationship.getFacts().size(), factCount);
      Fact fact0 = relationship.getFacts().get(0);
      if (relationshipType.equals(RelationshipType.Couple)) {
        assertEquals(fact0.getKnownType(), FactType.Marriage);
        assertNotNull(fact0.getDate());
        assertNotNull(fact0.getPlace());
      }
    } else {
      assertNull(relationship.getFacts());
    }
View Full Code Here


    assertEquals(result.getRelationships().size(), 3);
    for (Relationship gedxRelationship : result.getRelationships()) {
      if (gedxRelationship.getKnownType() == RelationshipType.Couple) {
        assertNotNull(gedxRelationship.getFacts());
        assertEquals(gedxRelationship.getFacts().size(), 1);
        Fact gedxFact = gedxRelationship.getFacts().get(0);
        assertNotNull(gedxFact);
        assertNotNull(gedxFact.getSources());
        assertEquals(gedxFact.getSources().size(), 1);
        SourceReference gedxSourceReference = gedxFact.getSources().get(0);
        assertNotNull(gedxSourceReference);
        assertNotNull(gedxSourceReference.getDescriptionRef());
        assertTrue(gedxSourceReference.getDescriptionRef().toString().startsWith("#"));
        generatedId = gedxSourceReference.getDescriptionRef().toString().substring(1);
        assertNotNull(generatedId, "1");
View Full Code Here

    assertEquals(result.getRelationships().size(), 3);
    for (Relationship gedxRelationship : result.getRelationships()) {
      if (gedxRelationship.getKnownType() == RelationshipType.Couple) {
        assertNotNull(gedxRelationship.getFacts());
        assertEquals(gedxRelationship.getFacts().size(), 1);
        Fact gedxFact = gedxRelationship.getFacts().get(0);
        assertNotNull(gedxFact);
        assertNotNull(gedxFact.getSources());
        assertEquals(gedxFact.getSources().size(), 1);
        SourceReference gedxSourceReference = gedxFact.getSources().get(0);
        assertNotNull(gedxSourceReference);
        assertNotNull(gedxSourceReference.getDescriptionRef());
        assertTrue(gedxSourceReference.getDescriptionRef().toString().startsWith("#"));
        generatedId = gedxSourceReference.getDescriptionRef().toString().substring(1);
        assertEquals(generatedId, "SOUR-2");
View Full Code Here

    assertEquals(result.getPersons().size(), 1);

    Person gedxPerson = result.getPersons().get(0);
    assertNotNull(gedxPerson.getFacts());
    assertEquals(gedxPerson.getFacts().size(), 1);
    Fact gedxFact = gedxPerson.getFacts().get(0);
    assertNotNull(gedxFact);
    assertNotNull(gedxFact.getSources());
    assertEquals(gedxFact.getSources().size(), 1);
    SourceReference gedxSourceReference = gedxFact.getSources().get(0);
    assertNotNull(gedxSourceReference);
    assertNotNull(gedxSourceReference.getDescriptionRef());
    assertTrue(gedxSourceReference.getDescriptionRef().toString().startsWith("#"));
    generatedId = gedxSourceReference.getDescriptionRef().toString().substring(1);
    assertNotNull(generatedId, "3");
View Full Code Here

    assertEquals(result.getPersons().size(), 1);

    Person gedxPerson = result.getPersons().get(0);
    assertNotNull(gedxPerson.getFacts());
    assertEquals(gedxPerson.getFacts().size(), 1);
    Fact gedxFact = gedxPerson.getFacts().get(0);
    assertNotNull(gedxFact);
    assertNotNull(gedxFact.getSources());
    assertEquals(gedxFact.getSources().size(), 1);
    SourceReference gedxSourceReference = gedxFact.getSources().get(0);
    assertNotNull(gedxSourceReference);
    assertNotNull(gedxSourceReference.getDescriptionRef());
    assertTrue(gedxSourceReference.getDescriptionRef().toString().startsWith("#"));
    generatedId = gedxSourceReference.getDescriptionRef().toString().substring(1);
    assertNotNull(generatedId, "4");
View Full Code Here

    assertEquals(result.getPersons().size(), 1);

    Person gedxPerson = result.getPersons().get(0);
    assertNotNull(gedxPerson.getFacts());
    assertEquals(gedxPerson.getFacts().size(), 1);
    Fact gedxFact = gedxPerson.getFacts().get(0);
    assertNotNull(gedxFact);
    assertNull(gedxFact.getSources());
// TODO: will probably be needed when the TEXT tag starts being processed
//    assertEquals(gedxFact.getSources().size(), 1);
//    SourceReference gedxSourceReference = gedxFact.getSources().get(0);
//    assertNotNull(gedxSourceReference);
//    assertNotNull(gedxSourceReference.getSourceDescription());
View Full Code Here

    for (EventFact eventFact : dqFamily.getEventsFacts()) {
      Marker factContext = ConversionContext.getDetachedMarker(eventFact.getTag() + '.' + (++index));
      ConversionContext.addReference(factContext);

      if (coupleRelationship != null) {
        Fact fact = FactMapper.toFact(eventFact, result);
        coupleRelationship.addFact(fact);
      } else {
        logger.warn(ConversionContext.getContext(), "The GEDCOM X converter only supports the {} fact in the presence of a couple relationship.", eventFact.getTag());
      }
View Full Code Here

      if (ref.getRef().equals(ged5FamilyId)) {
        String relationshipType = ref.getRelationshipType();
        if (relationshipType != null) {
          relationshipType = relationshipType.toLowerCase().trim();
          if (relationshipType.equalsIgnoreCase("adopted")) {
            Fact fact = new Fact();
            fact.setKnownType(FactType.AdoptiveParent);
            gedxRelationship.addFact(fact);
          } else if (relationshipType.equalsIgnoreCase("birth")) {
            Fact fact = new Fact();
            fact.setKnownType(FactType.BiologicalParent);
            gedxRelationship.addFact(fact);
          } else if (relationshipType.equalsIgnoreCase("foster")) {
            Fact fact = new Fact();
            fact.setKnownType(FactType.FosterParent);
            gedxRelationship.addFact(fact);
          } else {
            logger.warn(ConversionContext.getContext(), "Information designating this relationship as \"{}\" was dropped.", ref.getRelationshipType());
          }
        }
View Full Code Here

          if(factDate.equals("")) {
            factDate = null;
          }
        }

        Fact gedxFact = new Fact();
        gedxFact.setKnownType(factType);

        if(factDate != null) {
          Date date = new Date();
          date.setOriginal(factDate);
          gedxFact.setDate(date);
        }

        if(factPlace != null) {
          PlaceReference place = new PlaceReference();
          place.setOriginal(factPlace);
          gedxFact.setPlace(place);
        }

        if(factValue != null) {
          gedxFact.setValue(factValue);
        }

        // add source references to the fact
        gedxFact.setSources(CommonMapper.toSourcesAndSourceReferences(dqFact.getSourceCitations(), result));

        if (dqFact.getCause() != null) {
          logger.warn(ConversionContext.getContext(), "CAUS was ignored.");
        }
View Full Code Here

    int index = 0;
    for(EventFact fact : facts) {
      Marker factContext = ConversionContext.getDetachedMarker(fact.getTag() + '.' + (++index));
      ConversionContext.addReference(factContext);
      try {
        Fact gedxFact = FactMapper.toFact(fact, result);

        if(gedxFact == null) {
          fact.getType();
          if(fact.getTag() != null && fact.getTag().equalsIgnoreCase("SEX")) {
            processSex(gedxPerson, fact);
View Full Code Here

TOP

Related Classes of org.gedcomx.conclusion.Fact

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.