private IQTree convertDataOrCompositeAtom(final Function atom,
                                              Collection<Predicate> tablePredicates,
                                              IntermediateQueryFactory iqFactory)
            throws IntermediateQueryBuilderException, DatalogProgram2QueryConverterImpl.InvalidDatalogProgramException {
        /*
         * If the atom is composite, extracts sub atoms
         */
        if (atom.isAlgebraFunction()) {
            List<Function> subAtoms = List.iterableList(
                    (java.util.List<Function>)(java.util.List<?>)atom.getTerms());

            Predicate atomPredicate = atom.getFunctionSymbol();
            if (atomPredicate.equals(datalogFactory.getSparqlJoinPredicate())) {
                return convertAtoms(subAtoms, tablePredicates, iqFactory);
            }
            else if(atomPredicate.equals(datalogFactory.getSparqlLeftJoinPredicate())) {
                return convertLeftJoinAtom(subAtoms, tablePredicates, iqFactory);
            }
            else {
                throw new DatalogProgram2QueryConverterImpl.InvalidDatalogProgramException("Unsupported predicate: " + atomPredicate);
            }
        }
        /*
         * Data atom: creates a DataNode and adds it to the tree
         */
        else if (atom.isDataFunction()) {

            /*
             * Creates the node
             */
            TargetAtom targetAtom = datalogConversionTools.convertFromDatalogDataAtom(atom);
            ImmutableSubstitution<ImmutableTerm> bindings = targetAtom.getSubstitution();
            DataAtom dataAtom = bindings.applyToDataAtom(targetAtom.getProjectionAtom());
            return datalogConversionTools.createDataNode(iqFactory, dataAtom, tablePredicates);
        }
        else {
            throw new DatalogProgram2QueryConverterImpl.InvalidDatalogProgramException("Unsupported non-data atom: " + atom);
        }
    }
private IQTree convertDataOrCompositeAtom ( final Function atom , Collection < Predicate > tablePredicates , IntermediateQueryFactory iqFactory ) throws IntermediateQueryBuilderException , DatalogProgram2QueryConverterImpl . InvalidDatalogProgramException { if ( atom . isAlgebraFunction ( ) ) { List < Function > subAtoms = List . iterableList ( ( java . util . List < Function > ) ( java . util . List < ? > ) atom . getTerms ( ) ) ; Predicate atomPredicate = atom . getFunctionSymbol ( ) ; if ( atomPredicate . equals ( datalogFactory . getSparqlJoinPredicate ( ) ) ) { return convertAtoms ( subAtoms , tablePredicates , iqFactory ) ; } else if ( atomPredicate . equals ( datalogFactory . getSparqlLeftJoinPredicate ( ) ) ) { return convertLeftJoinAtom ( subAtoms , tablePredicates , iqFactory ) ; } else { throw new DatalogProgram2QueryConverterImpl . InvalidDatalogProgramException ( "Unsupported predicate: " + atomPredicate ) ; } } else if ( atom . isDataFunction ( ) ) { TargetAtom targetAtom = datalogConversionTools . convertFromDatalogDataAtom ( atom ) ; ImmutableSubstitution < ImmutableTerm > bindings = targetAtom . getSubstitution ( ) ; DataAtom dataAtom = bindings . applyToDataAtom ( targetAtom . getProjectionAtom ( ) ) ; return datalogConversionTools . createDataNode ( iqFactory , dataAtom , tablePredicates ) ; } else { throw new DatalogProgram2QueryConverterImpl . InvalidDatalogProgramException ( "Unsupported non-data atom: " + atom ) ; } }
TODO: describe