Using a list in pytholog

91 Views Asked by At

I'm trying to define a knowledge base where a disease has a list of symptoms. Here's a snippet:

import pytholog as pl
diseases_kb = pl.KnowledgeBase()
diseases_kb([
     "disease(diabetes, [frequent_urination, extreme_thirst])",
     "disease(pneumonia, [cough, fever, shortness_of_breath])",
])

However, when I query this:

print(diseases_kb.query(pl.Expr("disease(diabetes, Symptoms)")))

it just returns ['No'].

It looks like, lists are not being recognized by pytholog. I tried using (), list(), whatever syntax that I hope would work but nothing works. The library removes '(' and ')', and splits the queries by ',' which I think is the reason why it's not recognizing lists. Is there a workaround for this?

0

There are 0 best solutions below