Class OntologyCacheOwlApi
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_owlapi.OntologyCacheOwlApi
public class OntologyCacheOwlApi extends Object
Cache for ontologies for the OWL Api.
-
Field Summary
Fields Modifier and Type Field Description private static boolean
isDeactivatedCache
This flag indicates whether the cache is to be used (i.e., ontologies are held in memory).private static org.slf4j.Logger
LOGGER
private static Map<String,org.semanticweb.owlapi.model.OWLOntology>
ontologyCache
The internal cache for ontologies that is dependent on the OntModelSpec. -
Constructor Summary
Constructors Constructor Description OntologyCacheOwlApi()
-
Method Summary
Modifier and Type Method Description private static org.semanticweb.owlapi.model.OWLOntologyManager
createManager()
static void
emptyCache()
Empties the cache.static org.semanticweb.owlapi.model.OWLOntology
get(File file)
static org.semanticweb.owlapi.model.OWLOntology
get(String uri)
static org.semanticweb.owlapi.model.OWLOntology
get(String uri, boolean useCache)
Returns the OntModel for the given uri using a cache if indicated to do so.static org.semanticweb.owlapi.model.OWLOntology
get(URL url)
static org.semanticweb.owlapi.model.OWLOntology
get(URL url, boolean useCache)
boolean
isDeactivatedCache()
private static org.semanticweb.owlapi.model.OWLOntology
readOWLOntology(String uri)
void
setDeactivatedCache(boolean deactivatedCache)
Deactivating the cache will also clear the cache.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ontologyCache
The internal cache for ontologies that is dependent on the OntModelSpec. -
isDeactivatedCache
private static boolean isDeactivatedCacheThis flag indicates whether the cache is to be used (i.e., ontologies are held in memory).
-
-
Constructor Details
-
OntologyCacheOwlApi
public OntologyCacheOwlApi()
-
-
Method Details
-
get
Returns the OntModel for the given uri using a cache if indicated to do so.- Parameters:
uri
- The URI of the ontology that shall be cached.useCache
- Indicates whether the cache shall be used. If set to false, ontologies will not be held in memory but re-read every time time.- Returns:
- OntModel reference.
-
readOWLOntology
-
createManager
private static org.semanticweb.owlapi.model.OWLOntologyManager createManager() -
get
-
get
-
get
-
get
-
isDeactivatedCache
public boolean isDeactivatedCache() -
emptyCache
public static void emptyCache()Empties the cache. -
setDeactivatedCache
public void setDeactivatedCache(boolean deactivatedCache)Deactivating the cache will also clear the cache. If an ontology is requested twice it is ready every time from disk.- Parameters:
deactivatedCache
- true if cache is to be deactivated, else false.
-