public SM_Engine(final G g, Set<URI> toTop, Set<URI> toBottom, InstanceAccessor iAccessor) throws SLIB_Ex_Critic { this.graph = g; WalkConstraint toTopWC = new WalkConstraintGeneric(); WalkConstraint toBottomWC = new WalkConstraintGeneric(); if (toTop != null) { toTopWC.addAcceptedTraversal(toTop, Direction.OUT); toBottomWC.addAcceptedTraversal(toTop, Direction.IN); } else { toTop = new HashSet(); // for union } if (toBottom != null) { toTopWC.addAcceptedTraversal(toBottom, Direction.IN); toBottomWC.addAcceptedTraversal(toBottom, Direction.OUT); } else { toBottom = new HashSet(); // for union } topNodeAccessor = new RVF_DAG(g, toTopWC); bottomNodeAccessor = new RVF_DAG(g, toBottomWC); // We define that the classes are the vertices which are linked to relationships // which are of the types specified to iterate over the DAG Set<URI> c = new HashSet(); for (E e : g.getE(SetUtils.union(toTop, toBottom))) { c.add(e.getSource()); c.add(e.getTarget()); } classes = c; this.instanceAccessor = iAccessor; initEngine(); }