On 25/03/13 08:44, Saeed wrote:
Thanks Dave.
The former. An OntModel is just an interface onto a base model and the
base model in your case is just an interface onto the database. It is
not copied into memory
Referring to this page:
http://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/ontology/OntModelSpec.html
Description of every OntModelSpec has this part in common "A specification for ...
models that are stored in memory and ..."
I would appreciate if you clarify this conflict for me.
It's just confusing javadoc. Possibly a hangover from an ancient (now
deprecated and removed) database backend.
What it means to say is that all the current OntModelSpecs just take the
base model as given and query it. Some of them add inference, some don't.
So the real question is what's the behaviour of the base model.
The Model implementations for both TDB and SDB act as if the data were
all available but it is not loaded into memory - each access prompts a
new query to underlying database.
TDB, of course, being a lot faster at this than SDB.
Dave
----- Original Message -----
From: Dave Reynolds <[email protected]>
To: [email protected]
Cc:
Sent: Friday, March 22, 2013 12:00 PM
Subject: Re: Scalability
On 22/03/13 10:47, Saeed wrote:
Hello,
I have a question regarding Model Interface; I would appreciate if someone
helps me.
I’m using SDB and MySQL as tripe store in my application. The following lines
are the peace of code which I use to connect to the database and make a Model
and OntModel.
SDBConnection conn = newSDBConnection(jdbcConnection) ;
Store store = StoreFactory.create(storeDesc, conn) ;
Model model = SDBFactory.connectDefaultModel(store) ;
OntModel ont = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM,model);
My question is about instantiating a Model and making OntModel using Model.
When a Model instantiated, Is it just an interface to access the contents of
database or the whole database contents are already transferred into Model?
The former. An OntModel is just an interface onto a base model and the
base model in your case is just an interface onto the database. It is
not copied into memory.
Note that had you specified an OntModelSpec involving inference then the
inference engine may need to access arbitrary fractions of the stored
data and the internal inference state is held in memory and can exceed
the size of the base model.
Without inference you are fine.
Dave