protected boolean interactsWithInversesComplex(final KnowledgeBase kb, final Role role) { for (final ATermAppl p : _expressivity.getAnonInverses()) { final Role anonRole = kb.getRole(p); if (anonRole.hasComplexSubRole() && anonRole.getFSM().getAlpahabet().contains(role)) return true; } return false; }
protected boolean interactsWithInversesComplex(final KnowledgeBase kb, final Role role) { for (final ATermAppl p : _expressivity.getAnonInverses()) { final Role anonRole = kb.getRole(p); if (anonRole.hasComplexSubRole() && anonRole.getFSM().getAlpahabet().contains(role)) return true; } return false; }
return null; TransitionGraph<Role> tg = s.getFSM(); if (tg == null)
return null; TransitionGraph<Role> tg = s.getFSM(); if (tg == null)
@Override public void getObjectPropertyValues(final ATermAppl s, final Role role, final Set<ATermAppl> knowns, final Set<ATermAppl> unknowns, final boolean getSames) { assert isComplete() : "Initial consistency check has not been performed!"; Individual subj = getIndividual(s); boolean isIndependent = true; if (subj.isMerged()) { isIndependent = subj.getMergeDependency(true).isIndependent(); subj = subj.getSame(); } if (role.isSimple()) getSimpleObjectPropertyValues(subj, role, knowns, unknowns, getSames); else if (!role.hasComplexSubRole()) getTransitivePropertyValues(subj, role, knowns, unknowns, getSames, new HashMap<Individual, Set<Role>>(), true); else { final TransitionGraph<Role> tg = role.getFSM(); getComplexObjectPropertyValues(subj, tg.getInitialState(), tg, knowns, unknowns, getSames, new HashMap<Individual, Set<State<Role>>>(), true); } if (!isIndependent) { unknowns.addAll(knowns); knowns.clear(); } }
private static Bool checkAllValuesClash(final KnowledgeBase kb, final ATermAppl av, final CachedNode root, final CachedNode otherRoot) { ATerm r = av.getArgument(0); if (r.getType() == ATerm.LIST) r = ((ATermList) r).getFirst(); final Role role = kb.getRole(r); if (null == role) // FIXME : null is unexpected. return Bool.UNKNOWN; if (!role.hasComplexSubRole()) { if (otherRoot.hasRNeighbor(role)) { if (_logger.isLoggable(Level.FINE)) _logger.fine(root + " has " + av + " " + otherRoot + " has " + role + " _neighbor"); return Bool.UNKNOWN; } } else { final TransitionGraph<Role> tg = role.getFSM(); for (final Transition<Role> t : tg.getInitialState().getTransitions()) if (otherRoot.hasRNeighbor(t.getName())) { if (_logger.isLoggable(Level.FINE)) _logger.fine(root + " has " + av + " " + otherRoot + " has " + t.getName() + " _neighbor"); return Bool.UNKNOWN; } } return null; }
private static Bool checkAllValuesClash(final KnowledgeBase kb, final ATermAppl av, final CachedNode root, final CachedNode otherRoot) { ATerm r = av.getArgument(0); if (r.getType() == ATerm.LIST) r = ((ATermList) r).getFirst(); final Role role = kb.getRole(r); if (null == role) // FIXME : null is unexpected. return Bool.UNKNOWN; if (!role.hasComplexSubRole()) { if (otherRoot.hasRNeighbor(role)) { if (_logger.isLoggable(Level.FINE)) _logger.fine(root + " has " + av + " " + otherRoot + " has " + role + " _neighbor"); return Bool.UNKNOWN; } } else { final TransitionGraph<Role> tg = role.getFSM(); for (final Transition<Role> t : tg.getInitialState().getTransitions()) if (otherRoot.hasRNeighbor(t.getName())) { if (_logger.isLoggable(Level.FINE)) _logger.fine(root + " has " + av + " " + otherRoot + " has " + t.getName() + " _neighbor"); return Bool.UNKNOWN; } } return null; }
@Override public void getObjectPropertyValues(final ATermAppl s, final Role role, final Set<ATermAppl> knowns, final Set<ATermAppl> unknowns, final boolean getSames) { assert isComplete() : "Initial consistency check has not been performed!"; Individual subj = getIndividual(s); boolean isIndependent = true; if (subj.isMerged()) { isIndependent = subj.getMergeDependency(true).isIndependent(); subj = subj.getSame(); } if (role.isSimple()) getSimpleObjectPropertyValues(subj, role, knowns, unknowns, getSames); else if (!role.hasComplexSubRole()) getTransitivePropertyValues(subj, role, knowns, unknowns, getSames, new HashMap<Individual, Set<Role>>(), true); else { final TransitionGraph<Role> tg = role.getFSM(); getComplexObjectPropertyValues(subj, tg.getInitialState(), tg, knowns, unknowns, getSames, new HashMap<Individual, Set<State<Role>>>(), true); } if (!isIndependent) { unknowns.addAll(knowns); knowns.clear(); } }
private static boolean isAllValuesSafe(final KnowledgeBase kb, final Individual parent, final Role role, final ATermAppl term) { final Role s = kb.getRole(term.getArgument(0)); if (!s.hasComplexSubRole()) { final ATermAppl c = (ATermAppl) term.getArgument(1); if (role.isSubRoleOf(s) && !parent.hasType(c)) return false; } else { final TransitionGraph<Role> tg = s.getFSM(); for (final Transition<Role> t : tg.getInitialState().getTransitions()) if (role.isSubRoleOf(t.getName())) return false; } return true; }
private static boolean isAllValuesSafe(final KnowledgeBase kb, final Individual parent, final Role role, final ATermAppl term) { final Role s = kb.getRole(term.getArgument(0)); if (!s.hasComplexSubRole()) { final ATermAppl c = (ATermAppl) term.getArgument(1); if (role.isSubRoleOf(s) && !parent.hasType(c)) return false; } else { final TransitionGraph<Role> tg = s.getFSM(); for (final Transition<Role> t : tg.getInitialState().getTransitions()) if (role.isSubRoleOf(t.getName())) return false; } return true; }
else final TransitionGraph<Role> tg = role.getFSM(); final Iterator<Transition<Role>> it = tg.getInitialState().getTransitions().iterator(); while (!found && it.hasNext())
else final TransitionGraph<Role> tg = role.getFSM(); final Iterator<Transition<Role>> it = tg.getInitialState().getTransitions().iterator(); while (!found && it.hasNext())