Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void insertAsTriples(SimulationInstanceProcessManagerTO simulationInstanceProcessManagerTO) throws Exception {
- List<Triple> triplesList = simulationInstanceProcessManagerTO.getTripleList();
- String namedGraph = simulationInstanceProcessManagerTO.getNamedGraph();
- for (Triple triple : triplesList) {
- VirtGraph virtGraph = new VirtGraph(" <"+namedGraph+"> ",virtDataSource.getGraphUrl(),virtDataSource.getGraphUser(),virtDataSource.getGraphPassword());
- try{
- //virtGraph.clear();
- virtGraph.performAdd(triple);
- }catch(Exception e){
- String tripleStr = namedGraph+": "+triple.getSubject().toString()+" "+triple.getPredicate().toString()+" "+triple.getObject().toString();
- System.err.println("Error ["+tripleStr+"] "+e.getStackTrace());
- continue;
- }finally{
- if(!virtGraph.isClosed()){
- virtGraph.close();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement