{
Model model = ModelFactory.createDefaultModel() ;
for ( String uri : graphURLs )
{
if ( uri == null || uri.equals("") )
throw new InternalErrorException("Default graph URI is null or the empty string") ;
try {
//TODO Clearup - RIOT integration.
GraphLoadUtils.loadModel(model, uri, MaxTriples) ;
log.info(format("[%d] Load (default graph) %s", action.id, uri)) ;
} catch (RiotException ex) {
log.info(format("[%d] Parsing error loading %s: %s", action.id, uri, ex.getMessage())) ;
errorBadRequest("Failed to load URL (parse error) "+uri+" : "+ex.getMessage()) ;
} catch (Exception ex)
{
log.info(format("[%d] Failed to load (default) %s: %s", action.id, uri, ex.getMessage())) ;
errorBadRequest("Failed to load URL "+uri) ;
}
}
dataset.setDefaultModel(model) ;
}
// ---- Named graphs
if ( namedGraphs != null )
{
for ( String uri : namedGraphs )
{
if ( uri == null || uri.equals("") )
throw new InternalErrorException("Named graph URI is null or the empty string") ;
try {
Model model = ModelFactory.createDefaultModel() ;
GraphLoadUtils.loadModel(model, uri, MaxTriples) ;
log.info(format("[%d] Load (named graph) %s", action.id, uri)) ;