public void reset() { _query = new QueryImpl(_reasoner.getKB(), false); }
public void reset() { _query = new QueryImpl(_reasoner.getKB(), false); }
public void reset() { _query = new QueryImpl(_reasoner.getKB(), false); }
/** * {@inheritDoc} */ @Override public Query reorder(final int[] ordering) { if (ordering.length != _allAtoms.size()) throw new InternalReasonerException("Ordering permutation must be of the same size as the query : " + ordering.length); final QueryImpl newQuery = new QueryImpl(this); // shallow copies for faster processing for (final int element : ordering) newQuery._allAtoms.add(_allAtoms.get(element)); newQuery._allVars = _allVars; newQuery._distVars = _distVars; newQuery._individualsAndLiterals = _individualsAndLiterals; newQuery._resultVars = _resultVars; newQuery._ground = _ground; return newQuery; }
/** * {@inheritDoc} */ @Override public Query reorder(final int[] ordering) { if (ordering.length != _allAtoms.size()) throw new InternalReasonerException("Ordering permutation must be of the same size as the query : " + ordering.length); final QueryImpl newQuery = new QueryImpl(this); // shallow copies for faster processing for (final int element : ordering) newQuery._allAtoms.add(_allAtoms.get(element)); newQuery._allVars = _allVars; newQuery._distVars = _distVars; newQuery._individualsAndLiterals = _individualsAndLiterals; newQuery._resultVars = _resultVars; newQuery._ground = _ground; return newQuery; }
/** * {@inheritDoc} */ @Override public Query reorder(final int[] ordering) { if (ordering.length != _allAtoms.size()) throw new InternalReasonerException("Ordering permutation must be of the same size as the query : " + ordering.length); final QueryImpl newQuery = new QueryImpl(this); // shallow copies for faster processing for (final int element : ordering) newQuery._allAtoms.add(_allAtoms.get(element)); newQuery._allVars = _allVars; newQuery._distVars = _distVars; newQuery._individualsAndLiterals = _individualsAndLiterals; newQuery._resultVars = _resultVars; newQuery._ground = _ground; return newQuery; }
private Query query(final QueryAtom... atoms) { final Query q = new QueryImpl(_kb, true); for (final QueryAtom atom : atoms) q.add(atom); return q; }
/** * {@inheritDoc} */ @Override public Query apply(final ResultBinding binding) { final List<QueryAtom> atoms = new ArrayList<>(); for (final QueryAtom atom : getAtoms()) atoms.add(atom.apply(binding)); final QueryImpl query = new QueryImpl(this); query._resultVars.addAll(_resultVars); query._resultVars.removeAll(binding.getAllVariables()); for (final VarType type : VarType.values()) for (final ATermAppl atom : getDistVarsForType(type)) if (!binding.isBound(atom)) query.addDistVar(atom, type); for (final QueryAtom atom : atoms) query.add(atom); return query; }
/** * {@inheritDoc} */ @Override public Query apply(final ResultBinding binding) { final List<QueryAtom> atoms = new ArrayList<>(); for (final QueryAtom atom : getAtoms()) atoms.add(atom.apply(binding)); final QueryImpl query = new QueryImpl(this); query._resultVars.addAll(_resultVars); query._resultVars.removeAll(binding.getAllVariables()); for (final VarType type : VarType.values()) for (final ATermAppl atom : getDistVarsForType(type)) if (!binding.isBound(atom)) query.addDistVar(atom, type); for (final QueryAtom atom : atoms) query.add(atom); return query; }
/** * {@inheritDoc} */ @Override public Query apply(final ResultBinding binding) { final List<QueryAtom> atoms = new ArrayList<>(); for (final QueryAtom atom : getAtoms()) atoms.add(atom.apply(binding)); final QueryImpl query = new QueryImpl(this); query._resultVars.addAll(_resultVars); query._resultVars.removeAll(binding.getAllVariables()); for (final VarType type : VarType.values()) for (final ATermAppl atom : getDistVarsForType(type)) if (!binding.isBound(atom)) query.addDistVar(atom, type); for (final QueryAtom atom : atoms) query.add(atom); return query; }
public CoreNewImpl(final Collection<QueryAtom> atoms, final Collection<ATermAppl> uv, final KnowledgeBase kb) _query = new QueryImpl(kb, false);
public CoreNewImpl(final Collection<QueryAtom> atoms, final Collection<ATermAppl> uv, final KnowledgeBase kb) _query = new QueryImpl(kb, false);
public CoreNewImpl(final Collection<QueryAtom> atoms, final Collection<ATermAppl> uv, final KnowledgeBase kb) _query = new QueryImpl(kb, false);
protected Query query(final ATermAppl[] vars, final QueryAtom[] atoms) { final Query q = new QueryImpl(_kb, true); for (final ATermAppl var : vars) q.addResultVar(var); for (final QueryAtom atom : atoms) q.add(atom); for (final ATermAppl var : q.getUndistVars()) q.addDistVar(var, VarType.INDIVIDUAL); return q; }