public Model createModelFromFile(String filename, String baseUri) throws IOException {
Model model = new LinkedHashModel();
if (filename != null) {
try {
RDFParser parser = Rio.createParser(SesameTestHelper.detectFileFormat(filename));
parser.setRDFHandler(new ContextStatementCollector(model, ValueFactoryImpl.getInstance()));
ParserConfig config = parser.getParserConfig();
config.set(BasicParserSettings.PRESERVE_BNODE_IDS, true);
config.addNonFatalError(BasicParserSettings.VERIFY_DATATYPE_VALUES);
config.addNonFatalError(BasicParserSettings.VERIFY_LANGUAGE_TAGS);