Hi,
I am trying to upload large ttl files to virtuoso graphs using jena , the files are quite large(around 1GB) and a lot in number(187 different files per graph). Sometimes i face this issue where the uploading fails giving an error "SR197: Non unique primary key on DB.DBA.SYS_XML_PERSISTENT_NS_DECL. "
This error doesn’t appear sometimes and i am quite confused why only sometimes, i tried to see which exact file while being uploaded causes this issue but it turns out it happens at random files so basically its not because of one corrupted file. I am uploading the files in a parallel fashion using the code mentioned below
"public void rdfUploadMethod(VirtGraph graph, String fileName, List types) throws IOException {
Lang fileType = null;
if (types.contains(TTL_FILE_TYPE))
fileType = RDFLanguages.TTL;
else if (types.contains(XML_FILE_TYPE) || types.contains(RDF_FILE_TYPE))
fileType = RDFLanguages.RDFXML;
log.logInformation(“TripleStoreLoaderService”, “LoadRDFFileToGraph”, "Loading the graph " + graph.getGraphName() + " with file " + fileName);
VirtModel model = new VirtModel(graph);
model.setConcurrencyMode(virtuosoMode);
StreamRDF writer = model.getStreamRDF(true, virtuosoChunkSize, new VirtuosoDeadLockHandler(0));
try (InputStream in = new FileInputStream(fileName)) {
RDFParser parser = RDFParser.create()
.source(in)
.lang(fileType) //.lang(RDFLanguages.N3)
.errorHandler(ErrorHandlerFactory.errorHandlerWarn) //.errorHandler(ErrorHandlerFactory.errorHandlerStrict)
.build();
parser.parse(writer);
}
catch(Exception e)
{
log.logError(“TripleStoreLoaderService”, “LoadRDFFileToGraph”,"FileName : " + fileName + " Message : " + e.getMessage());
throw e;
}
log.logInformation(“TripleStoreLoaderService”, “LoadRDFFileToGraph”, "Loaded the graph " + graph.getGraphName() + " with file " + fileName);
}
"
The method shown above rdfUploadMethod is being called in a parallel fashion to insert multiple files at a time.
So basically sometimes i am able to upload all the files with no error and sometimes this issue pops up stopping the upload in between.Can anyone help me identify the issue and guide me how to resolve it.
I am using virtuoso open source 7.2.7, apache-jena-libs - 4.6.1 , virtjdbc4- 3.122, virt_jena_v4_4 - 1.42