RessourceLoader NullPointer gefixed
All checks were successful
Productdefinitions Build & Deploy / deploy (push) Successful in 39s
All checks were successful
Productdefinitions Build & Deploy / deploy (push) Successful in 39s
This commit is contained in:
@@ -33,18 +33,15 @@ import java.util.stream.Collectors;
|
||||
|
||||
import static org.eclipse.rdf4j.model.util.Values.iri;
|
||||
|
||||
@Service
|
||||
public class AprioriService {
|
||||
|
||||
@Autowired
|
||||
private ResourceLoader resourceLoader;
|
||||
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
|
||||
public String getProductsResponse(ProductsRequest productsRequest) {
|
||||
Repository repo = new SailRepository(new MemoryStore());
|
||||
repo.init();
|
||||
|
||||
try (RepositoryConnection conn = repo.getConnection()) {
|
||||
Resource resource = resourceLoader.getResource("classpath:data/prodelements.ttl");
|
||||
Resource resource = resolver.getResource("classpath:data/prodelements.ttl");
|
||||
conn.add(resource.getInputStream(), "", RDFFormat.TURTLE);
|
||||
|
||||
String queryString = """
|
||||
@@ -115,7 +112,7 @@ public class AprioriService {
|
||||
repo.init();
|
||||
|
||||
try (RepositoryConnection conn = repo.getConnection()) {
|
||||
Resource resource = resourceLoader.getResource("classpath:data/Attribute.ttl");
|
||||
Resource resource = resolver.getResource("classpath:data/Attribute.ttl");
|
||||
conn.add(resource.getInputStream(), "", RDFFormat.TURTLE);
|
||||
|
||||
String queryString = """
|
||||
@@ -158,7 +155,7 @@ public class AprioriService {
|
||||
repo.init();
|
||||
|
||||
try (RepositoryConnection conn = repo.getConnection()) {
|
||||
Resource resource = resourceLoader.getResource("classpath:data/Attribute.ttl");
|
||||
Resource resource = resolver.getResource("classpath:data/Attribute.ttl");
|
||||
conn.add(resource.getInputStream(), "", RDFFormat.TURTLE);
|
||||
|
||||
String queryString = """
|
||||
@@ -201,7 +198,7 @@ public class AprioriService {
|
||||
repo.init();
|
||||
|
||||
try (RepositoryConnection conn = repo.getConnection()) {
|
||||
Resource resource = resourceLoader.getResource("classpath:data/Attribute.ttl");
|
||||
Resource resource = resolver.getResource("classpath:data/Attribute.ttl");
|
||||
conn.add(resource.getInputStream(), "", RDFFormat.TURTLE);
|
||||
|
||||
String queryString = """
|
||||
@@ -240,7 +237,7 @@ public class AprioriService {
|
||||
repo.init();
|
||||
|
||||
try (RepositoryConnection conn = repo.getConnection()) {
|
||||
Resource resource = resourceLoader.getResource("classpath:data/Attribute.ttl");
|
||||
Resource resource = resolver.getResource("classpath:data/Attribute.ttl");
|
||||
conn.add(resource.getInputStream(), "", RDFFormat.TURTLE);
|
||||
|
||||
String queryString = """
|
||||
|
||||
Reference in New Issue
Block a user