Repository navigation
Allow for middle names and initials when matching a Person - #186
Merged
Merged
Conversation
…ence_match="normalized" With existence_match="normalized", a Person that has no ORCID match is now looked for by name allowing for middle names that appear in only one of the given names, and for initials in place of names, so "James Maxwell" and "J. Clerk Maxwell" both find an existing "James Clerk Maxwell". The first given names must correspond, so "Clerk Maxwell" does not. Family names must still be equivalent, ignoring case, accents and whitespace. If several people match, one whose given names match exactly (ignoring case) is preferred, then one whose given names are equivalent. As before, the stored names are adopted, so saving does not remove a stored middle name. The matching is done in Person's override of _find_matching_instances() and _adopt_matched_values(), in builder/additional_methods, with new helpers split_given_names(), given_names_compatible() and build_given_name_regex() in fairgraph.utility.name_matching.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently,
existence_match="normalized"(#185) matches aPersonby name only when the given and family names are the same apart from case, accents and whitespace. A person is often recorded with and without a middle name or initial, or with an initial in place of a first name, so saving "James Maxwell" or "J. Clerk Maxwell" when "James Clerk Maxwell" is already in the KG creates a duplicate.With this PR, when no node with the same ORCID is found, a
Personis looked for by name allowing for:The first given names must correspond, so "J. Clerk Maxwell" does not match "Clerk Maxwell", and middle names present in both must agree ("James C." does not match "James K."). Family names must still be equivalent, as now.
If several people match, one whose given names match exactly (ignoring case) is preferred, then one whose given names differ only in case, accents or whitespace; otherwise the usual "not specific enough" error is raised unless
ignore_duplicates=True. As with the existing normalized matching, the names stored in the KG are adopted, so saving never removes a stored middle name.All the Person-specific logic is in the
builder/additional_methods/Person.py.txtoverlay, using the_find_matching_instances()override point added in #185;KGObjectis unchanged. The default,existence_match="equals", is unaffected.