Skip to content

Commit

Permalink
Refactored code to use env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dschiese committed Apr 11, 2024
1 parent 913c179 commit 2b0d7ce
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.apache.jena.query.ResultSet;
import org.apache.jena.rdfconnection.RDFConnection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Repository;
Expand All @@ -30,11 +31,10 @@ public abstract class AbstractRepository implements SparqlRepositoryIF {
protected Environment environment;
protected RDFConnection rdfConnection;


@Autowired
protected AbstractRepository(Environment environment) throws MalformedURLException {
this.environment = environment;
this.sparqlEndpoint = new URL("http://localhost:8080/sparql");
this.sparqlEndpoint = new URL(environment.getProperty("sparql.endpoint"));
this.rdfConnection = RDFConnection.connect(sparqlEndpoint.toString());
}

Expand Down

0 comments on commit 2b0d7ce

Please sign in to comment.