-
Notifications
You must be signed in to change notification settings - Fork 3
User_Guide
Andrea Gazzarini edited this page Aug 25, 2014
·
4 revisions
final String datafileURI = new File("path to your datafile").toURI().toString();
Dataset dataset;
StorageLayerFactory factory;
try {
// 1. Load the appropriate factory
factory = StorageLayerFactory.getFactory();
// 2. Create a dataset
dataset = DatasetFactory.create(factory.getDatasetGraph());
// 3. Load and create a model
final Model model = dataset.getDefaultModel().read(datafileURI, "http://example.org", "TTL");
// 4. Do whatever you want with the model.
} finally {
// 5. Make sure resources are released on exit
dataset.close();
factory.getClientShutdownHook().close();
}