knowsys / rulewerk

Java library based on the VLog rule engine
Apache License 2.0
32 stars 13 forks source link

[core] unneeded Exception from ExamplesUtils.printOutQueryAnswers #197

Closed alloka closed 3 years ago

alloka commented 3 years ago

ExamplesUtils.printOutQueryAnswers produces a RulewerkException with description: Relative IRIs cannot be serialized when a base is declared.

the example has the following rule file: doctor.txt

and the following facts files: physician.txt treatment.txt

to reproduce the error: add the facts and the rule to the knowledgebase, then call reason. Afterward, call ExamplesUtils.printOutQueryAnswers on the rule head but replacing the existential with a universal, the exception will appear.

Another weird behavior is that if you call reasoner.writeinferences and then call ExamplesUtils.printOutQueryAnswers it works!

java file:

SimpleReasoningExample.txt