@Override public boolean matches(final RuleAtom atom) { return (atom instanceof ClassAtom) && atom.getPredicate().equals(_predicate) && argMatches((ClassAtom) atom); }
@Override public boolean matches(final RuleAtom atom) { return (atom instanceof ClassAtom) && atom.getPredicate().equals(_predicate) && argMatches((ClassAtom) atom); }
@Override public boolean equals(final Object other) { if (other != null && getClass().equals(other.getClass())) { final RuleAtom atom = (RuleAtom) other; return getPredicate().equals(atom.getPredicate()) && getAllArguments().equals(atom.getAllArguments()); } return false; }
@Override public boolean equals(final Object other) { if (other != null && getClass().equals(other.getClass())) { final RuleAtom atom = (RuleAtom) other; return getPredicate().equals(atom.getPredicate()) && getAllArguments().equals(atom.getAllArguments()); } return false; }
@Override @SuppressWarnings("rawtypes") public boolean matches(final RuleAtom atom) { return (atom instanceof IndividualPropertyAtom || atom instanceof DatavaluedPropertyAtom) && atom.getPredicate().equals(_role.getName()) && ((BinaryAtom) atom).getArgument1() instanceof AtomVariable && ((BinaryAtom) atom).getArgument2() instanceof AtomVariable; }
@Override @SuppressWarnings("rawtypes") public boolean matches(final RuleAtom atom) { return (atom instanceof IndividualPropertyAtom || atom instanceof DatavaluedPropertyAtom) && atom.getPredicate().equals(_role.getName()) && ((BinaryAtom) atom).getArgument1() instanceof AtomVariable && ((BinaryAtom) atom).getArgument2() instanceof AtomVariable; }
@Override public boolean matches(final RuleAtom atom) { return ((atom instanceof IndividualPropertyAtom) || (atom instanceof DatavaluedPropertyAtom)) && atom.getPredicate().equals(_role.getName()) && ((BinaryAtom<?, ?, ?>) atom).getArgument1() instanceof AtomVariable && ((BinaryAtom<?, ?, ?>) atom).getArgument2().equals(((BinaryAtom<?, ?, ?>) atom).getArgument1()); }
@Override public boolean matches(final RuleAtom atom) { return ((atom instanceof IndividualPropertyAtom) || (atom instanceof DatavaluedPropertyAtom)) && atom.getPredicate().equals(_role.getName()) && ((BinaryAtom<?, ?, ?>) atom).getArgument1() instanceof AtomVariable && ((BinaryAtom<?, ?, ?>) atom).getArgument2().equals(((BinaryAtom<?, ?, ?>) atom).getArgument1()); }
@Override @SuppressWarnings("rawtypes") public boolean matches(final RuleAtom atom) { return ((atom instanceof IndividualPropertyAtom) || (atom instanceof DatavaluedPropertyAtom)) && atom.getPredicate().equals(_role.getName()) && ((BinaryAtom) atom).getArgument1() instanceof AtomVariable && ((BinaryAtom) atom).getArgument2() instanceof AtomIConstant && ((AtomIConstant) ((BinaryAtom) atom).getArgument2()).getValue().equals(_name); }
@Override @SuppressWarnings("rawtypes") public boolean matches(final RuleAtom atom) { return ((atom instanceof IndividualPropertyAtom) || (atom instanceof DatavaluedPropertyAtom)) && atom.getPredicate().equals(_role.getName()) && ((BinaryAtom) atom).getArgument1() instanceof AtomVariable && ((BinaryAtom) atom).getArgument2() instanceof AtomIConstant && ((AtomIConstant) ((BinaryAtom) atom).getArgument2()).getValue().equals(_name); }
@Override @SuppressWarnings("rawtypes") public boolean matches(final RuleAtom atom) { return ((atom instanceof IndividualPropertyAtom) || (atom instanceof DatavaluedPropertyAtom)) && atom.getPredicate().equals(_role.getName()) && ((BinaryAtom) atom).getArgument1() instanceof AtomIConstant && ((AtomIConstant) ((BinaryAtom) atom).getArgument1()).getValue().equals(_name) && ((BinaryAtom) atom).getArgument2() instanceof AtomVariable; }
@Override @SuppressWarnings("rawtypes") public boolean matches(final RuleAtom atom) { return ((atom instanceof IndividualPropertyAtom) || (atom instanceof DatavaluedPropertyAtom)) && atom.getPredicate().equals(_role.getName()) && ((BinaryAtom) atom).getArgument1() instanceof AtomIConstant && ((AtomIConstant) ((BinaryAtom) atom).getArgument1()).getValue().equals(_name) && ((BinaryAtom) atom).getArgument2() instanceof AtomVariable; }
@Override public boolean matches(final RuleAtom atom) { return ((atom instanceof IndividualPropertyAtom) || (atom instanceof DatavaluedPropertyAtom)) && atom.getPredicate().equals(_role.getName()) && ((BinaryAtom<?, ?, ?>) atom).getArgument1() instanceof AtomIConstant && ((AtomIConstant) ((BinaryAtom<?, ?, ?>) atom).getArgument1()).getValue().equals(_name) && ((BinaryAtom<?, ?, ?>) atom).getArgument2() instanceof AtomConstant && ((AtomConstant) ((BinaryAtom<?, ?, ?>) atom).getArgument2()).getValue().equals(_objectName); }
@Override public boolean matches(final RuleAtom atom) { return ((atom instanceof IndividualPropertyAtom) || (atom instanceof DatavaluedPropertyAtom)) && atom.getPredicate().equals(_role.getName()) && ((BinaryAtom<?, ?, ?>) atom).getArgument1() instanceof AtomIConstant && ((AtomIConstant) ((BinaryAtom<?, ?, ?>) atom).getArgument1()).getValue().equals(_name) && ((BinaryAtom<?, ?, ?>) atom).getArgument2() instanceof AtomConstant && ((AtomConstant) ((BinaryAtom<?, ?, ?>) atom).getArgument2()).getValue().equals(_objectName); }
public AlphaNode addNode(final RuleAtom atom) { final Object pred = atom.getPredicate(); List<AlphaNode> nodes = _map.get(pred); if (nodes == null) { nodes = new ArrayList<>(); _map.put(pred, nodes); } else for (final AlphaNode node : nodes) if (node.matches(atom)) return node; final AlphaNode node = _creator.create(atom); if (node != null) if (node instanceof AlphaEdgeNode) { final Role role = ((AlphaEdgeNode) node).getRole(); addAlphaNodeForSubs(role, node); if (role.isObjectRole()) addAlphaNodeForSubs(role.getInverse(), node); } else nodes.add(node); _alphaNodes.add(node); return node; }
public AlphaNode addNode(final RuleAtom atom) { final Object pred = atom.getPredicate(); List<AlphaNode> nodes = _map.get(pred); if (nodes == null) { nodes = new ArrayList<>(); _map.put(pred, nodes); } else for (final AlphaNode node : nodes) if (node.matches(atom)) return node; final AlphaNode node = _creator.create(atom); if (node != null) if (node instanceof AlphaEdgeNode) { final Role role = ((AlphaEdgeNode) node).getRole(); addAlphaNodeForSubs(role, node); if (role.isObjectRole()) addAlphaNodeForSubs(role.getInverse(), node); } else nodes.add(node); _alphaNodes.add(node); return node; }