@Test public void IriTermGenerator_withRelativeIRI_usesBaseIRI() throws Exception { ValueFactory f = SimpleValueFactory.getInstance(); String baseIri = "http: TermGeneratorCreator tgc = new TermGeneratorCreator(f, baseIri, null, TemplateParser.build(), null); String ref = "ref"; TermGenerator<Value> generator = tgc.getObjectGenerator(new CarmlObjectMap(ref, null, null, TermType.IRI, null, null, null, null)); String relativeIriPart = "/relativeIriPortion"; EvaluateExpression evaluator = Mockito.mock(EvaluateExpression.class); when(evaluator.apply(ref)).thenReturn(Optional.of(relativeIriPart)); List<Value> result = generator.apply(evaluator); Assert.assertTrue(!result.isEmpty()); Assert.assertTrue(result.get(0) instanceof IRI); Assert.assertEquals(result.get(0), f.createIRI(baseIri + relativeIriPart)); }
@SuppressWarnings("unchecked") TermGenerator<Value> getObjectGenerator(ObjectMap map) { return (TermGenerator<Value>) getGenerator( map, ImmutableSet.of(TermType.IRI, TermType.BLANK_NODE, TermType.LITERAL), ImmutableSet.of(IRI.class, Literal.class) ); }
TermGeneratorCreator { @SuppressWarnings("unchecked") TermGenerator<Value> getObjectGenerator(ObjectMap map) { return (TermGenerator<Value>) getGenerator( map, ImmutableSet.of(TermType.IRI, TermType.BLANK_NODE, TermType.LITERAL), ImmutableSet.of(IRI.class, Literal.class) ); } }
TermGeneratorCreator { @SuppressWarnings("unchecked") TermGenerator<Value> getObjectGenerator(ObjectMap map) { return (TermGenerator<Value>) getGenerator( map, ImmutableSet.of(TermType.IRI, TermType.BLANK_NODE, TermType.LITERAL), ImmutableSet.of(IRI.class, Literal.class) ); } TermGeneratorCreator(
		ValueFactory valueFactory,
		String baseIri,
		Function<String, String> makeIriSafe,
		TemplateParser templateParser,
		RmlMapper mapper
	); }
TermGeneratorCreator { @SuppressWarnings("unchecked") TermGenerator<Value> getObjectGenerator(ObjectMap map) { return (TermGenerator<Value>) getGenerator( map, ImmutableSet.of(TermType.IRI, TermType.BLANK_NODE, TermType.LITERAL), ImmutableSet.of(IRI.class, Literal.class) ); } TermGeneratorCreator(
		ValueFactory valueFactory,
		String baseIri,
		Function<String, String> makeIriSafe,
		TemplateParser templateParser,
		RmlMapper mapper
	);  }
TermGeneratorCreator { @SuppressWarnings("unchecked") TermGenerator<Value> getObjectGenerator(ObjectMap map) { return (TermGenerator<Value>) getGenerator( map, ImmutableSet.of(TermType.IRI, TermType.BLANK_NODE, TermType.LITERAL), ImmutableSet.of(IRI.class, Literal.class) ); } TermGeneratorCreator(
		ValueFactory valueFactory,
		String baseIri,
		Function<String, String> makeIriSafe,
		TemplateParser templateParser,
		RmlMapper mapper
	);   }