@Test public void map_withClasses_appliesEveryClassToGeneratedSubject() throws Exception { EvaluateExpression evaluator = null; SimpleValueFactory f = SimpleValueFactory.getInstance(); IRI subjectIRI = f.createIRI("http: when(subjectGenerator.apply(evaluator)) .thenReturn(ImmutableList.of(subjectIRI)); Set<IRI> expectedClasses = ImmutableSet.of( f.createIRI("http: f.createIRI("http: f.createIRI("http: ); Model model = new ModelBuilder().build(); SubjectMapper s = new SubjectMapper(subjectGenerator, ImmutableSet.of(), expectedClasses, ImmutableSet.of()); s.map(model, evaluator); expectedClasses.forEach(iri -> Assert.assertTrue(model.contains(subjectIRI, RDF.TYPE, iri))); }
Optional<Resource> map(Model model, EvaluateExpression evaluate) { LOG.debug("Determining subjects ..."); List<Resource> subject = generator.apply(evaluate); LOG.debug("Determined subjects {}", subject); return subject.stream().findFirst().map(s -> mapSubject(s, model, evaluate)); }
SubjectMapper { Optional<Resource> map(Model model, EvaluateExpression evaluate) { LOG.debug("Determining subjects ..."); List<Resource> subject = generator.apply(evaluate); LOG.debug("Determined subjects {}", subject); return subject.stream().findFirst().map(s -> mapSubject(s, model, evaluate)); } }
SubjectMapper { Optional<Resource> map(Model model, EvaluateExpression evaluate) { LOG.debug("Determining subjects ..."); List<Resource> subject = generator.apply(evaluate); LOG.debug("Determined subjects {}", subject); return subject.stream().findFirst().map(s -> mapSubject(s, model, evaluate)); } SubjectMapper(
		TermGenerator<Resource> generator,
		Set<TermGenerator<IRI>> graphGenerators,
		Set<IRI> classes,
		Set<PredicateObjectMapper> predicateObjectMappers
	); }
SubjectMapper { Optional<Resource> map(Model model, EvaluateExpression evaluate) { LOG.debug("Determining subjects ..."); List<Resource> subject = generator.apply(evaluate); LOG.debug("Determined subjects {}", subject); return subject.stream().findFirst().map(s -> mapSubject(s, model, evaluate)); } SubjectMapper(
		TermGenerator<Resource> generator,
		Set<TermGenerator<IRI>> graphGenerators,
		Set<IRI> classes,
		Set<PredicateObjectMapper> predicateObjectMappers
	);  }
SubjectMapper { Optional<Resource> map(Model model, EvaluateExpression evaluate) { LOG.debug("Determining subjects ..."); List<Resource> subject = generator.apply(evaluate); LOG.debug("Determined subjects {}", subject); return subject.stream().findFirst().map(s -> mapSubject(s, model, evaluate)); } SubjectMapper(
		TermGenerator<Resource> generator,
		Set<TermGenerator<IRI>> graphGenerators,
		Set<IRI> classes,
		Set<PredicateObjectMapper> predicateObjectMappers
	);   }