- Collection<Resource> elements = graph.syncRequest(new OrderedSet(realDiagram));
- for (Resource element : elements) {
-// System.out.println("checking element " + NameUtils.getSafeName(graph, element, true));
- Collection<Resource> elementTypes = graph.getTypes(element);
- if (!Collections.disjoint(types, elementTypes))
- result.add(element);
+ if (graph.hasStatement(realDiagram)) {
+ Collection<Resource> elements = graph.syncRequest(new OrderedSet(realDiagram));
+ for (Resource element : elements) {
+ // System.out.println("checking element " + NameUtils.getSafeName(graph, element, true));
+ Collection<Resource> elementTypes = graph.getTypes(element);
+ if (!Collections.disjoint(types, elementTypes))
+ result.add(element);
+ }
+ } else {
+ LOGGER.warn("Most likely after deleting a diagram or something therefore no ordered set can be found for {}", realDiagram);