I am able to select the size of s3 and it is giving me the correct answer in rule 1. However, I want to select all the elements in s3. I tried Rule 2 but it is giving me the exception "error running SQWRL queries: error running Drools rule engine"
My goal is to retrieve all the diseases that have either symptom vomiting OR fever. Any help will be highly appreciated.
Rule 1:
Symptom(fever) ^ Symptom(vomiting) ^ Disease(?x) ^ Disease(?y) ^ has_symptom(?x, fever) ^ has_symptom(?y, vomiting)˚sqwrl:makeSet(?s1, ?x) ^ sqwrl:makeSet(?s2, ?y)˚sqwrl:union(?s3, ?s1, ?s2) ^ sqwrl:size(?n, ?s3) -> sqwrl:select(?n)
Rule 2:
Symptom(fever) ^ Symptom(vomiting) ^ Disease(?x) ^ Disease(?y) ^ has_symptom(?x, fever) ^ has_symptom(?y, vomiting)˚sqwrl:makeSet(?s1, ?x) ^ sqwrl:makeSet(?s2, ?y)˚sqwrl:union(?s3, ?s1, ?s2) -> sqwrl:select(?s3)