@Override public List<ATermAppl> getArguments() { return _atom.getArguments(); }
@Override public List<ATermAppl> getArguments() { return _atom.getArguments(); }
@Override public List<ATermAppl> getArguments() { return _atom.getArguments(); }
public NotKnownQueryAtom(final List<QueryAtom> atoms) { this._atoms = Collections.unmodifiableList(atoms); _isGround = true; _args = new ArrayList<>(); for (final QueryAtom atom : atoms) { _args.addAll(atom.getArguments()); if (_isGround && !atom.isGround()) _isGround = false; } }
public NotKnownQueryAtom(final List<QueryAtom> atoms) { this._atoms = Collections.unmodifiableList(atoms); _isGround = true; _args = new ArrayList<>(); for (final QueryAtom atom : atoms) { _args.addAll(atom.getArguments()); if (_isGround && !atom.isGround()) _isGround = false; } }
public NotKnownQueryAtom(final List<QueryAtom> atoms) { this._atoms = Collections.unmodifiableList(atoms); _isGround = true; _args = new ArrayList<>(); for (final QueryAtom atom : atoms) { _args.addAll(atom.getArguments()); if (_isGround && !atom.isGround()) _isGround = false; } }
public UnionQueryAtom(final List<List<QueryAtom>> union) { if (union.isEmpty()) throw new IllegalArgumentException("Empty collection of atoms not allowed in NotKnown atom"); this._union = Collections.unmodifiableList(union); _isGround = true; _args = new ArrayList<>(); for (final List<QueryAtom> atoms : union) for (final QueryAtom atom : atoms) { _args.addAll(atom.getArguments()); if (_isGround && !atom.isGround()) _isGround = false; } }
public UnionQueryAtom(final List<List<QueryAtom>> union) { if (union.isEmpty()) throw new IllegalArgumentException("Empty collection of atoms not allowed in NotKnown atom"); this._union = Collections.unmodifiableList(union); _isGround = true; _args = new ArrayList<>(); for (final List<QueryAtom> atoms : union) for (final QueryAtom atom : atoms) { _args.addAll(atom.getArguments()); if (_isGround && !atom.isGround()) _isGround = false; } }
public UnionQueryAtom(final List<List<QueryAtom>> union) { if (union.isEmpty()) throw new IllegalArgumentException("Empty collection of atoms not allowed in NotKnown atom"); this._union = Collections.unmodifiableList(union); _isGround = true; _args = new ArrayList<>(); for (final List<QueryAtom> atoms : union) for (final QueryAtom atom : atoms) { _args.addAll(atom.getArguments()); if (_isGround && !atom.isGround()) _isGround = false; } }
private List<QueryAtom> _findAtoms(final Collection<ATermAppl> stopList, final QueryPredicate predicate, final ATermAppl... args) { final List<QueryAtom> list = new ArrayList<>(); for (final QueryAtom atom : _allAtoms) if (predicate.equals(atom.getPredicate())) { int i = 0; boolean add = true; for (final ATermAppl arg : atom.getArguments()) { final ATermAppl argValue = args[i++]; if (argValue != null && argValue != arg || stopList.contains(arg)) { add = false; break; } } if (add) list.add(atom); } return list; }
/** * {@inheritDoc} */ @Override public void add(final QueryAtom atom) { if (_allAtoms.contains(atom)) return; _allAtoms.add(atom); for (final ATermAppl a : atom.getArguments()) if (ATermUtils.isVar(a)) { if (!_allVars.contains(a)) _allVars.add(a); } else if (ATermUtils.isLiteral(a) || _kb.isIndividual(a)) if (!_individualsAndLiterals.contains(a)) _individualsAndLiterals.add(a); _ground = _ground && atom.isGround(); }
private void setupDownMonotonicVariables(final Query query) { for (final QueryAtom atom : query.getAtoms()) { ATermAppl arg; switch (atom.getPredicate()) { case PropertyValue: case Type: arg = atom.getArguments().get(1); if (ATermUtils.isVar(arg)) _downMonotonic.add(arg); break; default: arg = null; } } }
private void setupDownMonotonicVariables(final Query query) { for (final QueryAtom atom : query.getAtoms()) { ATermAppl arg; switch (atom.getPredicate()) { case PropertyValue: case Type: arg = atom.getArguments().get(1); if (ATermUtils.isVar(arg)) _downMonotonic.add(arg); break; default: arg = null; } } }
private void setupDownMonotonicVariables(final Query query) { for (final QueryAtom atom : query.getAtoms()) { ATermAppl arg; switch (atom.getPredicate()) { case PropertyValue: case Type: arg = atom.getArguments().get(1); if (ATermUtils.isVar(arg)) _downMonotonic.add(arg); break; default: arg = null; } } }
private ATermList getClasses(final ATermAppl a) { final List<ATermAppl> aterms = new ArrayList<>(); for (final QueryAtom atom : findAtoms(QueryPredicate.Type, a, null)) { final ATermAppl arg = atom.getArguments().get(1); if (ATermUtils.isVar(arg)) throw new InternalReasonerException("Variables as predicates are not supported yet"); aterms.add(arg); } if (!ATermUtils.isVar(a)) aterms.add(ATermUtils.makeValue(a)); return ATermUtils.makeList(aterms); }
private ATermList getClasses(final ATermAppl a) { final List<ATermAppl> aterms = new ArrayList<>(); for (final QueryAtom atom : findAtoms(QueryPredicate.Type, a, null)) { final ATermAppl arg = atom.getArguments().get(1); if (ATermUtils.isVar(arg)) throw new InternalReasonerException("Variables as predicates are not supported yet"); aterms.add(arg); } if (!ATermUtils.isVar(a)) aterms.add(ATermUtils.makeValue(a)); return ATermUtils.makeList(aterms); }
private ATermList getClasses(final ATermAppl a) { final List<ATermAppl> aterms = new ArrayList<>(); for (final QueryAtom atom : findAtoms(QueryPredicate.Type, a, null)) { final ATermAppl arg = atom.getArguments().get(1); if (ATermUtils.isVar(arg)) throw new InternalReasonerException("Variables as predicates are not supported yet"); aterms.add(arg); } if (!ATermUtils.isVar(a)) aterms.add(ATermUtils.makeValue(a)); return ATermUtils.makeList(aterms); }
public static void computeSizeEstimate(final Query query) { final SizeEstimate sizeEstimate = query.getKB().getSizeEstimate(); final Set<ATermAppl> concepts = new HashSet<>(); final Set<ATermAppl> properties = new HashSet<>(); for (final QueryAtom atom : query.getAtoms()) for (final ATermAppl argument : atom.getArguments()) if (!ATermUtils.isVar(argument)) { if ((query.getKB().isClass(argument) || ATermUtils.isComplexClass(argument)) && !sizeEstimate.isComputed(argument)) concepts.add(argument); if (query.getKB().isProperty(argument) && !sizeEstimate.isComputed(argument)) properties.add(argument); } sizeEstimate.compute(concepts, properties); } }
public static void computeSizeEstimate(final Query query) { final SizeEstimate sizeEstimate = query.getKB().getSizeEstimate(); final Set<ATermAppl> concepts = new HashSet<>(); final Set<ATermAppl> properties = new HashSet<>(); for (final QueryAtom atom : query.getAtoms()) for (final ATermAppl argument : atom.getArguments()) if (!ATermUtils.isVar(argument)) { if ((query.getKB().isClass(argument) || ATermUtils.isComplexClass(argument)) && !sizeEstimate.isComputed(argument)) concepts.add(argument); if (query.getKB().isProperty(argument) && !sizeEstimate.isComputed(argument)) properties.add(argument); } sizeEstimate.compute(concepts, properties); } }
public static void computeSizeEstimate(final Query query) { final SizeEstimate sizeEstimate = query.getKB().getSizeEstimate(); final Set<ATermAppl> concepts = new HashSet<>(); final Set<ATermAppl> properties = new HashSet<>(); for (final QueryAtom atom : query.getAtoms()) for (final ATermAppl argument : atom.getArguments()) if (!ATermUtils.isVar(argument)) { if ((query.getKB().isClass(argument) || ATermUtils.isComplexClass(argument)) && !sizeEstimate.isComputed(argument)) concepts.add(argument); if (query.getKB().isProperty(argument) && !sizeEstimate.isComputed(argument)) properties.add(argument); } sizeEstimate.compute(concepts, properties); } }