@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);
  }
示例#2
0
 private static MGraph createClerezzaModel() {
   TcManager manager = TcManager.getInstance();
   UriRef graphUri = new UriRef(HTTP_EXAMPLE_COM);
   if (manager.listMGraphs().contains(graphUri)) {
     manager.deleteTripleCollection(graphUri);
   }
   return manager.createMGraph(graphUri);
 }