TransformationFacade { public Collection<Statement> localizeAndMigrate( Collection<Statement> pipeline, Collection<Statement> options, IRI newIri) throws TransformationFailed { PipelineInfo info = loadPipelineInfo(pipeline); ImportTransformer transformer = new ImportTransformer( templateFacade, mappingFacade); pipeline = transformer.localizePipeline( pipeline, options, info, newIri); if (info.getVersion() != Pipeline.VERSION_NUMBER) { Migration migration = new Migration(templateFacade); migration.setThrowOnWarning(false); pipeline = migration.migrate(pipeline); } return pipeline; } @Autowired  TransformationFacade(
            TemplateFacade templates, MappingFacade mappings); Collection<Statement> migrateThrowOnWarning(
            Collection<Statement> pipeline); Collection<Statement> localizeAndMigrate(
            Collection<Statement> pipeline,
            Collection<Statement> options,
            IRI newIri);  }
@Test public void importVisualisationPipeline() throws Exception { Statements input = new Statements(TestUtils.rdfFromResource( "pipeline/transformation/visualisationPipelineInput.trig")); Statements expected = new Statements(TestUtils.rdfFromResource( "pipeline/transformation/visualisationPipelineExpected.trig")); Statements options = Statements.arrayList(); Template sparqlEndpoint = Mockito.mock(Template.class); Mockito.when(sparqlEndpoint.getIri()).thenReturn( "http: + "e-sparqlEndpoint/1.0.0"); TemplateFacade templateFacade = Mockito.mock(TemplateFacade.class); Mockito.when(templateFacade.getTemplates()).thenReturn( Arrays.asList(sparqlEndpoint)); Mockito.when(templateFacade.getTemplate(sparqlEndpoint.getIri())) .thenReturn(sparqlEndpoint); Mockito.when(templateFacade.getRootTemplate(sparqlEndpoint)) .thenReturn(sparqlEndpoint); TransformationFacade transformation = new TransformationFacade(templateFacade, null); Collection<Statement> actual = transformation.localizeAndMigrate( input, options, this.valueFactory.createIRI("http: Rdf4jUtils.rdfEqual(expected, actual); Assert.assertTrue(Models.isomorphic(expected, actual)); }
@Test public void localWithTemplatesExpected() throws Exception { Statements input = new Statements(TestUtils.rdfFromResource( "pipeline/transformation/localWithTemplatesInput.trig")); Statements expected = new Statements(TestUtils.rdfFromResource( "pipeline/transformation/localWithTemplatesExpected.trig")); Statements options = Statements.arrayList(); options.addBoolean("http: "http: true); TransformationFacade transformation = new TransformationFacade(null, null); Collection<Statement> actual = transformation.localizeAndMigrate( input, options, this.valueFactory.createIRI("http: Rdf4jUtils.rdfEqual(expected, actual); Assert.assertTrue(Models.isomorphic(expected, actual)); }