throw new IllegalArgumentException("The parsed Model MUST NOT be NULL");
}
this.model = model;
this.readWrite = readWrite;
if(!readWrite){ //construct an graph
jenaAdapter = new JenaGraphAdaptor(model.getGraph()){
/**
* Ensure that no in-memory copies are created for read only
* Jena Graphs
* @return
*/
@Override
public Graph getGraph() {
return new SimpleGraph(this,true);
}
};
graph = new PrivilegedGraphWrapper(jenaAdapter.getGraph());
} else { //construct an MGraph
jenaAdapter = new JenaGraphAdaptor(model.getGraph());
this.graph = new DatasetLockedMGraph(lock,
new PrivilegedMGraphWrapper(jenaAdapter));
}
}