}
public static Object build(String assemblerFile, Resource type)
{
if ( assemblerFile == null )
throw new ARQException("No assembler file") ;
Model spec = null ;
try {
spec = FileManager.get().loadModel(assemblerFile) ;
} catch (Exception ex)
{ throw new ARQException("Failed reading assembler description: "+ex.getMessage()) ; }
Resource root = null ;
InfoLevel level = ARQ.getExecutionLogging() ;
ARQ.setExecutionLogging(InfoLevel.NONE) ;
try {
root = GraphUtils.findRootByType(spec, type) ;
if ( root == null )
return null ;
} catch (TypeNotUniqueException ex)
{ throw new ARQException("Multiple types for: "+DatasetAssemblerVocab.tDataset) ; }
finally
{ ARQ.setExecutionLogging(level) ; }
return Assembler.general.open(root) ;
}