Copyright | (c) Callum Lowcay 2017 |
---|---|
License | BSD3 |
Maintainer | cwslowcay@gmail.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
- parseGedcomString :: Maybe String -> ByteString -> Either GDError (Gedcom, XRefTable)
- parseGedcomFile :: FilePath -> IO (Either GDError (Gedcom, XRefTable))
- data GDError
- gdLookup :: forall a. Typeable a => GDRef a -> XRefTable -> Either GDRefError a
- data GDRef a
- data XRefTable
- data GDRefError
- data GDXRefID
- data Gedcom = Gedcom {
- gedcomHeader :: Header
- gedcomFamily :: [GDRef Family]
- gedcomIndividual :: [GDRef Individual]
- gedcomMultimedia :: [GDRef Multimedia]
- gedcomNote :: [GDRef Note]
- gedcomRepository :: [GDRef Repository]
- gedcomSource :: [GDRef Source]
- gedcomSubmitter :: [GDRef Submitter]
- data Header = Header {
- headerSource :: HeaderSource
- headerDestination :: Maybe Text
- headerDate :: Maybe UTCTime
- headerSubmitter :: GDRef Submitter
- headerSubmission :: Maybe (GDRef Submission)
- headerFile :: Maybe FilePath
- headerCopyright :: Maybe Text
- headerGedcomFormat :: GedcomFormat
- headerCharset :: Charset
- headerLang :: Maybe Language
- headerPlaceForm :: Maybe [Text]
- headerNote :: Maybe Text
- data GedcomFormat = GedcomFormat {}
- data GedcomForm
- data HeaderSource = HeaderSource {}
- data Corp = Corp {
- corpName :: Text
- corpAddress :: Maybe Address
- data HeaderSourceData = HeaderSourceData {}
- data Family = Family {
- familyRestrictionNotice :: Maybe RestrictionNotice
- familyEvent :: [FamilyEvent]
- familyHusband :: Maybe (GDRef Individual)
- familyWife :: Maybe (GDRef Individual)
- familyChildren :: [GDRef Individual]
- familyTotalChildren :: Maybe Word
- familySubitter :: [GDRef Submitter]
- familyUserReference :: [UserReference]
- familyRIN :: Maybe RIN
- familyChangeDate :: Maybe ChangeDate
- familyNote :: [GDRef Note]
- familySourceCitation :: [SourceCitation]
- familyMultimedia :: [GDRef Multimedia]
- data Individual = Individual {
- individualRestrictionNotice :: Maybe RestrictionNotice
- individualName :: Maybe PersonalName
- individualSex :: Maybe Sex
- individualEvent :: [IndividualEvent]
- individualAttribute :: [IndividualAttribute]
- individualChildToFamilyLink :: [ChildToFamilyLink]
- individualSpouseToFamilyLink :: [SpouseToFamilyLink]
- individualSubmitter :: [GDRef Submitter]
- individualAssociation :: [Association]
- individualAlias :: [GDRef Individual]
- individualAncestorInterest :: [GDRef Submitter]
- individualDescendantInterest :: [GDRef Submitter]
- individualRFN :: Maybe RFN
- individualAFN :: Maybe AFN
- individualUserReference :: [UserReference]
- individualRIN :: Maybe RIN
- individualChangeDate :: Maybe ChangeDate
- individualNote :: [GDRef Note]
- individualSourceCitation :: [SourceCitation]
- individualMultimedia :: [GDRef Multimedia]
- data Multimedia = Multimedia {}
- data Note = Note {}
- data Repository = Repository {}
- data Source = Source {
- sourceData :: Maybe SourceData
- sourceAuthor :: Maybe Text
- sourceTitle :: Maybe Text
- sourceShortTitle :: Maybe Text
- sourcePublicationFacts :: Maybe Text
- sourceText :: Maybe Text
- sourceRepositoryCitations :: [RepositoryCitation]
- sourceUserReference :: [UserReference]
- sourceRIN :: Maybe RIN
- sourceChangeDate :: Maybe ChangeDate
- sourceNote :: [GDRef Note]
- sourceMultimedia :: [GDRef Multimedia]
- data Submission = Submission {
- submissionSubmitter :: Maybe (GDRef Submitter)
- submissionFamilyFile :: Maybe Text
- submissionTempleCode :: Maybe Text
- submissionAncestorGenerations :: Maybe Word
- submissionDescendentGenerations :: Maybe Word
- submissionOrdinanceProcessing :: Maybe Bool
- submissionRIN :: Maybe RIN
- submissionNote :: [GDRef Note]
- submissionChangeDate :: Maybe ChangeDate
- data Submitter = Submitter {}
- data SourceData = SourceData {}
- data SourceRecordedEvent = SourceRecordedEvent {}
- data Association = Association {}
- data ChildToFamilyLink = ChildToFamilyLink {}
- data SpouseToFamilyLink = SpouseToFamilyLink {}
- data EventDetail = EventDetail {
- eventDetailType :: Maybe Text
- eventDetailDate :: Maybe DateValue
- eventDetailPlace :: Maybe Place
- eventDetailAddress :: Maybe Address
- eventDetailAgency :: Maybe Text
- eventDetailReligion :: Maybe Text
- eventDetailCause :: Maybe Text
- eventDetailRestrictionNotice :: Maybe RestrictionNotice
- eventDetailNote :: [GDRef Note]
- eventDetailSourceCitation :: [SourceCitation]
- eventDetailMultimedia :: [GDRef Multimedia]
- data FamilyEventDetail = FamilyEventDetail {}
- data FamilyEvent = FamilyEvent {}
- data IndividualEventDetail = IndividualEventDetail {}
- data IndividualEvent = IndividualEvent {}
- data Place = Place {
- placeName :: [Text]
- placeForm :: Maybe [Text]
- placePhonetic :: Maybe PhoneticPlaceName
- placeRoman :: Maybe RomanPlaceName
- placeMap :: Maybe MapCoord
- placeNote :: [GDRef Note]
- data PersonalName = PersonalName {}
- data PhoneticName = PhoneticName {}
- data RomanizedName = RomanizedName {}
- data PersonalNamePieces = PersonalNamePieces {
- namePiecePrefix :: [Text]
- namePieceGiven :: [Text]
- namePieceNickname :: [Text]
- namePieceSurnamePrefix :: [Text]
- namePieceSurname :: [Text]
- namePieceSuffix :: [Text]
- namePieceNameNote :: [GDRef Note]
- namePirceSourceCitation :: [SourceCitation]
- data IndividualAttribute = IndividualAttribute IndividualAttributeType IndividualEventDetail
- data IndividualAttributeType
- data SourceCitation = SourceCitation {}
- data RepositoryCitation = RepositoryCitation {}
- data Address = Address {}
- data ContactDetails = ContactDetails {
- addressPhone :: [Text]
- addressEmail :: [Text]
- addressFax :: [Text]
- addressWWW :: [Text]
- data MultimediaFile = MultimediaFile {}
- data MultimediaFormat = MultimediaFormat MultimediaFileFormat (Maybe MultimediaType)
- data MultimediaFileFormat
- data MultimediaType
- data NameType
- data DateValue
- data DateApprox
- data DateRange
- data FamilyEventType
- data IndividualEventType
- = Birth (Maybe (GDRef Family))
- | Christening (Maybe (GDRef Family))
- | Death
- | Burial
- | Cremation
- | Adoption (Maybe AdoptionDetail)
- | Baptism
- | BarMitzvah
- | BasMitzvah
- | Blessing
- | ChristeningAdult
- | Confirmation
- | FirstCommunion
- | Ordination
- | Naturalization
- | Emigration
- | Immigration
- | IndvCensus
- | Probate
- | Will
- | Graduation
- | Retirement
- | IndividualEventType Text
- data EventType
- data AdoptionDetail = AdoptionDetail (GDRef Family) (Maybe Parent)
- data Calendar
- data CallNumber = CallNumber Text (Maybe MultimediaType)
- data ChangeDate = ChangeDate UTCTime (Maybe (GDRef Note))
- data Charset = Charset Text (Maybe Text)
- data ChildLinkStatus
- data Date = Date Calendar (Maybe Word) (Maybe Word) Year
- data DatePeriod
- data MapCoord = MapCoord Longitude Latitude
- data Name = Name Text (Maybe Text)
- data Parent
- = Husband
- | Wife
- | BothParents
- data Pedigree
- data PhoneticPlaceName = PhoneticPlaceName PhoneticType [Text]
- data PhoneticType
- = Kana
- | Hangul
- | PhoneticType Text
- data RestrictionNotice
- data RomanPlaceName = RomanPlaceName RomanType [Text]
- data RomanType
- data Sex
- = Male
- | Female
- | Undetermined
- data SourceDescription = SourceDescription Text [Text]
- data UserReference = UserReference Text (Maybe Text)
- newtype AFN = AFN Text
- newtype Language = Language Text
- newtype Latitude = Latitude Double
- newtype Longitude = Longitude Double
- newtype QualityAssessment = QualityAssessment Word
- newtype RFN = RFN Text
- newtype RIN = RIN Text
- newtype Year = Year Int
Functions
:: Maybe String | The filename from which the string was read |
-> ByteString | The string to parse |
-> Either GDError (Gedcom, XRefTable) | The Gedcom data and cross reference table, or an error |
Parse Gedcom data from a ByteString
:: FilePath | The file to read |
-> IO (Either GDError (Gedcom, XRefTable)) | The Gedcom data and cross reference table, or an error |
Parse Gedcom data from a file
A parse error.
LineFormatError Text | A badly formatted GEDCOM line |
UnexpectedRef Text | A reference where a reference wasn't allowed |
RequiredRef Text | Missing a reference where a reference was required |
DuplicateRef Text | Two targets for the same reference |
FormatError Text | A badly formatted field |
TagError Text | The wrong tag |
:: Typeable a | |
=> GDRef a | The reference to look up |
-> XRefTable | The table to look up in |
-> Either GDRefError a | The value or an error |
Lookup up a reference in the cross reference table
data GDRefError Source #
An error arising from dereferencing a GDRef
RefNotPresent GDXRefID | The referred structure doesn't exist. |
WrongRefType TypeRep TypeRep | Dereferenced structure had the wrong type |
A cross reference ID
Top level structures
The root structure
Gedcom | |
|
The header
data GedcomFormat Source #
The database format and version number
data GedcomForm Source #
The actual database format. Only the default LineageLinked is supported.
data HeaderSource Source #
Where the GEDCOM data is sourced from (e.g. the program that created the file)
Information about a corporation
Records
The family record
data Individual Source #
The individual record
The note record (for attaching notes to other records)
Note | |
|
data Repository Source #
The repository record. Represents a repository of sources (for example a collection of documents or a physical library)
The source record. A source of information that may be cited by other records.
data Submission Source #
The submission record. Information about this file.
The submitter record. Information about someone who submitted data to this database.
Submitter | |
|
Substructures
data SourceRecordedEvent Source #
Information about what events are recorded in a source.
data ChildToFamilyLink Source #
A link from an individual to a family record where they are registered as a child.
data SpouseToFamilyLink Source #
A link from an individual to a family record where they are registered as a spouse.
data EventDetail Source #
Details about an event.
data FamilyEvent Source #
An event concerning a family.
A physical place.
Place | |
|
data PhoneticName Source #
A phonetic transcription of a person's name.
data PersonalNamePieces Source #
Parts of a person's name.
PersonalNamePieces | |
|
data IndividualAttribute Source #
Extra information about an individual.
data IndividualAttributeType Source #
Classification of extra information about an individual.
Caste Text | Caste. |
PhysicalDescription Text | Physical description of the individual. |
Education Text | Scholastic achievement. |
NationalID Text | National id number. |
NationalOrigin Text | National or tribal origin. |
NChildren Word | Number of children. |
NMarriages Word | Number of marriages. |
Occupation Text | Occupation. |
Possessions Text | Property the individual owned. |
Religion Text | Religious affiliation. |
ResidesAt | Place of residence. |
SocialSecurity Text | Social security number. |
Title Text | Title of nobility. |
Fact Text | None of the above. |
data SourceCitation Source #
Citation of source material.
SourceCitation | |
|
An address
data ContactDetails Source #
Contact details associated with an Address
ContactDetails | |
|
Values
data MultimediaFormat Source #
Information about a multimedia format.
data MultimediaFileFormat Source #
Supported multimedia file formats.
data MultimediaType Source #
The kind of multimedia (not necessarily a computer file).
MT_AUDIO | |
MT_BOOK | |
MT_CARD | |
MT_ELECTRONIC | |
MT_FICHE | |
MT_FILM | |
MT_MAGAZINE | |
MT_MANUSCRIPT | |
MT_MAP | |
MT_NEWSPAPER | |
MT_PHOTO | |
MT_TOMBSTONE | |
MT_VIDEO | |
MT_OTHER Text | Any other kind of multimedia. |
Name types.
Dates, including date ranges and approximate dates.
DateV Date | |
DateApproxV DateApprox | |
DatePeriodV DatePeriod | |
DateRangeV DateRange | |
DatePhrase (Maybe Date) Text | A date in a format that doesn't fit the other categories. May include an interpretation in the optional |
data DateApprox Source #
A date that is only approximately known.
A range of dates.
data FamilyEventType Source #
Recognised types of events concerning families.
Annuled | |
FamCensus | |
Divorce | |
DivorceFiled | |
Engagement | |
MarriageBann | |
MarriageContract | |
Marriage | |
MarriageLicense | |
MarriageSettlement | |
Residence | |
FamilyEventType Text | Any other kind of event. |
data IndividualEventType Source #
Recognised types of events concerning individuals.
Recognised event types.
Census | Family of individual census. |
FamilyEventTypeV FamilyEventType | A family event |
IndividualEventTypeV IndividualEventType | An individual event |
EventType Text | Some other kind of event. |
data AdoptionDetail Source #
Information about an adoption, including the family the subject was adopted into and which parent(s) adopted the child.
data CallNumber Source #
A call number for citations
A character set and optional version (the version is unused so far as I am aware)
data ChildLinkStatus Source #
Metadata about a child link
A date. The format is day / month / year and months are numbered 1 to 12 (or 1 to 13 for certain calendars).
data DatePeriod Source #
A range of dates
A global location in longitude and latitude.
A personal name. The first field is the full name of the individual. The second field contains just the surname of the individual (or Nothing if unspecified)
How a child is associated with his/her family.
data PhoneticPlaceName Source #
A phonetic transcription of a place name.
data PhoneticType Source #
The type of phonetic transcription.
Kana | Japanese kana |
Hangul | Korean hanguel |
PhoneticType Text | Something else |
data RestrictionNotice Source #
Privacy restrictions associated with a record.
data RomanPlaceName Source #
A Roman transliteration of a place name.
The type of Roman transliteration.
data SourceDescription Source #
Description of a source. The first field contains a description of the source. The second field contains sections of text from the source.
data UserReference Source #
Custom reference added by the creator of this file. The format of this reference is not standardized.
Part of the GEDCOM standard, but only for LDS use so far as I am aware.
newtype QualityAssessment Source #
Assessment of the quality of a source. A number from 0 to 3 with 0 indicating unreliable information and 3 being direct primary evidence.
Part of the GEDCOM standard, but only for LDS use so far as I am aware.
Automated Record ID. From the GEDCOM standard:
"This number is intended to serve as a more sure means of identification of a record for reconciling differences in data between two interfacing systems."