+
+ String dependencies = graph.getPossibleRelatedValue(test, TESTS.dependencies, Bindings.STRING);
+ String[] actualDeps = dependencies.isEmpty() ? new String[0] : dependencies.split(",");
+
+ // collect variables
+ Collection<Resource> stsVariables = graph.getObjects(test, L0.ConsistsOf);
+ Map<String, String> variables = new HashMap<>(stsVariables.size());
+ for (Resource stsVariable : stsVariables) {
+ String name = graph.getRelatedValue(stsVariable, L0.HasName, Bindings.STRING);
+ String value = graph.getRelatedValue(stsVariable, TESTS.STSVariable_definition);
+ variables.put(name, value);
+ }
+ Resource parent = graph.getSingleObject(test, L0.PartOf);
+ String parentName;
+ String possibleURI = graph.getPossibleURI(parent);
+ if (possibleURI != null)
+ parentName = possibleURI;
+ else
+ parentName = graph.getRelatedValue2(parent, L0.HasName, Bindings.STRING);
+ return new ModelledSTSTest(testName, parentName, code, priority != null ? priority : -1, ignored != null ? ignored : false, new HashSet<>(Arrays.asList(actualDeps)), variables);