Source:
public void loadTurtleFile() throws Exception { final InstallConfiguration installConfig = InstallConfiguration.builder() .setEnableTableHashPrefix(false) .setEnableEntityCentricIndex(false) .setEnableFreeTextIndex(false) .setEnableTemporalIndex(false) .setEnablePcjIndex(false) .setEnableGeoIndex(false) .build(); MongoConnectionDetails connectionDetails = getConnectionDetails(); final RyaClient ryaClient = MongoRyaClientFactory.build(connectionDetails, conf.getMongoClient()); final Install install = ryaClient.getInstall(); install.install(conf.getCollectionName(), installConfig); ryaClient.getLoadStatementsFile() .loadStatements( conf.getCollectionName(), Paths.get("src/test/resources/example.ttl"), RDFFormat.TURTLE); final ValueFactory vf = new ValueFactoryImpl(); final List<Statement> expected = new ArrayList<>(); expected.add(vf.createStatement(vf.createURI("http://example#alice"), vf.createURI("http://example#talksTo"), vf.createURI("http://example#bob"))); expected.add(vf.createStatement(vf.createURI("http://example#bob"), vf.createURI("http://example#talksTo"), vf.createURI("http://example#charlie"))); expected.add(vf.createStatement(vf.createURI("http://example#charlie"), vf.createURI("http://example#likes"), vf.createURI("http://example#icecream"))); final List<Statement> statements = new ArrayList<>(); MongoCursor<Document> x = getRyaCollection().find().iterator(); System.out.println("getRyaCollection().count()=" + getRyaCollection().count()); while (x.hasNext()) { Document y = x.next(); System.out.println("getRyaCollection()=" + y); } assertEquals("Expect all rows to be read.", 3, getRyaCollection().count()); }

Target:
public void loadTurtleFile() throws Exception { final InstallConfiguration installConfig = InstallConfiguration.builder() .setEnableTableHashPrefix(false) .setEnableEntityCentricIndex(false) .setEnableFreeTextIndex(false) .setEnableTemporalIndex(false) .setEnablePcjIndex(false) .setEnableGeoIndex(false) .build(); MongoConnectionDetails connectionDetails = getConnectionDetails(); final RyaClient ryaClient = MongoRyaClientFactory.build(connectionDetails, conf.getMongoClient()); final Install install = ryaClient.getInstall(); install.install(conf.getMongoDBName(), installConfig); ryaClient.getLoadStatementsFile().loadStatements( conf.getMongoDBName(), Paths.get("src/test/resources/example.ttl"), RDFFormat.TURTLE); final ValueFactory vf = new ValueFactoryImpl(); final List<Statement> expected = new ArrayList<>(); expected.add(vf.createStatement(vf.createURI("http://example#alice"), vf.createURI("http://example#talksTo"), vf.createURI("http://example#bob"))); expected.add(vf.createStatement(vf.createURI("http://example#bob"), vf.createURI("http://example#talksTo"), vf.createURI("http://example#charlie"))); expected.add(vf.createStatement(vf.createURI("http://example#charlie"), vf.createURI("http://example#likes"), vf.createURI("http://example#icecream"))); final List<Statement> statements = new ArrayList<>(); MongoCursor<Document> x = getRyaCollection().find().iterator(); System.out.println("getRyaCollection().count()=" + getRyaCollection().count()); while (x.hasNext()) { Document y = x.next(); statements.add(vf.createStatement(vf.createURI(y.getString("subject")), vf.createURI(y.getString("predicate")), vf.createURI(y.getString("object")))); } assertEquals("Expect all rows to be read.", 3, getRyaCollection().count()); assertEquals("All rows in DB should match expected rows:", expected, statements); }