SWRLVariable varX = df.getSWRLVariable(IRI("http://www.owlapi#x"));
SWRLVariable varY = df.getSWRLVariable(IRI("http://www.owlapi#y"));
SWRLVariable varZ = df.getSWRLVariable(IRI("http://www.owlapi#z"));
Set<SWRLAtom> body = new HashSet<>();
body.add(df.getSWRLClassAtom(Class(iri("A")), varX));
SWRLIndividualArgument indIArg = df
.getSWRLIndividualArgument(NamedIndividual(iri("i")));
SWRLIndividualArgument indJArg = df
.getSWRLIndividualArgument(NamedIndividual(iri("j")));
body.add(df.getSWRLClassAtom(Class(iri("D")), indIArg));
body.add(df.getSWRLClassAtom(Class(iri("B")), varX));
SWRLVariable varQ = df.getSWRLVariable(IRI("http://www.owlapi#q"));
SWRLVariable varR = df.getSWRLVariable(IRI("http://www.owlapi#r"));