Package ubic.basecode.ontology.jena
Class OntologyLoader
- java.lang.Object
-
- ubic.basecode.ontology.jena.OntologyLoader
-
public class OntologyLoader extends Object
Reads ontologies from OWL resources- Author:
- paul
-
-
Constructor Summary
Constructors Constructor Description OntologyLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddeleteOldCache(String cacheName)static FilegetDiskCachePath(String name)Obtain the path for the ontology cache.static booleanhasChanged(String cacheName)static com.hp.hpl.jena.ontology.OntModelloadMemoryModel(InputStream is, String url)Load an ontology into memory.static com.hp.hpl.jena.ontology.OntModelloadMemoryModel(String url)Load an ontology into memory.static com.hp.hpl.jena.ontology.OntModelloadMemoryModel(String url, String cacheName)Load an ontology into memory.static URLConnectionopenConnection(String url)
-
-
-
Method Detail
-
loadMemoryModel
public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel(InputStream is, String url)
Load an ontology into memory. Use this type of model when fast access is critical and memory is available.
-
loadMemoryModel
public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel(String url)
Load an ontology into memory. Use this type of model when fast access is critical and memory is available.- See Also:
loadMemoryModel(String, String)
-
loadMemoryModel
public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel(String url, @Nullable String cacheName)
Load an ontology into memory. Use this type of model when fast access is critical and memory is available. If load from URL fails, attempt to load from disk cache under @cacheName.Uses
OntModelSpec.OWL_MEM_TRANS_INF.- Parameters:
url- a URL where the OWL file is storedcacheName- unique name of this ontology, will be used to load from disk in case of failed url connection
-
hasChanged
public static boolean hasChanged(String cacheName)
-
deleteOldCache
public static void deleteOldCache(String cacheName)
-
openConnection
public static URLConnection openConnection(String url)
-
-