OWLGraphWrapperEdgesAdvanced extends OWLGraphWrapperEdgesExtended implements Closeable { public OWLShuntGraph getNeighbors(OWLObject x, List<String> sargs) { return getNeighbors(x); } protected  OWLGraphWrapperEdgesAdvanced(OWLOntology ontology); protected  OWLGraphWrapperEdgesAdvanced(String iri); void setEdgesAdvancedCacheSize(int size); long getCurrentEdgesAdvancedCacheSize(); synchronized void addPropertyForMaterialization(OWLObjectProperty p); synchronized void addPropertiesForMaterialization(Iterable<OWLObjectProperty> properties); synchronized void addPropertyIdsForMaterialization(Iterable<String> propertyIds); @Override synchronized void close(); Set<OWLObjectProperty> relationshipIDsToPropertySet(List<String> relation_ids); String classifyRelationship(OWLGraphEdge owlGraphEdge, OWLObject edgeDirector, Set<? extends OWLPropertyExpression> props); OWLShuntGraph addStepwiseAncestorsToShuntGraph(OWLObject x, OWLShuntGraph g, List<String> rel_ids); OWLShuntGraph addTransitiveAncestorsToShuntGraph(OWLObject x, OWLShuntGraph g, List<String> rel_ids); OWLShuntGraph addDirectDescendentsToShuntGraph(OWLObject x, OWLShuntGraph g, List<String> rel_ids); OWLShuntGraph getSegmentShuntGraph(OWLObject x, List<String> rel_ids); OWLShuntGraph getLineageShuntGraph(OWLObject x, List<String> rel_ids); String getSegmentShuntGraphJSON(OWLObject x, List<String> sargs); String getLineageShuntGraphJSON(OWLObject x, List<String> sargs); Map<String,String> getRelationClosureMap(OWLObject c, final List<String> relation_ids); Map<String,String> getRelationClosureMapEngine(OWLObject obj, List<String> relation_ids); @Deprecated Map<String,String> getIsaPartofClosureMap(OWLObject c); @Deprecated List<String> getIsaPartofIDClosure(OWLObject c); @Deprecated List<String> getIsaPartofIDClosure(OWLObject c, List<String> sargs); List<String> getRelationIDClosure(OWLObject c, List<String> relation_ids); @Deprecated List<String> getIsaPartofLabelClosure(OWLObject c); @Deprecated List<String> getIsaPartofLabelClosure(OWLObject c, List<String> sargs); List<String> getRelationLabelClosure(OWLObject c, List<String> relation_ids); @Deprecated String[] getSubClassesNames(OWLClass cls); String categorizeNamespace(OWLObject c, Map<String, Object> configuration); String categorizeObject(OWLNamedObject named,  Map<String,String> idspaceMappings, 
			Set<String> useNamespace, boolean useFallback); String getDummyString(OWLObject c, List<String> sargs); List<String> getDummyStrings(OWLObject c, List<String> sargs); Set<String> getOnlyInTaxon(OWLObject x, List<String> sargs); Set<String> getOnlyInTaxonLabels(OWLObject x, List<String> sargs); Map<String, String> getOnlyInTaxonLabelMap(OWLObject x, List<String> sargs); Set<String> getOnlyInTaxonClosure(OWLObject x, List<String> relation_ids); Set<String> getOnlyInTaxonClosureLabels(OWLObject x, List<String> relation_ids); OWLShuntGraph getNeighbors(OWLObject x, List<String> sargs); String getNeighborsJSON(OWLObject x, List<String> sargs); String getNeighborsLimitedJSON(OWLObject x, List<String> sargs); OWLShuntGraph getNeighborsLimited(OWLObject x, int edgeLimit); OWLShuntGraph getNeighbors(OWLObject x);  }
@Test public void testGetNeighbors() throws Exception { OWLGraphWrapper graph = getGraph("graph/neighbors-test.obo"); OWLClass cls = graph.getOWLClassByIdentifier("FOO:0003"); assertNotNull(cls); OWLShuntGraph neighbors = graph.getNeighbors(cls); assertEquals(3, neighbors.nodes.size()); assertEquals(2, neighbors.edges.size()); assertTrue(neighbors.hasEdge(new OWLShuntEdge("FOO:0004", "FOO:0003", "BFO:0000050"))); assertTrue(neighbors.hasEdge(new OWLShuntEdge("FOO:0003", "FOO:0001", "is_a"))); cls = graph.getOWLClassByIdentifier("FOO:0007"); neighbors = graph.getNeighbors(cls); assertEquals(3, neighbors.nodes.size()); assertEquals(2, neighbors.edges.size()); assertTrue(neighbors.hasEdge(new OWLShuntEdge("FOO:0007", "FOO:0001", "is_a"))); assertFalse(neighbors.hasEdge(new OWLShuntEdge("FOO:0007", "FOO:0005", "is_a"))); assertTrue(neighbors.hasEdge(new OWLShuntEdge("FOO:0007", "FOO:0006", "BFO:0000050"))); cls = graph.getOWLClassByIdentifier("FOO:0007"); neighbors = graph.getNeighborsLimited(cls, 1); assertEquals(2, neighbors.nodes.size()); assertEquals(1, neighbors.edges.size()); assertEquals(Boolean.TRUE, neighbors.metadata.get("incomplete-p")); assertEquals(3, neighbors.metadata.get("complete-node-count")); assertEquals(2, neighbors.metadata.get("complete-edge-count")); cls = graph.getOWLClassByIdentifier("GO:1904238"); neighbors = graph.getNeighbors(cls); assertEquals(3, neighbors.nodes.size()); assertEquals(2, neighbors.edges.size()); assertTrue(neighbors.hasEdge(new OWLShuntEdge("GO:1904238", "CL:0000669", "RO:0002315"))); assertTrue(neighbors.hasEdge(new OWLShuntEdge("GO:1904238", "GO:0030154", "is_a"))); }
@Test public void testPull177() throws Exception { OWLGraphWrapper graph = getGraph("graph/detection-of-stimulus.obo"); OWLClass cls = graph.getOWLClassByIdentifier("GO:1902401"); assertNotNull(cls); OWLShuntGraph neighbors = graph.getNeighbors(cls); assertEquals(3, neighbors.nodes.size()); assertEquals(2, neighbors.edges.size()); assertTrue(neighbors.hasEdge(new OWLShuntEdge("GO:1902401", "GO:0044773", "BFO:0000050"))); assertTrue(neighbors.hasEdge(new OWLShuntEdge("GO:1902401", "GO:0072400", "is_a"))); assertFalse(neighbors.hasEdge(new OWLShuntEdge("GO:1902401", "GO:0051606", "is_a"))); }