There are a bunch of libraries that will do this - here's one example of a python one: https://github.com/yuce/pyswip - and a ruby one: https://github.com/preston/ruby-prolog
pl.consult("some-facts.pl")
pl.assertz("new(fact)")
while pl.Query(...).nextSolution():
print( X.value )
...will definitely keep it in my back pocket!https://pypi.org/project/janus-swi/
https://www.swi-prolog.org/pldoc/man?section=janus-call-prol...