Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,14 @@
)
public enum FamilySearchFactType implements ControlledVocabulary {

// //////////////////////////////////////////////////////////////////////////////////////////////////////////
// FamilySearch facts generally applicable within the scope of a person.

/**
* Person fact type: Affiliation to something.
*/
Affiliation,

/**
* Parent Child fact type: A child's birth order to parents.
*/
BirthOrder,

/**
* Couple fact type: Couple never had children.
*/
CoupleNeverHadChildren,

/**
* Person fact type: Person died before age eight.
*/
Expand All @@ -55,11 +48,6 @@ public enum FamilySearchFactType implements ControlledVocabulary {
*/
LifeSketch,

/**
* Couple fact type: Couple lived together.
*/
LivedTogether,

/**
* Person fact type: Person had no children.
*/
Expand All @@ -80,6 +68,74 @@ public enum FamilySearchFactType implements ControlledVocabulary {
*/
TribeName,

// //////////////////////////////////////////////////////////////////////////////////////////////////////////
// FamilySearch facts generally applicable within the scope of a couple.

/**
* Couple fact type: Couple never had children.
*/
CoupleNeverHadChildren,

/**
* Couple fact type: Couple lived together.
*/
LivedTogether,


// //////////////////////////////////////////////////////////////////////////////////////////////////////////
// FamilySearch facts generally applicable within the scope of a parent-child relationship.

/**
* Parent Child fact type: A child's birth order to parents.
*/
BirthOrder,


// //////////////////////////////////////////////////////////////////////////////////////////////////////////
// FamilySearch facts generally applicable within the scope of an association.
// Apprenticeship, // exists as a core Gedcomx FactType http://gedcomx.org/Apprenticeship
/**
* A fact of a person's association.
*/
Association,
/**
* A fact of a person's emancipation.
*/
Emancipation,
/**
* A fact of a person's employment relationship.
*/
Employment,
/**
* A fact of a person's enslavement.
*/
Enslavement,
/**
* A fact of a person's friendship.
*/
Friendship, // may be Friend when sevice does actual work
/**
* A fact about the generational relationship between persons.
*/
Generation,
/**
* A fact about the godparenthood relationship between persons.
*/
Godparenthood,
/**
* A fact about a household relationship between persons.
*/
Household,
/**
* A fact about a neighborhood relationship between persons.
*/
Neighborhood,
/**
* A fact about a relative relationship between persons.
*/
Relative,


@XmlUnknownQNameEnumValue
OTHER;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ public void testIt() {
testType("http://familysearch.org/v1/TitleOfNobility", FamilySearchFactType.TitleOfNobility);
testType("http://familysearch.org/v1/TribeName", FamilySearchFactType.TribeName);

// association fact types
//testType("http://familysearch.org/v1/Apprenticeship", FamilySearchFactType.Apprenticeship); // exists as a core Gedcomx FactType
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One issue here is for TF the Apprenticeship fact type is in the familysearch namespace
But it is in core Gedcomx and I believe that will use http://gedcomx.org/Apprenticeship

testType("http://familysearch.org/v1/Association", FamilySearchFactType.Association);
testType("http://familysearch.org/v1/Emancipation", FamilySearchFactType.Emancipation);
testType("http://familysearch.org/v1/Employment", FamilySearchFactType.Employment);
testType("http://familysearch.org/v1/Enslavement", FamilySearchFactType.Enslavement);
testType("http://familysearch.org/v1/Friendship", FamilySearchFactType.Friendship);
testType("http://familysearch.org/v1/Generation", FamilySearchFactType.Generation);
testType("http://familysearch.org/v1/Godparenthood", FamilySearchFactType.Godparenthood);
testType("http://familysearch.org/v1/Household", FamilySearchFactType.Household);
testType("http://familysearch.org/v1/Neighborhood", FamilySearchFactType.Neighborhood);
testType("http://familysearch.org/v1/Relative", FamilySearchFactType.Relative);

// make sure all are tested
for (FamilySearchFactType type : FamilySearchFactType.values()) {
if ((!typesTested.contains(type)) && (!FamilySearchFactType.OTHER.equals(type))) {
Expand Down
16 changes: 9 additions & 7 deletions gedcomx-model/src/main/java/org/gedcomx/types/FactType.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
)
public enum FactType implements ControlledVocabulary {

// //////////////////////////////////////////////////////////////////////////////////////////////////////////
// facts generally applicable within the scope of a person.

/**
Expand All @@ -59,7 +60,6 @@ public enum FactType implements ControlledVocabulary {
/**
* A fact of a person's apprenticeship.
*/
@Facet ( GedcomxConstants.FACET_FS_FT_UNSUPPORTED )
Apprenticeship,

/**
Expand Down Expand Up @@ -355,7 +355,7 @@ public enum FactType implements ControlledVocabulary {
Obituary,

/**
* A fact of a person's occupation or employment.
* A fact of a person's occupation.
*/
Occupation,

Expand Down Expand Up @@ -443,6 +443,7 @@ public enum FactType implements ControlledVocabulary {
*/
Yahrzeit,

// //////////////////////////////////////////////////////////////////////////////////////////////////////////
// facts generally applicable within the scope of a couple.

/**
Expand Down Expand Up @@ -525,6 +526,7 @@ public enum FactType implements ControlledVocabulary {
@Facet ( GedcomxConstants.FACET_FS_FT_UNSUPPORTED )
Separation,

// //////////////////////////////////////////////////////////////////////////////////////////////////////////
// facts generally applicable within the scope of a parent-child relationship.

/**
Expand Down Expand Up @@ -626,7 +628,7 @@ private static FactType include(FactType type) {
PERSON_FACT_TYPES.add(type);
return type;
}

public static final FactType Adoption = include(FactType.Adoption);
public static final FactType AdultChristening = include(FactType.AdultChristening);
public static final FactType Amnesty = include(FactType.Amnesty);
Expand Down Expand Up @@ -701,7 +703,7 @@ private static FactType include(FactType type) {

/**
* Whether the given fact type is applicable to a person.
*
*
* @param type The fact type.
* @return Whether the given fact type is applicable to a person.
*/
Expand All @@ -719,7 +721,7 @@ private static FactType include(FactType type) {
COUPLE_FACT_TYPES.add(type);
return type;
}

public static final FactType Annulment = include(FactType.Annulment);
public static final FactType CommonLawMarriage = include(FactType.CommonLawMarriage);
public static final FactType CivilUnion = include(FactType.CivilUnion);
Expand All @@ -737,7 +739,7 @@ private static FactType include(FactType type) {

/**
* Whether the given fact type is applicable to a couple.
*
*
* @param type The fact type.
* @return Whether the given fact type is applicable to a couple.
*/
Expand Down Expand Up @@ -766,7 +768,7 @@ private static FactType include(FactType type) {

/**
* Whether the given fact type is applicable to a parent-child relationship.
*
*
* @param type The fact type.
* @return Whether the given fact type is applicable to a parent-child relationship.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*/
package org.gedcomx.types;

import java.util.Collections;
import java.util.EnumSet;
import java.util.Set;

import com.webcohesion.enunciate.metadata.qname.XmlQNameEnum;
import com.webcohesion.enunciate.metadata.qname.XmlUnknownQNameEnumValue;
import org.gedcomx.common.URI;
Expand All @@ -31,13 +35,29 @@
public enum RelationshipType implements ControlledVocabulary {

AncestorDescendant,
Apprentice,
Associate,
Couple,
Employer,
EnslavedBy,
Friend,
Godparent,
HeadOfHousehold,
HonoredAncestor,
Neighbor,
ParentChild,
Relative,
@XmlUnknownQNameEnumValue
OTHER;

public final static Set<RelationshipType> ASSOCIATION_RELATIONSHIP_TYPES = Collections.unmodifiableSet(EnumSet.of(AncestorDescendant, Apprentice, Associate,
Employer, EnslavedBy, Friend, Godparent,
HeadOfHousehold, HonoredAncestor, Neighbor,
Relative));
public boolean isAssociationRelationshipType() {
return ASSOCIATION_RELATIONSHIP_TYPES.contains(this);
}

private static final EnumURIMap<RelationshipType> URI_MAP = new EnumURIMap<RelationshipType>(RelationshipType.class, GedcomxConstants.GEDCOMX_TYPES_NAMESPACE);

/**
Expand All @@ -59,4 +79,4 @@ public static RelationshipType fromQNameURI(URI qname) {
return URI_MAP.fromURIValue(qname);
}

}
}