}
public static DatasetGraph createDatasetGraph(List<String> uriList, List<String> namedSourceList,
FileManager fileManager, String baseURI)
{
DatasetGraph ds = DatasetGraphFactory.createMem() ;
if ( fileManager == null )
fileManager = FileManager.get() ;
// Merge into background graph
if ( uriList != null )
{
Model m = GraphFactory.makeDefaultModel() ;
for (Iterator<String> iter = uriList.iterator() ; iter.hasNext() ; )
{
String sourceURI = iter.next() ;
String absURI = null ;
if ( baseURI != null )
absURI = IRIResolver.resolveString(sourceURI, baseURI) ;
else
absURI = IRIResolver.resolveString(sourceURI) ;
// FileManager.readGraph?
fileManager.readModel(m, sourceURI, absURI, null) ;
}
ds.setDefaultGraph(m.getGraph()) ;
}
else
{
ds.setDefaultGraph(GraphFactory.createDefaultGraph()) ;
}
if ( namedSourceList != null )
{
for (Iterator<String> iter = namedSourceList.iterator() ; iter.hasNext() ; )
{
String sourceURI = iter.next();
String absURI = null ;
if ( baseURI != null )
absURI = IRIResolver.resolveString(baseURI, sourceURI) ;
else
absURI = IRIResolver.resolveString(sourceURI) ;
Model m = fileManager.loadModel(sourceURI, absURI, null) ;
Node gn = NodeFactory.createURI(sourceURI) ;
ds.addGraph(gn, m.getGraph()) ;
}
}
return ds ;
}