Let me try that. I was always checking for the model first. On Wed, Feb 4, 2015 at 12:09 PM, Claude Warren <[email protected]> wrote:
> for some reason I thought that getModel would get the model if it exists > and create it if it doesn't. > > On Wed, Feb 4, 2015 at 5:02 PM, Trevor Donaldson <[email protected]> > wrote: > > > Not sure if this is right but I am pretty much implementing this logic. > > boolean modelExist = true; > > if(datasetaccessor.containsModel(GRAPH_NAME)){ > > model = datasetAccessor.getModel(GRAPH_NAME); > > } else{ > > model = ModelFactory.createDefaultModel(); > > modelExist = false; > > } > > > > build triples do model manipulation..... > > > > if(!modelExist){ > > datasetAccessor.put(GRAPH_NAME,model); > > } else{ > > datasetAccessor.add(model); > > } > > > > > > On Wed, Feb 4, 2015 at 11:48 AM, Trevor Donaldson <[email protected]> > > wrote: > > > > > How do I create a model with a graph name if it doesn't exist? I have > > > tried > > > Model model = ModelFactory.createDefaultModel(); > > > datasetaccessor.put("http:example.org#exampleGraph",model); > > > > > > That doesn't seem to work. > > > > > > > > > -- > I like: Like Like - The likeliest place on the web > <http://like-like.xenei.com> > LinkedIn: http://www.linkedin.com/in/claudewarren >
