@Test public void testFindBladeRunnerByTitle() { List<RdfTriple> movies = testGraph.queryByTriple(null, TITLE_PREDICATE, BLADE_RUNNER_TITLE); assertEquals(movies.size(), 1); RdfTriple movie = movies.get(0); assertEquals(movie.getSubject(), bladeRunner); assertEquals(movie.getPredicate(), TITLE_PREDICATE); assertEquals(movie.getObject(), BLADE_RUNNER_TITLE); }
@Test public void testDirectedByRidleyScott() { List<RdfTriple> movies = testGraph.queryByTriple(null, DIRECTED_BY_PREDICATE, ridleyScott); assertTrue("Too many Ridley Scott Movies", movies.size() == 2); for (RdfTriple movie : movies) { System.out.println(movie); assertEquals(movie.getPredicate(), DIRECTED_BY_PREDICATE); assertEquals(movie.getObject(), ridleyScott); assertTrue(movie.getSubject().equals(bladeRunner) || movie.getSubject().equals(alien)); } }