FamilySearch / gedcom5-java

Gedcom parsers
Apache License 2.0
68 stars 41 forks source link

Parsing individual title #11

Closed michelesalvador closed 5 years ago

michelesalvador commented 5 years ago

Take a GEDCOM with this individual:

0 @I1@ INDI
1 NAME Victoria /Hanover/
1 TITL Queen of England

ModelParser.handleTitl(Object) puts the TITL record within names adding the user-defined _type key:

{
  "id": "I1",
  "names": [
    {
      "value": "Victoria /Hanover/"
    },
    {
      "_type": "TITL",
      "value": "Queen of England"
    }
  ]
}

This is strange, because in GEDCOM 5.5 specifications TITL is a standard attribute of INDI (like for example OCCU or PROP):

INDIVIDUAL:=
n  <<NAME_STRUCTURE>>       {1:M}
n  TITL <INDI_TITLE>        {0:M}
n  ...

And also in GEDCOM 5.5.1 TITL is located among other standard attributes:

INDIVIDUAL_ATTRIBUTE_STRUCTURE:=
  [
  n ...
  |
  n TITL <NOBILITY_TYPE_TITLE>      {1:1}
    +1 <<INDIVIDUAL_EVENT_DETAIL>>  {0:1}
  ]

Wouldn't be more correct to parse the TITL record as a simple EventFact? Like this:

{
  "id": "I1",
  "names": [
    {
      "value": "Victoria /Hanover/"
    }
  ]
  "eventsFacts": [
    {
      "tag": "TITL",
      "value": "Queen of England"
    }
  ]
}
stoicflame commented 5 years ago

Fair enough. I'm happy to merge a pull request.