From: Olaf H. <ha...@in...> - 2009-11-19 09:30:13
|
Hey, On Thursday 19 November 2009 08:57:26 Arun Rao wrote: > Hi, > > I am trying to create an InfModel object using a NG4J NamedGraphModel and > when I get the raw model from the InfModel, I expect to get back the > original NamedGraphModel. So? Do you get it? (i.e. is infModel.getRawModel() an instance of NamedGraphModel?) > While this comparison returns true: > infModel.getRawModel().equals(ngModel) > > I am not able to cast infModel.getRawModel().getGraph() to NamedGraphSet > since infModel.getRawModel().getGraph() seems to be an instance of an inner > class of NamedGraphSetImpl. That's true. > There does not seem to be a simple way in which I can get NamedGraphModel > back. I would expect you get the NamedGraphModel by calling getRawModel() - at least that's what the Jena Javadoc says. The problem seems to be (I assume based on your use of the getGraph() method) that you are not interested in the NamedGraphModel that backs the infModel but you are interested in the NamedGraphSet that backs the NamedGraphModel. Right? If so, you should be able to call ( (NamedGraphModel) infModel.getRawModel() ).getNamedGraphSet() Greetings, Olaf |