brettkromkamp / topic-db

TopicDB is a topic maps-based semantic graph store (using SQLite for persistence)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix 'get_topics_network' method

brettkromkamp opened this issue · comments

Expected output:

elon-musk
         lyndon-rive
                 solar-city
                         solar-energy
         space-x
                 falcon-9
                 falcon-heavy
                 dragon
         tesla
                 model-s
                 model-x
                 model-y
                 roadster

Actual (erroneous) output:

elon-musk
         tesla
                 roadster
                         model-y
                                 model-x
                 model-s
                 space-x
                         dragon
                                 falcon-heavy
                         falcon-9
         lyndon-rive
                 solar-city
                         solar-energy

Order of the siblings is not necessarily relevant, but overall "shape" of the tree/graph is.

Method:

def get_topics_network(

Incorrect bug report: when calling get_topics_network with instance_ofs=['association'] output is as expected:

elon-musk
         lyndon-rive
                 solar-city
                         solar-energy
         tesla
                 model-y
                 roadster
                 model-s
                 model-x
         space-x
                 dragon
                 falcon-heavy
                 falcon-9