public class Cache extends Object implements Serializable
Constructor and Description |
---|
Cache(String cacheDir)
Constructor for the cache itself.
|
Cache(String cacheDir,
boolean useDatabase) |
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
deletes all Files in the cacheDir, does not delete the cacheDir itself,
and can thus still be used without creating a new Cache Object
|
boolean |
executeSparqlAskQuery(SparqlQuery query) |
String |
executeSparqlQuery(SparqlQuery query)
Takes a SPARQL query (which has not been evaluated yet) as argument and
returns a JSON result set.
|
static Cache |
getDefaultCache() |
static String |
getDefaultCacheDir()
the default cachedir normally is "cache".
|
static String |
getPersistantCacheDir()
a more persistant cache used for example generation."cachePersistant"
|
static Cache |
getPersistentCache()
A Persistant cache is stored in the folder cachePersistant.
|
void |
setFreshnessInDays(int days)
Changes how long cached results will stay fresh (default 15 days).
|
public Cache(String cacheDir)
cacheDir
- Where the base path to the cache is .public static Cache getPersistentCache()
public static Cache getDefaultCache()
public static String getDefaultCacheDir()
public static String getPersistantCacheDir()
public String executeSparqlQuery(SparqlQuery query)
query
- The SPARQL query.public boolean executeSparqlAskQuery(SparqlQuery query)
public void clearCache()
public void setFreshnessInDays(int days)
days
- number of days DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2019 Jens Lehmann