protected CQIEImpl(Function head, Function[] body) { // The syntax for CQ may contain no body, thus, this condition will // check whether the construction of the link list is possible or not. if (body != null) { this.body = new EventGeneratingLinkedList<>(body); registerListeners(this.body); // TODO possible memory leak!!! we should also de-register when objects are removed } setHead(head); }
@Override public OrderCondition newVariable(Variable newVariable) { return new OrderConditionImpl(newVariable, direction); } }
@Override public void appendRule(Collection<CQIE> rules) { for (CQIE rule : rules) { appendRule(rule); } }
protected AtomClassification(List<Function> atoms, DatalogTools datalogTools) throws DatalogProgram2QueryConverterImpl.InvalidDatalogProgramException { dataAndCompositeAtoms = datalogTools.filterDataAndCompositeAtoms(atoms); List<Function> otherAtoms = datalogTools.filterNonDataAndCompositeAtoms(atoms); booleanAtoms = datalogTools.filterBooleanAtoms(otherAtoms); if (dataAndCompositeAtoms.isEmpty()) throw new DatalogProgram2QueryConverterImpl.InvalidDatalogProgramException("No data or composite atom in " + atoms); /* * May throw a NotSupportedConversionException */ checkNonDataOrCompositeAtomSupport(otherAtoms, booleanAtoms); }
@Override public Boolean f(Function atom) { return isDataOrLeftJoinOrJoinAtom(atom); } };
public static Function constructNewFunction(List<Function> subAtoms, Predicate functionSymbol) { List<Term> subTerms = (List<Term>)(List<?>) subAtoms; return constructNewFunction(functionSymbol, subTerms); }
@Override public DatalogProgram getDatalogProgram(MutableQueryModifiers modifiers) { DatalogProgram p = new DatalogProgramImpl(modifiers); return p; }
@Override public CQIE getCQIE(Function head, List<Function> body) { return new CQIEImpl(head, body); }
@Override public AtomPredicate getDummyPredicate(int suffix) { return new DatalogAtomPredicate("dummy" + suffix, 0, typeFactory); }
protected AtomClassification(List<Function> atoms) throws DatalogProgram2QueryConverterImpl.InvalidDatalogProgramException { dataAndCompositeAtoms = DatalogTools.filterDataAndCompositeAtoms(atoms); List<Function> otherAtoms = DatalogTools.filterNonDataAndCompositeAtoms(atoms); booleanAtoms = DatalogTools.filterBooleanAtoms(otherAtoms); if (dataAndCompositeAtoms.isEmpty()) throw new DatalogProgram2QueryConverterImpl.InvalidDatalogProgramException("No data or composite atom in " + atoms); optionalGroupAtom = extractOptionalGroupAtom(otherAtoms); /* * May throw a NotSupportedConversionException */ checkNonDataOrCompositeAtomSupport(otherAtoms, booleanAtoms, optionalGroupAtom); }
protected CQIEImpl(Function head, List<Function> body) { // The syntax for CQ may contain no body, thus, this condition will // check whether the construction of the link list is possible or not. if (body != null) { this.body = new EventGeneratingLinkedList<>(body); registerListeners(this.body); // TODO possible memory leak!!! we should also de-register when objects are removed } setHead(head); }
@Override public Boolean f(Function atom) { return !isDataOrLeftJoinOrJoinAtom(atom); } };
@Override public void appendRule(Collection<CQIE> rules) { for (CQIE rule : rules) { appendRule(rule); } }
@Override public DatalogProgram getDatalogProgram() { return new DatalogProgramImpl(); }
@Override public CQIE getCQIE(Function head, Function... body) { return new CQIEImpl(head, body); }
@Override public AtomPredicate getSubqueryPredicate(String suffix, int arity) { return new DatalogAtomPredicate(SUBQUERY_PRED_PREFIX + suffix, arity, typeFactory); }
@Override public Boolean f(Function atom) { return isDataOrLeftJoinOrJoinAtom(atom); } });