gbif-api icon indicating copy to clipboard operation
gbif-api copied to clipboard

Name Parser Incorrectly Splits Authorship at Commas

Open arhyneRWU opened this issue 1 year ago • 1 comments

When parsing scientific names that include a comma within the authorship, the GBIF name parser incorrectly splits the authorship and fails to parse the name properly.

  1. Fails:

Query: https://api.gbif.org/v1/parser/name?name=Vulpes+vulpes+leucopus+(Linnaeus,1758)

JSON Response:

[
  {
    "scientificName": "Vulpes vulpes leucopus (Linnaeus",
    "type": "SCIENTIFIC",
    "genusOrAbove": "Vulpes",
    "specificEpithet": "vulpes",
    "infraSpecificEpithet": "leucopus",
    "parsed": true,
    "parsedPartially": true,
    "canonicalName": "Vulpes vulpes leucopus",
    "canonicalNameWithMarker": "Vulpes vulpes leucopus",
    "canonicalNameComplete": "Vulpes vulpes leucopus",
    "rankMarker": "infrasp."
  },
  {
    "scientificName": "1758)",
    "type": "NO_NAME",
    "parsed": false,
    "parsedPartially": false
  }
]

Issue: The parser splits the authorship at the comma, resulting in incomplete parsing. The year and closing parenthesis are treated as a separate, unparsed entry.

  1. Passes:

Query: https://api.gbif.org/v1/parser/name?name=Vulpes+vulpes+leucopus+(Linnaeus%201758)

JSON Response:

[
  {
    "scientificName": "Vulpes vulpes leucopus (Linnaeus 1758)",
    "type": "SCIENTIFIC",
    "genusOrAbove": "Vulpes",
    "specificEpithet": "vulpes",
    "infraSpecificEpithet": "leucopus",
    "bracketAuthorship": "Linnaeus",
    "bracketYear": "1758",
    "parsed": true,
    "parsedPartially": false,
    "canonicalName": "Vulpes vulpes leucopus",
    "canonicalNameWithMarker": "Vulpes vulpes leucopus",
    "canonicalNameComplete": "Vulpes vulpes leucopus (Linnaeus, 1758)",
    "rankMarker": "infrasp."
  }
]

Note: When the comma is omitted, the parser correctly parses the entire scientific name, including the authorship and year.

arhyneRWU avatar Oct 30 '24 14:10 arhyneRWU

indeed sth odd. The latest version of the parser is exposed in ChecklistBank btw which I would recommend to use instead:

https://api.checklistbank.org/parser/name?q=Vulpes+vulpes+leucopus+(Linnaeus,1758)

mdoering avatar Oct 30 '24 14:10 mdoering