The library library(semweb/rdf_cache) defines the caching strategy for triples sources. When using large RDF sources, caching triples greatly speedup loading RDF documents. The cache library implements two caching strategies that are controlled by rdf_set_cache_options/1.
Local caching This approach applies to files only. Triples are
cached in a sub-directory of the directory holding the source. This
directory is called
_cache on Windows). If the cache
true, a cache directory is created
Global caching This approach applies to all sources, except for
unnamed streams. Triples are cached in directory defined by the cache
When loading an RDF file, the system scans the configured cache files
cache(false) is specified as option to rdf_load/2 or caching is
disabled. If caching is enabled but no cache exists, the system will try
to create a cache file. First it will try to do this locally. On failure
it will try to configured global cache.
- Change the cache policy. Provided options are:
true, caching is enabled.
local_directory(Name). Plain name of local directory. Default
true, try to create local cache directories
global_directory(Dir)Writeable directory for storing cached parsed files.
true, try to create the global cache directory.
- rdf_cache_file(+URL, +ReadWrite, -File) is semidet
- File is the cache file for URL. If ReadWrite is
read, it returns the name of an existing file. If
writeit returns where a new cache file can be overwritten or created.