private Graph getOrCreatePermisionGraph() { try { return tcManager.getMGraph(permissionGraphName); } catch (NoSuchEntityException e) { return tcManager.createGraph(permissionGraphName); } }
@BeforeClass public static final void initYard() { initTestData(); // create the graphs in Clerezza tcManager = TcManager.getInstance(); MGraph graph = tcManager.createMGraph(READ_WRITEGRAPH_URI); // add the test data to the MGrpah for (TripleCollection tc : entityData.values()) { graph.addAll(tc); } // create the read only graph tcManager.createGraph(READ_ONLY_GRAPH_URI, graph); // init the ClerezzaYards for the created Clerezza graphs ClerezzaYardConfig readWriteConfig = new ClerezzaYardConfig("readWriteYardId"); readWriteConfig.setName("Clerezza read/write Yard"); readWriteConfig.setDescription("Tests config with pre-existing MGraph"); readWriteConfig.setGraphUri(READ_WRITEGRAPH_URI); readwriteYard = new ClerezzaYard(readWriteConfig); ClerezzaYardConfig readOnlyYardConfig = new ClerezzaYardConfig("readOnlyYardId"); readOnlyYardConfig.setName("Clerezza read-only Yard"); readOnlyYardConfig.setDescription("Tests config with pre-existing Graph"); readOnlyYardConfig.setGraphUri(READ_ONLY_GRAPH_URI); readonlyYard = new ClerezzaYard(readOnlyYardConfig); }