Solr ontology data not always DAG, some pairs of terms have each other ...

... as parents.

Skip terms already seen when computing longest path.

From ticket
https://github.com/WormBase/website/issues/3270