private static Tuple<QueryResult, Set<Variable>> evaluateSubgraph(
final String subgraphSerializedAsJSONString, final Dataset dataset,
final IOperatorCreator operatorCreator, final ISubgraphExecutor<?> sgExecuter) throws JSONException {
final CollectResult collectResult = new CollectResult(true);
final SubgraphContainerFormatter formatter = new SubgraphContainerFormatter(dataset, operatorCreator, collectResult,sgExecuter);
final Root root = formatter.deserialize(new JSONObject(subgraphSerializedAsJSONString));
// some initializations
root.deleteParents();
root.setParents();
root.detectCycles();