@prefix math: . @prefix rdfs: . @prefix rdf: . @prefix rpo: . @prefix : . :Ann a :Patient. (:Ann :GastroEntritis) rpo:mu 0.8. (:Ann :GastricUlcer) rpo:mu 0.006. (:Ann :PostSurgery) rpo:mu 0. :aspirin :prescribedFor :GastroEntritis. :aspirin :excludedFor (:GastricUlcer :PostSurgery). :excludedFor rdfs:range rdf:List. {?MED :prescribedFor ?D. ?MED :excludedFor ?L. ?WHO :fineWith ?L. (?WHO ?D) rpo:mu ?N. ?N math:greaterThan 0.7} => {?WHO :isPrescribed ?MED}. {?WHO a :Patient} => {?WHO :fineWith rdf:nil}. {?L rdf:first ?D; a rdf:List. (?WHO ?D) rpo:mu ?N. ?N math:lessThan 0.01. ?L rdf:rest ?R. ?WHO :fineWith ?R} => {?WHO :fineWith ?L}. {?L rdf:rest ?R; a rdf:List} => {?R a rdf:List}.