public Collection<Resource> find(ReadGraph graph, Resource index, String filter) throws DatabaseException {\r
CollectionSupport coll = graph.getService(CollectionSupport.class);\r
\r
- List<Resource> rec = findRec(graph, index, filter, new THashSet<Resource>());\r
+ THashSet<Resource> visited = new THashSet<>();\r
+ List<Resource> rec = findRec(graph, index, filter, visited);\r
for(Resource global : Layer0Utils.listGlobalOntologies(graph)) {\r
+ if(!visited.add(global)) continue;\r
List<Resource> rs = graph.syncRequest(new QueryIndex(global, type, filter), TransientCacheListener.<List<Resource>>instance());\r
if(rec.isEmpty() && !rs.isEmpty()) {\r
// TODO: rec could be an immutable empty list\r