+ public static void collectTestImports(ReadGraph graph, Resource resource, Set<String> imports) throws DatabaseException {
+ Layer0 L0 = Layer0.getInstance(graph);
+ TestsResource TESTS = TestsResource.getInstance(graph);
+ if(graph.isInstanceOf(resource, TESTS.STSTest) || graph.isInstanceOf(resource, TESTS.STSSuite)) {
+ for(Resource module : CommonDBUtils.objectsWithType(graph, resource, L0.ConsistsOf, L0.SCLModule)) {
+ String uri = graph.getPossibleURI(module);
+ if(uri != null)
+ imports.add(uri);
+ }
+ Resource parent = graph.getPossibleObject(resource, L0.PartOf);
+ if(parent != null)
+ collectTestImports(graph, parent, imports);
+ } else if(graph.isInstanceOf(resource, L0.IndexRoot)) {
+ Resource sclMain = CommonDBUtils.getPossibleChild(graph, resource, L0.SCLModule, "SCLMain");
+ if(sclMain != null)
+ imports.add(graph.getURI(sclMain));
+ }
+ }
+