|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibspan.tss.core.storage.ModelLoader
public class ModelLoader
This class provides transparent access to ontology models by knowing only
URIs of their base namespaces. By indirect utilizing of
LocationMapper
it maps these URIs into local
files. The developer in obligated to edit these mappings in default file:
"etc/location-mapping.n3"
.
To access persistent models stored in database it uses single connection
described in file pointed by the DB_CONNECTION_FILE
constant.
Field Summary | |
---|---|
static String |
DB_CONNECTION_FILE
URL of property file describing access to database for this machine. |
static String |
DB_PASSWORD_KEY
|
static String |
DB_TYPE_KEY
|
static String |
DB_URL_KEY
|
static String |
DB_USER_KEY
|
Constructor Summary | |
---|---|
ModelLoader()
|
Method Summary | |
---|---|
static OntModelSpec |
getDBOntModelSpec(ConnectionDescription desc)
Creates specification for OntModel, in which (1) base Model is stored in the database described by the given connection description, and (2) imported ontology are stored in memory-based models. |
static OntModel |
loadDBModel(String uri)
Loads content of the owl file pointed by given uri into
persistent model stored in the database. |
static OntModel |
loadModel(String uri)
Loads content of the owl file pointed by given uri into
memory-based model. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DB_CONNECTION_FILE
public static final String DB_URL_KEY
public static final String DB_USER_KEY
public static final String DB_PASSWORD_KEY
public static final String DB_TYPE_KEY
Constructor Detail |
---|
public ModelLoader()
Method Detail |
---|
public static OntModel loadDBModel(String uri) throws ModelLoaderInitException
uri
into
persistent model stored in the database. The uri plays also two-fold
role: (a) it stands for name of the model in database and (b) identify
model, so it could be cached by OntDocumentManager
; then each
application using the same instance of OntDocumentManager accesses the
same cached model.
Primary, models are stored in local file and ModelLoaders tries to read them into database. This is done only for the first time of access to the particular model and this operation could time-consuming.
uri
- the address of OWL file (usually its base namespace)
ModelLoaderInitException
public static OntModel loadModel(String uri)
uri
into
memory-based model. The uri plays also the role of name of the model, so
it is read into memory and cached, and then each application using the
same instance of OntDocumentManager
accesses the same cached
model.
uri
- the address of OWL file (usually its base namespace)
public static OntModelSpec getDBOntModelSpec(ConnectionDescription desc) throws ModelLoaderInitException
desc
- description of the database connection
null
if problem with creating model specification
occurs
ModelLoaderInitException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |