@Test @Ignore public void modelToGraphCollectionTest() throws Exception { for (String resourceFile : RESOURCE_FILES) { InputStream is = this.getClass().getResourceAsStream(resourceFile); File outFile = testFolder.newFile(); Dataset dataset = DatasetFactory.createGeneral(); RDFDataMgr.read(dataset, is, RDFFormat.TRIG.getLang()); is.close(); String modelName = dataset.listNames().next(); Model model = dataset.getNamedModel(modelName); GraphCollection gc = ModelConverter.modelToGraphCollection(modelName, dataset); TriGPlusWriter.writeFile(gc, outFile.getAbsolutePath(), false); InputStream is2 = new FileInputStream(outFile); Dataset dataset2 = DatasetFactory.createGeneral(); RDFDataMgr.read(dataset2, is2, RDFFormat.TRIG.getLang()); is2.close(); Model model2 = dataset2.getNamedModel(modelName); File outFile2 = testFolder.newFile(); OutputStream os = new FileOutputStream(outFile2); RDFDataMgr.write(os, dataset2, RDFFormat.TRIG.getLang()); os.close(); Assert.assertTrue(model.listStatements().hasNext() && model2.listStatements().hasNext()); Assert.assertTrue(model.isIsomorphicWith(model2)); } }
public static GraphCollection modelToGraphCollection(String modelURI, Dataset dataset) { Model model = dataset.getNamedModel(modelURI); return modelToGraphCollection(modelURI, model); }
ModelConverter { public static GraphCollection modelToGraphCollection(String modelURI, Dataset dataset) { Model model = dataset.getNamedModel(modelURI); return modelToGraphCollection(modelURI, model); } }
ModelConverter { public static GraphCollection modelToGraphCollection(String modelURI, Dataset dataset) { Model model = dataset.getNamedModel(modelURI); return modelToGraphCollection(modelURI, model); }  }
ModelConverter { public static GraphCollection modelToGraphCollection(String modelURI, Dataset dataset) { Model model = dataset.getNamedModel(modelURI); return modelToGraphCollection(modelURI, model); }  static Model namedGraphToModel(String graphName, GraphCollection gc); static GraphCollection modelToGraphCollection(String modelURI, Dataset dataset); static GraphCollection modelsToGraphCollection(Dataset dataset, String... modelURIs); static GraphCollection fromDataset(Dataset dataset); static NamedGraph fromModel(String name, Model model); }
ModelConverter { public static GraphCollection modelToGraphCollection(String modelURI, Dataset dataset) { Model model = dataset.getNamedModel(modelURI); return modelToGraphCollection(modelURI, model); }  static Model namedGraphToModel(String graphName, GraphCollection gc); static GraphCollection modelToGraphCollection(String modelURI, Dataset dataset); static GraphCollection modelsToGraphCollection(Dataset dataset, String... modelURIs); static GraphCollection fromDataset(Dataset dataset); static NamedGraph fromModel(String name, Model model);  }