-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from Swirrl/rdf4j-and-updates
Update drafter to RDF4j and latest grafter
- Loading branch information
Showing
33 changed files
with
320 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144 changes: 76 additions & 68 deletions
144
src-java/drafter_sparql_repository/drafter-sparql-repository.iml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
src-java/drafter_sparql_repository/src/main/java/drafter/rdf/DrafterSPARQLConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 19 additions & 10 deletions
29
src-java/drafter_sparql_repository/src/main/java/drafter/rdf/DrafterSesameClientImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,36 @@ | ||
package drafter.rdf; | ||
|
||
import org.apache.http.client.HttpClient; | ||
import org.apache.http.impl.client.HttpClients; | ||
import org.openrdf.http.client.SesameClientImpl; | ||
import org.openrdf.http.client.SparqlSession; | ||
import org.eclipse.rdf4j.http.client.SPARQLProtocolSession; | ||
import org.eclipse.rdf4j.http.client.SharedHttpClientSessionManager; | ||
import org.eclipse.rdf4j.http.client.SparqlSession; | ||
|
||
import java.util.concurrent.ExecutorService; | ||
import java.util.concurrent.Executors; | ||
|
||
public class DrafterSesameClientImpl extends SesameClientImpl { | ||
//public class DrafterSesameClientImpl extends SesameClientImpl { | ||
public class DrafterSesameClientImpl extends SharedHttpClientSessionManager { | ||
|
||
private static final ExecutorService QUERY_EXECUTOR = Executors.newCachedThreadPool(); | ||
|
||
public DrafterSesameClientImpl(HttpClient httpClient) { | ||
this.setHttpClient(httpClient); | ||
} | ||
|
||
@Override public synchronized SparqlSession createSparqlSession(String queryEndpointUrl, String updateEndpointUrl) { | ||
//NOTE: The two-argument constructor (HttpClient, ExecutorService) of SesameClientImpl does not seem to be | ||
//used and the executor is created by the initialize() method called from the default constructor. initialize() | ||
//sets the executor to Executors.newCachedThreadPool() | ||
//ExecutorService executor = Executors.newCachedThreadPool(); | ||
@Override public SPARQLProtocolSession createSPARQLProtocolSession(String queryEndpointUrl, String updateEndpointUrl) { | ||
DrafterSparqlSession session = new DrafterSparqlSession(queryEndpointUrl, updateEndpointUrl, this.getHttpClient(), QUERY_EXECUTOR); | ||
|
||
return new DrafterSparqlSession(queryEndpointUrl, updateEndpointUrl, this.getHttpClient(), QUERY_EXECUTOR); | ||
//session.setQueryURL(queryEndpointUrl); | ||
//session.setUpdateURL(updateEndpointUrl); | ||
return session; | ||
} | ||
|
||
// @Override public synchronized SparqlSession createSparqlSession(String queryEndpointUrl, String updateEndpointUrl) { | ||
// //NOTE: The two-argument constructor (HttpClient, ExecutorService) of SesameClientImpl does not seem to be | ||
// //used and the executor is created by the initialize() method called from the default constructor. initialize() | ||
// //sets the executor to Executors.newCachedThreadPool() | ||
// //ExecutorService executor = Executors.newCachedThreadPool(); | ||
// | ||
// return new DrafterSparqlSession(queryEndpointUrl, updateEndpointUrl, this.getHttpClient(), QUERY_EXECUTOR); | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.