On Thu, 2011-10-13 at 09:36 -0430, Israel wrote: 
> Hi there,
> 
> I'll start this mail with the typical "i'm very new to this semantic web
> stuff".
> 
> I've been using Jena to develop my thesis to obtain the Computer Engineer
> Degree, here in Venezuela. I've been following the tutorials ans, by now,
> I'm able to load owl files into Jena InfModels and run Pellet over that
> model to make inferences. I can also write RDF or add triplets to an
> existent RDF model. But i'm having some trouble by doing the same thing when
> I load the triplets from a Database Engine like Virtuoso (I decided to use
> it because it supports RDF, RDFS and some OWL-DL by default, or that's what
> I've read)
> 
> Here's the thing, since i was doing some testing with Jena loading my owl
> file on an InfModel and doing the inferences with that, I thought it would
> be pretty much the same if I load the model from a database, but for some
> reason it just fails when reasoning.

In what way does it fail? What's the symptoms? 

> Here's a "step-by-step" of what i've tries:
> 
> 1.- Load a SPARQL CONSTRUCT on a jena Model
> 2.- Create a Reasoner and bind it to the Model
> 3.- Make the Valitidy Report
> 4.- Print the inferred model
> 5.- Print the model's size.
> 
> Here's the chunk of code there I try to do this:
> 
> String construct = "CONSTRUCT { ?s ?p ?o } FROM <http://thesis.com#> WHERE {
> ?s ?p ?o }";
> VirtuosoQueryExecution vqe2 =
> VirtuosoQueryExecutionFactory.create(construct, graph);

The above is all Virtuso-specific so you'll need to ask them for support
for that.

> Model m = vqe2.execConstruct();

At this point test what is in m, do you have any data back? Is it what
you expect?

If you have data then what is the java class of m? If it is anything
other than ModelCom then maybe there is something strange about the
model implementation. In which case try copying it to a plain Jena model
before proceeding.

> Reasoner reasoner = PelletReasonerFactory.theInstance().create();
> reasoner = reasoner.bindSchema(m);
> InfModel model = ModelFactory.createInfModel(reasoner, m);

This isn't your problem but you shouldn't need pass m both to bindSchema
and to the InfModel constructor - skip the bindSchema bit.

> ValidityReport rep = model.validate();
> printIterator(rep.getReports(), "Validation Reports");
> System.out.println(model.size());
> 
> Any help will be welcome.
> 
> Also, I would like to ask (because I have no person to ask here since this
> is the very first Semantic Web related work in my university) if the
> architecture i'm planning to develop is the best way to do it. My
> dissertation is to develop a Domain-Specific Semantic Web based search
> engine. I developed the ontology using Protegé Editor and it's based on the
> IEEE and ACM Computer Science Curricula Recommendations. My plan is to
> persist the ontology using Virtuoso, retrieve it with jena, make all the
> inferences using Pellet and expose all as Web Services, maybe using Joseki,
> I Don't know if i'm thinking it well. If anyone can recommend me a better
> way i'll be grateful, I don't know if using a database engine like Virtuoso
> is too much for this project.

The chances are that your ontology is small enough you might as well
just read it from a file. Once you run Pellet over it you will want it
in memory anyway. If all you do with the database is to load it all into
memory then it's not buying you anything.

Dave


Reply via email to