Add transaction when reading dataset
@@ -4,6 +4,7 @@ import org.apache.jena.query.Dataset;
import org.apache.jena.query.DatasetFactory;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryFactory;
+import org.apache.jena.query.ReadWrite;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.riot.Lang;
@@ -27,8 +28,10 @@ public class Utils
InputStream is = Utils.class.getResourceAsStream(resourceName);
Dataset dataset = DatasetFactory.createGeneral();
+ dataset.begin(ReadWrite.WRITE);
RDFDataMgr.read(dataset, is, RDFFormat.TRIG.getLang());
is.close();
+ dataset.commit();
return dataset;
}
