/** * May return true if atom is something that * will be added to the ABox during completion. */ public boolean isSafe(RuleAtom atom) { atom.accept(this); return result; }
public boolean equals( Object other ) { if ( other != null && getClass().equals( other.getClass() ) ) { RuleAtom atom = ( RuleAtom ) other; return getPredicate().equals( atom.getPredicate() ) && getAllArguments().equals( atom.getAllArguments() ); } return false; }
private static NodeProvider createNodeProvider(AtomVariable arg, List<RuleAtom> processed, boolean lastWME) { for (int index = 0, n = processed.size(); index < n; index++) { RuleAtom sharedAtom = processed.get(index); int indexArg = sharedAtom.getAllArguments().indexOf(arg); if (indexArg != -1) { if (lastWME && index == n -1) { return new WMENodeProvider(indexArg); } else { return new TokenNodeProvider(index, indexArg); } } } return null; }
public boolean matches(RuleAtom atom) { return (atom instanceof ClassAtom) && atom.getPredicate().equals(predicate) && argMatches((ClassAtom) atom); }
private RuleAtom pickNextAtom(List<RuleAtom> atoms, Set<AtomVariable> bound) { int index = 0; if (bound.isEmpty()) { for (int i = 0; i < atoms.size(); i++) { RuleAtom atom = atoms.get(i); if (safetyChecker.isSafe(atom)) { return atoms.remove(i); } } } else { for (int i = 0; i < atoms.size(); i++) { RuleAtom atom = atoms.get(i); if (SetUtils.intersects(bound, atom.getAllArguments())) { index = i; if (safetyChecker.isSafe(atom)) { break; } } } } return atoms.remove(index); }
@SuppressWarnings("rawtypes") public boolean matches(RuleAtom atom) { return ((atom instanceof IndividualPropertyAtom) || (atom instanceof DatavaluedPropertyAtom)) && atom.getPredicate().equals(role.getName()) && ((BinaryAtom) atom).getArgument1() instanceof AtomVariable && ((BinaryAtom) atom).getArgument2() instanceof AtomVariable; }
public ATermAppl translate(RuleAtom ruleAtom) { term = null; ruleAtom.accept( this ); return term; }
/** * Static convenience function to return the instance variables used * in the given atom. */ public static Collection<AtomIVariable> getIVars(RuleAtom atom) { VisitingICollector collector = new VisitingICollector(); for( AtomObject obj : atom.getAllArguments() ) { obj.accept( collector ); } return collector.getVariables(); }
public boolean equals( Object other ) { if ( other != null && getClass().equals( other.getClass() ) ) { RuleAtom atom = ( RuleAtom ) other; return getPredicate().equals( atom.getPredicate() ) && getAllArguments().equals( atom.getAllArguments() ); } return false; }
public boolean matches(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()); }
public boolean assertAtom(RuleAtom atom, VariableBinding binding, DependencySet ds, boolean negated,ABox abox, CompletionStrategy strategy) { asserted = true; this.binding = binding; this.ds = ds; this.negated = negated; this.strategy = strategy; this.abox = abox; atom.accept( this ); return asserted; }
/** * Static convenience function to return the instance variables used * in the given atom. */ public static Collection<AtomIVariable> getIVars(RuleAtom atom) { VisitingICollector collector = new VisitingICollector(); for( AtomObject obj : atom.getAllArguments() ) { obj.accept( collector ); } return collector.getVariables(); }
@SuppressWarnings("rawtypes") public boolean matches(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; }
public String explainNotUsable(RuleAtom atom) { notUsableMessage = null; atom.accept(this); return notUsableMessage; } }
/** * Static convenience function to return the variables used * in the given atom. */ public static Collection<AtomVariable> getVars(RuleAtom atom) { VisitingCollector collector = new VisitingCollector(); for( AtomObject obj : atom.getAllArguments() ) { obj.accept( collector ); } return collector.getVariables(); }
@SuppressWarnings("rawtypes") public boolean matches(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); }
public ATermAppl translate(RuleAtom ruleAtom) { term = null; ruleAtom.accept( this ); return term; }
/** * Static convenience function to return the variables used * in the given atom. */ public static Collection<AtomVariable> getVars(RuleAtom atom) { VisitingCollector collector = new VisitingCollector(); for( AtomObject obj : atom.getAllArguments() ) { obj.accept( collector ); } return collector.getVariables(); }
public boolean matches(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 boolean assertAtom(RuleAtom atom, VariableBinding binding, DependencySet ds, boolean negated,ABox abox, CompletionStrategy strategy) { asserted = true; this.binding = binding; this.ds = ds; this.negated = negated; this.strategy = strategy; this.abox = abox; atom.accept( this ); return asserted; }