/** * */ package eu.dnetlib.ariadneplus; import eu.dnetlib.ariadneplus.elasticsearch.BulkUpload; import eu.dnetlib.ariadneplus.reader.ResourceManager; import eu.dnetlib.ariadneplus.reader.RunSPARQLQueryService; import eu.dnetlib.ariadneplus.reader.json.ParseRDFJSON; import org.junit.Ignore; import org.junit.Test; import org.springframework.core.io.ClassPathResource; import java.util.Properties; /** * @author enrico.ottonello * */ public class GraphDbReaderAndESIndexTest { private RunSPARQLQueryService runSPQRLQuery; @Test @Ignore public void readAndIndexTest() throws Exception { final ClassPathResource resource = new ClassPathResource("application.properties"); Properties appProps = new Properties(); appProps.load(resource.getInputStream()); runSPQRLQuery = new RunSPARQLQueryService(); runSPQRLQuery.setupConnection( appProps.getProperty("graphdb.writer.user"), appProps.getProperty("graphdb.writer.pwd"), appProps.getProperty("repository.url"), appProps.getProperty("graphdb.repository")); ParseRDFJSON parseRDFJSON = new ParseRDFJSON(); parseRDFJSON.setCatalogEntryJsonPath(appProps.getProperty("catalog.entry.path")); runSPQRLQuery.setParser(parseRDFJSON); ResourceManager resourceManager = new ResourceManager(); resourceManager.setup( appProps.getProperty("type.path"), appProps.getProperty("general.classpath"), appProps.getProperty("exclude.predicates"), appProps.getProperty("class.map.specifications") ); resourceManager.init(); runSPQRLQuery.setResourceManager(resourceManager); BulkUpload bulkUpload = new BulkUpload(); bulkUpload.init(); runSPQRLQuery.setBulkUpload(bulkUpload); runSPQRLQuery.executeQueryGraph(); } }