Discussion:
Scalability
Saeed
2013-03-22 10:47:48 UTC
Permalink
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? 
If it is the second case then what happens when the database size is bigger than memory size of local machine??

My concern is about scalability. I want to know that if Jena is operable on different scales, and to be more specific when the size of our tripe store is much bigger than the memory of local machine which runs Jena API. In this case what is the best way to create an OntModel out of Model to not face any difficulties with memory space?

Best regards,
Saeed
Dave Reynolds
2013-03-22 11:00:16 UTC
Permalink
Post by Saeed
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
Saeed
2013-03-25 08:44:49 UTC
Permalink
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.

Regards,
Saeed



----- Original Message -----
From: Dave Reynolds <dave.e.reynolds-***@public.gmane.org>
To: users-***@public.gmane.org
Cc:
Sent: Friday, March 22, 2013 12:00 PM
Subject: Re: Scalability
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
Dave Reynolds
2013-03-25 09:15:02 UTC
Permalink
Post by Saeed
Thanks Dave.
Post by Dave Reynolds
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
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
Post by Saeed
----- Original Message -----
Sent: Friday, March 22, 2013 12:00 PM
Subject: Re: Scalability
Post by Dave Reynolds
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
Loading...