public IQ convertDatalogRule(CQIE datalogRule, Collection<Predicate> tablePredicates,
                                 Optional<ImmutableQueryModifiers> optionalModifiers, IntermediateQueryFactory iqFactory)
            throws DatalogProgram2QueryConverterImpl.InvalidDatalogProgramException {

        TargetAtom targetAtom = datalogConversionTools.convertFromDatalogDataAtom(datalogRule.getHead());

        DistinctVariableOnlyDataAtom projectionAtom = targetAtom.getProjectionAtom();

        ConstructionNode topConstructionNode = iqFactory.createConstructionNode(projectionAtom.getVariables(),
                targetAtom.getSubstitution());

        List<Function> bodyAtoms = List.iterableList(datalogRule.getBody());
        if (bodyAtoms.isEmpty()) {
            return createFact(topConstructionNode, optionalModifiers, projectionAtom, iqFactory);
        }
        else {
            return createDefinition(topConstructionNode, optionalModifiers, projectionAtom, tablePredicates,
                    bodyAtoms, iqFactory);
        }
    }
public IQ convertDatalogRule ( CQIE datalogRule , Collection < Predicate > tablePredicates , Optional < ImmutableQueryModifiers > optionalModifiers , IntermediateQueryFactory iqFactory ) throws DatalogProgram2QueryConverterImpl . InvalidDatalogProgramException { TargetAtom targetAtom = datalogConversionTools . convertFromDatalogDataAtom ( datalogRule . getHead ( ) ) ; DistinctVariableOnlyDataAtom projectionAtom = targetAtom . getProjectionAtom ( ) ; ConstructionNode topConstructionNode = iqFactory . createConstructionNode ( projectionAtom . getVariables ( ) , targetAtom . getSubstitution ( ) ) ; List < Function > bodyAtoms = List . iterableList ( datalogRule . getBody ( ) ) ; if ( bodyAtoms . isEmpty ( ) ) { return createFact ( topConstructionNode , optionalModifiers , projectionAtom , iqFactory ) ; } else { return createDefinition ( topConstructionNode , optionalModifiers , projectionAtom , tablePredicates , bodyAtoms , iqFactory ) ; } }
TODO: describe