public class HybridCache extends MemoryCache implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected Iterator<Instance> |
instanceIterator |
protected TreeMap<String,Instance> |
instanceMap |
| Constructor and Description |
|---|
HybridCache() |
HybridCache(File folder)
Create cache specifying the parent folder.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInstance(Instance i) |
void |
addTriple(String s,
String p,
String o)
Adds a new spo statement to the cache
|
boolean |
containsInstance(Instance i) |
boolean |
containsUri(String uri) |
ArrayList<Instance> |
getAllInstances()
Returns all the instance contained in the cache
|
ArrayList<String> |
getAllUris() |
static HybridCache |
getData(File folder,
KBInfo kb)
Method to get Data of the specified endpoint, and cache it to the "cache"
folder in the folder specified.
|
static HybridCache |
getData(KBInfo kb) |
File |
getFolder()
Returns the file pointing to the parent folder of cache.
|
Instance |
getInstance(String uri) |
Instance |
getNextInstance()
Returns the next instance in the list of instances
|
static HybridCache |
getNoPrefixData(File folder,
KBInfo kb)
This method is used by learners which do not have prefix information and
with a specified folder containing the cache folder.
|
static HybridCache |
getNoPrefixData(KBInfo kb)
This method is used by learners which do not have prefix information.
|
static HybridCache |
loadFromFile(File file)
Tries to load the content of the cache from a file
|
void |
resetIterator() |
void |
saveToFile(File file)
Tries to serialize the content of the cache to a file.
|
void |
setFolder(File folder)
Set the parent folder of the cache sub folder.
|
int |
size() |
String |
toString() |
addProperty, clone, equals, getAllProperties, getSample, hashCode, parseCSVtoRDFModel, replaceInstancepublic HybridCache()
public HybridCache(File folder)
folder - File pointing to the the parent folder of the (to-be-created)
"cache" folder.public static HybridCache loadFromFile(File file) throws IOException
file - File from which the content is to be loadedIOException - if file not foundpublic static HybridCache getData(KBInfo kb)
public static HybridCache getData(File folder, KBInfo kb)
folder - Path to the parent folder of the "cache" folder.kb - Endpoint specification.public static HybridCache getNoPrefixData(KBInfo kb)
kb - Info to the knowledge base to querypublic static HybridCache getNoPrefixData(File folder, KBInfo kb)
folder - Path to parent folder of the supposed cache folder.kb - Info to the knowledge base to querypublic Instance getNextInstance()
getNextInstance in class MemoryCachepublic ArrayList<Instance> getAllInstances()
getAllInstances in class MemoryCachepublic void addInstance(Instance i)
addInstance in class MemoryCachepublic Instance getInstance(String uri)
getInstance in class MemoryCacheuri - URI to look forpublic int size()
size in class MemoryCachepublic void addTriple(String s, String p, String o)
addTriple in class MemoryCaches - The URI of the instance linked to o via pp - The property which links s and oo - The value of the property of p for the entity spublic boolean containsUri(String uri)
containsUri in class MemoryCacheuri - The URI to looks forpublic void resetIterator()
resetIterator in class MemoryCachepublic String toString()
toString in class MemoryCachepublic ArrayList<String> getAllUris()
getAllUris in class MemoryCachepublic boolean containsInstance(Instance i)
containsInstance in class MemoryCachei - The instance to look forpublic void saveToFile(File file)
file - File wherein the content of the cache is to be serializedpublic File getFolder()
public void setFolder(File folder)
folder - Pointing to the parent folder holding the cache.Copyright © 2020. All rights reserved.