@Test public void equivalentEntailment_isReturned() { Collection<Node> entailment = graphApi.getEntailment(a, new DirectedRelationshipType(OwlRelationships.RDFS_SUBCLASS_OF, Direction.INCOMING), true); assertThat(entailment, contains(a, b, c)); }
public Collection<Node> getEntailment(Node parent, DirectedRelationshipType relationship, boolean traverseEquivalentEdges) { Set<Node> entailment = new HashSet<>(); TraversalDescription description = graphDb.traversalDescription().depthFirst() .relationships(relationship.getType(), relationship.getDirection()) .evaluator(Evaluators.fromDepth(0)).evaluator(Evaluators.all()); if (traverseEquivalentEdges) { description = description.relationships(OwlRelationships.OWL_EQUIVALENT_CLASS); } for (Path path : description.traverse(parent)) { entailment.add(path.endNode()); } return entailment; }
GraphApi { public Collection<Node> getEntailment(Node parent, DirectedRelationshipType relationship, boolean traverseEquivalentEdges) { Set<Node> entailment = new HashSet<>(); TraversalDescription description = graphDb.traversalDescription().depthFirst() .relationships(relationship.getType(), relationship.getDirection()) .evaluator(Evaluators.fromDepth(0)).evaluator(Evaluators.all()); if (traverseEquivalentEdges) { description = description.relationships(OwlRelationships.OWL_EQUIVALENT_CLASS); } for (Path path : description.traverse(parent)) { entailment.add(path.endNode()); } return entailment; } }
GraphApi { public Collection<Node> getEntailment(Node parent, DirectedRelationshipType relationship, boolean traverseEquivalentEdges) { Set<Node> entailment = new HashSet<>(); TraversalDescription description = graphDb.traversalDescription().depthFirst() .relationships(relationship.getType(), relationship.getDirection()) .evaluator(Evaluators.fromDepth(0)).evaluator(Evaluators.all()); if (traverseEquivalentEdges) { description = description.relationships(OwlRelationships.OWL_EQUIVALENT_CLASS); } for (Path path : description.traverse(parent)) { entailment.add(path.endNode()); } return entailment; } @Inject  GraphApi(GraphDatabaseService graphDb, CypherUtil cypherUtil, CurieUtil curieUtil); }
GraphApi { public Collection<Node> getEntailment(Node parent, DirectedRelationshipType relationship, boolean traverseEquivalentEdges) { Set<Node> entailment = new HashSet<>(); TraversalDescription description = graphDb.traversalDescription().depthFirst() .relationships(relationship.getType(), relationship.getDirection()) .evaluator(Evaluators.fromDepth(0)).evaluator(Evaluators.all()); if (traverseEquivalentEdges) { description = description.relationships(OwlRelationships.OWL_EQUIVALENT_CLASS); } for (Path path : description.traverse(parent)) { entailment.add(path.endNode()); } return entailment; } @Inject  GraphApi(GraphDatabaseService graphDb, CypherUtil cypherUtil, CurieUtil curieUtil); Collection<Node> getEntailment(Node parent, DirectedRelationshipType relationship,
      boolean traverseEquivalentEdges); @AddCuries Graph getNeighbors(Set<Node> nodes, int depth, Set<DirectedRelationshipType> types,
      final Optional<Predicate<Node>> includeNode); Graph getEdges(RelationshipType type, boolean entail, long skip, long limit); Optional<Node> getNode(String id, Optional<String> lblHint); Graph getReachableNodes(Node start, List<String> rels, Set<String> lbls); Collection<RelationshipType> getAllRelationshipTypes(); Collection<String> getAllPropertyKeys(); }
GraphApi { public Collection<Node> getEntailment(Node parent, DirectedRelationshipType relationship, boolean traverseEquivalentEdges) { Set<Node> entailment = new HashSet<>(); TraversalDescription description = graphDb.traversalDescription().depthFirst() .relationships(relationship.getType(), relationship.getDirection()) .evaluator(Evaluators.fromDepth(0)).evaluator(Evaluators.all()); if (traverseEquivalentEdges) { description = description.relationships(OwlRelationships.OWL_EQUIVALENT_CLASS); } for (Path path : description.traverse(parent)) { entailment.add(path.endNode()); } return entailment; } @Inject  GraphApi(GraphDatabaseService graphDb, CypherUtil cypherUtil, CurieUtil curieUtil); Collection<Node> getEntailment(Node parent, DirectedRelationshipType relationship,
      boolean traverseEquivalentEdges); @AddCuries Graph getNeighbors(Set<Node> nodes, int depth, Set<DirectedRelationshipType> types,
      final Optional<Predicate<Node>> includeNode); Graph getEdges(RelationshipType type, boolean entail, long skip, long limit); Optional<Node> getNode(String id, Optional<String> lblHint); Graph getReachableNodes(Node start, List<String> rels, Set<String> lbls); Collection<RelationshipType> getAllRelationshipTypes(); Collection<String> getAllPropertyKeys();  }