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 void
deleteOldCache(String cacheName)
static File
getDiskCachePath(String name)
Obtain the path for the ontology cache.static boolean
hasChanged(String cacheName)
static com.hp.hpl.jena.ontology.OntModel
loadMemoryModel(InputStream is, String url)
static com.hp.hpl.jena.ontology.OntModel
loadMemoryModel(InputStream is, String url, boolean processImports)
Load an ontology into memory.static com.hp.hpl.jena.ontology.OntModel
loadMemoryModel(String url)
Load an ontology into memory.static com.hp.hpl.jena.ontology.OntModel
loadMemoryModel(String url, String cacheName)
static com.hp.hpl.jena.ontology.OntModel
loadMemoryModel(String url, String cacheName, boolean processImports)
Load an ontology into memory.static URLConnection
openConnection(String url)
-
-
-
Method Detail
-
loadMemoryModel
public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel(InputStream is, String url)
-
loadMemoryModel
public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel(InputStream is, String url, boolean processImports)
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, boolean)
-
loadMemoryModel
public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel(String url, @Nullable String cacheName)
-
loadMemoryModel
public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel(String url, @Nullable String cacheName, boolean processImports)
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) throws IOException
- Throws:
IOException
-
openConnection
public static URLConnection openConnection(String url) throws IOException
- Throws:
IOException
-
-