From: <lor...@us...> - 2011-01-18 21:04:22
|
Revision: 2624 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2624&view=rev Author: lorenz_b Date: 2011-01-18 21:04:16 +0000 (Tue, 18 Jan 2011) Log Message: ----------- Added setter for query execution timeout. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java 2011-01-18 16:35:14 UTC (rev 2623) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java 2011-01-18 21:04:16 UTC (rev 2624) @@ -61,6 +61,8 @@ // specifies after how many seconds a cached result becomes invalid private long freshnessInMilliseconds = 15 * 24 * 60 * 60 * 1000; // 15 days + private int maxExecutionTimeInSeconds = 0; + private Connection conn; MessageDigest md5; @@ -99,7 +101,7 @@ } public Model executeConstructQuery(SparqlEndpoint endpoint, String query) throws SQLException, UnsupportedEncodingException { - return executeConstructQuery(endpoint, query, 0); + return executeConstructQuery(endpoint, query, maxExecutionTimeInSeconds); } public Model executeConstructQuery(SparqlEndpoint endpoint, String query, int maxExecutionTimeInSeconds) throws SQLException, UnsupportedEncodingException { @@ -169,7 +171,7 @@ } public String executeSelectQuery(SparqlEndpoint endpoint, String query) { - return executeSelectQuery(endpoint, query, 0); + return executeSelectQuery(endpoint, query, maxExecutionTimeInSeconds); } public String executeSelectQuery(SparqlEndpoint endpoint, String query, int maxExecutionTimeInSeconds) { @@ -250,6 +252,10 @@ } } + public void setMaxExecutionTimeInSeconds(int maxExecutionTimeInSeconds){ + this.maxExecutionTimeInSeconds = maxExecutionTimeInSeconds; + } + public static void main(String[] args) throws ClassNotFoundException, SQLException, NoSuchAlgorithmException, UnsupportedEncodingException { SparqlEndpoint endpoint = SparqlEndpoint.getEndpointDBpediaLiveAKSW(); String resource = "http://dbpedia.org/resource/Leipzig"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |