- VirtualGraphSupport vgs = graph.getService(VirtualGraphSupport.class);
- return graph.syncRequest(new WriteResultRequest<Resource>(vgs.getMemoryPersistent("experiments")) {
- @Override
- public Resource perform(WriteGraph graph) throws DatabaseException {
- Layer0 L0 = Layer0.getInstance(graph);
- Resource run = graph.newResource();
- graph.claim(run, L0.InstanceOf, runType);
- graph.addLiteral(run, L0.HasName, L0.NameOf, L0.String, UUID.randomUUID().toString(), Bindings.STRING);
- graph.claim(experiment, L0.ConsistsOf, run);
-
- Resource activeRun = graph.syncRequest(new PossibleActiveExperiment(experiment));
- if (activeRun != null) {
- graph.deny(activeRun, SIMU.IsActive, activeRun);
- }
- graph.claim(run, SIMU.IsActive, run);
+ public static Resource createExperimentRunWithType(WriteGraph graph, Resource experiment, Resource runType) throws DatabaseException {
+
+ Layer0 L0 = Layer0.getInstance(graph);