Skip to content

Instantly share code, notes, and snippets.

@rdmpage
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdmpage/2d31c81a14291bd9d6ad to your computer and use it in GitHub Desktop.
Save rdmpage/2d31c81a14291bd9d6ad to your computer and use it in GitHub Desktop.
Linking taxa by synonyms

Test whether two taxa are same using synonyms

This experiment takes two taxa for the same lizard (Geckonia chazaliae or Tarentola chazaliae) and runs a query to discover that these taxa are duplicates. In other words, GBIF has the same lizard twice in its classification.

63550 88 88
CREATE (gbif2445625:taxon { name:'Geckonia chazaliae' }),(ion614045:name { name: 'Geckonia chazaliae' }),(gbif2445625)-[:HASNAME]->(ion614045),(gbif5843252:taxon { name:'Tarentola chazaliae' }),(ion1748852:name { name: 'Tarentola chazaliae' }),(gbif5843252)-[:HASNAME]->(ion1748852),(ion614045)-[:PROTONYM]->(ion614045),(ion1748852)-[:PROTONYM]->(ion614045)

Graph linking two taxa and their names

Names are linked to protonyms (=basionyms), if name is protonym it is linked to itself. Publications are linked, where known.

Find taxa with same protonym

If there are more than one taxa we have a problem.

MATCH (taxon)-[:HASNAME]-(name)-[:PROTONYM]->(protonym)
RETURN taxon, name, protonym

Count number of taxa with same protonym

If there are more than one taxa we have a problem.

MATCH (taxon)-[:HASNAME]-(name)-[:PROTONYM]->(protonym)
RETURN count(taxon)

Oops, these two "taxa" are the same thing, the two different names are objective synonyms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment