This is a mysql and postgresql store procedure and trigger implementation of closure table in RDBMS about hierarchy data model.
Why do you think that https://github.com/neo4j-contrib/neo4j-apoc-procedures is a good alternative to hierarchy-data-closure-table